Commit de1f8ead authored by Anton Khirnov's avatar Anton Khirnov

hevcdsp_template: templatize transquant_bypass

parent 16c01fb4
...@@ -40,16 +40,16 @@ static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int size, ...@@ -40,16 +40,16 @@ static void FUNC(put_pcm)(uint8_t *_dst, ptrdiff_t stride, int size,
} }
} }
static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs, static av_always_inline void FUNC(transquant_bypass)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride) ptrdiff_t stride, int size)
{ {
int x, y; int x, y;
pixel *dst = (pixel *)_dst; pixel *dst = (pixel *)_dst;
stride /= sizeof(pixel); stride /= sizeof(pixel);
for (y = 0; y < 4; y++) { for (y = 0; y < size; y++) {
for (x = 0; x < 4; x++) { for (x = 0; x < size; x++) {
dst[x] = av_clip_pixel(dst[x] + *coeffs); dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++; coeffs++;
} }
...@@ -57,55 +57,28 @@ static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs, ...@@ -57,55 +57,28 @@ static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
} }
} }
static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs, static void FUNC(transquant_bypass4x4)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride) ptrdiff_t stride)
{ {
int x, y; FUNC(transquant_bypass)(_dst, coeffs, stride, 4);
pixel *dst = (pixel *)_dst; }
stride /= sizeof(pixel);
for (y = 0; y < 8; y++) { static void FUNC(transquant_bypass8x8)(uint8_t *_dst, int16_t *coeffs,
for (x = 0; x < 8; x++) { ptrdiff_t stride)
dst[x] = av_clip_pixel(dst[x] + *coeffs); {
coeffs++; FUNC(transquant_bypass)(_dst, coeffs, stride, 8);
}
dst += stride;
}
} }
static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs, static void FUNC(transquant_bypass16x16)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride) ptrdiff_t stride)
{ {
int x, y; FUNC(transquant_bypass)(_dst, coeffs, stride, 16);
pixel *dst = (pixel *)_dst;
stride /= sizeof(pixel);
for (y = 0; y < 16; y++) {
for (x = 0; x < 16; x++) {
dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
}
} }
static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs, static void FUNC(transquant_bypass32x32)(uint8_t *_dst, int16_t *coeffs,
ptrdiff_t stride) ptrdiff_t stride)
{ {
int x, y; FUNC(transquant_bypass)(_dst, coeffs, stride, 32);
pixel *dst = (pixel *)_dst;
stride /= sizeof(pixel);
for (y = 0; y < 32; y++) {
for (x = 0; x < 32; x++) {
dst[x] = av_clip_pixel(dst[x] + *coeffs);
coeffs++;
}
dst += stride;
}
} }
static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs, static void FUNC(transform_skip)(uint8_t *_dst, int16_t *coeffs,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment