History

[Processing] Pick dyadic downsample function based on stride

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.

Sindre Aamås committed 10 years ago

Commit 7cbb75e1 parent 770e48a2 files · +45 −57Browse files

Showing the changes to codec/processing/src/downsample/downsample.h (1 of 2 files). Show all

Unified · Split

codec/processing/src/downsample/downsample.h+4−3
@@ -73,8 +73,8 @@ SpecificDownsampleFunc DyadicBilinearOneThirdDownsampler_c; · 72 unmodified lines
7373 SpecificDownsampleFunc DyadicBilinearQuarterDownsampler_c;
7474
7575 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;
7878 PSpecificDownsampleFunc pfOneThirdDownsampler;
7979 PSpecificDownsampleFunc pfQuarterDownsampler;
8080 PGeneralDownsampleFunc pfGeneralRatioLuma;
@@ -185,7 +185,8 @@ class CDownsampling : public IStrategy { · 104 unmodified lines
185185 private:
186186 void InitDownsampleFuncs (SDownsampleFuncs& sDownsampleFunc, int32_t iCpuFlag);
187187
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);
189190 bool AllocateSampleBuffer();
190191 void FreeSampleBuffer();
191192 private:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t