uint32_t ff_squareTbl[512] = {0, };
-#define BIT_DEPTH 9
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 12
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 14
+#define BIT_DEPTH 16
#include "dsputil_template.c"
#undef BIT_DEPTH
#define FUNC(f, depth) f ## _ ## depth
#define FUNCC(f, depth) f ## _ ## depth ## _c
-#define BIT_DEPTH_FUNCS(depth, dct)\
- c->get_pixels = FUNCC(get_pixels ## dct , depth);\
- c->draw_edges = FUNCC(draw_edges , depth);\
- c->clear_block = FUNCC(clear_block ## dct , depth);\
- c->clear_blocks = FUNCC(clear_blocks ## dct , depth);\
+#define BIT_DEPTH_FUNCS(depth) \
+ c->get_pixels = FUNCC(get_pixels, depth);\
+ c->draw_edges = FUNCC(draw_edges, depth);
+
+ c->clear_block = FUNCC(clear_block, 8);\
+ c->clear_blocks = FUNCC(clear_blocks, 8);\
switch (avctx->bits_per_raw_sample) {
case 9:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(9, _32);
- } else {
- BIT_DEPTH_FUNCS(9, _16);
- }
- break;
case 10:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(10, _32);
- } else {
- BIT_DEPTH_FUNCS(10, _16);
- }
- break;
case 12:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(12, _32);
- } else {
- BIT_DEPTH_FUNCS(12, _16);
- }
- break;
case 14:
- if (c->dct_bits == 32) {
- BIT_DEPTH_FUNCS(14, _32);
- } else {
- BIT_DEPTH_FUNCS(14, _16);
- }
+ BIT_DEPTH_FUNCS(16);
break;
default:
if(avctx->bits_per_raw_sample<=8 || avctx->codec_type != AVMEDIA_TYPE_VIDEO) {
- BIT_DEPTH_FUNCS(8, _16);
+ BIT_DEPTH_FUNCS(8);
}
break;
}
* DSPContext.
*/
typedef struct DSPContext {
- /**
- * Size of DCT coefficients.
- */
- int dct_bits;
-
/* pixel ops : interface with DCT */
void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
memcpy(last_line + (i + 1) * wrap, last_line, (width + w + w) * sizeof(pixel)); // bottom
}
-#define DCTELEM_FUNCS(dctcoef, suffix) \
-static void FUNCC(get_pixels ## suffix)(int16_t *av_restrict _block, \
- const uint8_t *_pixels, \
- int line_size) \
-{ \
- const pixel *pixels = (const pixel *) _pixels; \
- dctcoef *av_restrict block = (dctcoef *) _block; \
- int i; \
- \
- /* read the pixels */ \
- for(i=0;i<8;i++) { \
- block[0] = pixels[0]; \
- block[1] = pixels[1]; \
- block[2] = pixels[2]; \
- block[3] = pixels[3]; \
- block[4] = pixels[4]; \
- block[5] = pixels[5]; \
- block[6] = pixels[6]; \
- block[7] = pixels[7]; \
- pixels += line_size / sizeof(pixel); \
- block += 8; \
- } \
-} \
- \
-static void FUNCC(clear_block ## suffix)(int16_t *block) \
-{ \
- memset(block, 0, sizeof(dctcoef)*64); \
-} \
- \
-/** \
- * memset(blocks, 0, sizeof(int16_t)*6*64) \
- */ \
-static void FUNCC(clear_blocks ## suffix)(int16_t *blocks) \
-{ \
- memset(blocks, 0, sizeof(dctcoef)*6*64); \
+static void FUNCC(get_pixels)(int16_t *av_restrict block,
+ const uint8_t *_pixels,
+ int line_size)
+{
+ const pixel *pixels = (const pixel *) _pixels;
+ int i;
+
+ /* read the pixels */
+ for(i=0;i<8;i++) {
+ block[0] = pixels[0];
+ block[1] = pixels[1];
+ block[2] = pixels[2];
+ block[3] = pixels[3];
+ block[4] = pixels[4];
+ block[5] = pixels[5];
+ block[6] = pixels[6];
+ block[7] = pixels[7];
+ pixels += line_size / sizeof(pixel);
+ block += 8;
+ }
}
-DCTELEM_FUNCS(int16_t, _16)
-#if BIT_DEPTH > 8
-DCTELEM_FUNCS(dctcoef, _32)
+#if BIT_DEPTH == 8
+static void FUNCC(clear_block)(int16_t *block)
+{
+ memset(block, 0, sizeof(int16_t)*64);
+}
+
+/**
+ * memset(blocks, 0, sizeof(int16_t)*6*64)
+ */
+static void FUNCC(clear_blocks)(int16_t *blocks)
+{
+ memset(blocks, 0, sizeof(int16_t)*6*64);
+}
#endif
#if BIT_DEPTH == 8
h->dequant_coeff_pps = -1;
if (CONFIG_ERROR_RESILIENCE) {
- h->dsp.dct_bits = 16;
/* needed so that IDCT permutation is known early */
ff_dsputil_init(&h->dsp, h->avctx);
}
ff_h264_pred_init(&h->hpc, h->avctx->codec_id, h->sps.bit_depth_luma,
h->sps.chroma_format_idc);
if (CONFIG_ERROR_RESILIENCE) {
- h->dsp.dct_bits = h->sps.bit_depth_luma > 8 ? 32 : 16;
ff_dsputil_init(&h->dsp, h->avctx);
}
ff_videodsp_init(&h->vdsp, h->sps.bit_depth_luma);