Assume that data can be written into the padding area following each line. This enables the use of faster routines for more cases. Align downsample buffer stride to a multiple of 32. With this all strides used should be a multiple of 16, which means that use of narrower downsample routines can be dropped altogether.
Showing the changes to codec/processing/src/downsample/downsample.h (1 of 2 files). Show all
Unified · Split
| @@ -73,8 +73,8 @@ SpecificDownsampleFunc DyadicBilinearOneThirdDownsampler_c; · 72 unmodified lines | ||
| 73 | 73 | SpecificDownsampleFunc DyadicBilinearQuarterDownsampler_c; |
| 74 | 74 | |
| 75 | 75 | typedef struct { |
| 76 | − // align_index: 0 = x32; 1 = x16; 2 = x8; 3 = common case left; | |
| 77 | − PHalveDownsampleFunc pfHalfAverage[4]; | |
| 76 | + PHalveDownsampleFunc pfHalfAverageWidthx32; | |
| 77 | + PHalveDownsampleFunc pfHalfAverageWidthx16; | |
| 78 | 78 | PSpecificDownsampleFunc pfOneThirdDownsampler; |
| 79 | 79 | PSpecificDownsampleFunc pfQuarterDownsampler; |
| 80 | 80 | PGeneralDownsampleFunc pfGeneralRatioLuma; |
| @@ -185,7 +185,8 @@ class CDownsampling : public IStrategy { · 104 unmodified lines | ||
| 185 | 185 | private: |
| 186 | 186 | void InitDownsampleFuncs (SDownsampleFuncs& sDownsampleFunc, int32_t iCpuFlag); |
| 187 | 187 | |
| 188 | − int32_t GetAlignedIndex (const int32_t kiSrcWidth); | |
| 188 | + void DownsampleHalfAverage (uint8_t* pDst, int32_t iDstStride, | |
| 189 | + uint8_t* pSrc, int32_t iSrcStride, int32_t iSrcWidth, int32_t iSrcHeight); | |
| 189 | 190 | bool AllocateSampleBuffer(); |
| 190 | 191 | void FreeSampleBuffer(); |
| 191 | 192 | private: |