#include "mpegvideo.h"
#include "config.h"
-uint8_t ff_cropTbl[256 + 2 * MAX_NEG_CROP] = {0, };
uint32_t ff_squareTbl[512] = {0, };
-#define BIT_DEPTH 9
-#include "dsputil_template.c"
-#undef BIT_DEPTH
-
-#define BIT_DEPTH 10
+#define BIT_DEPTH 16
#include "dsputil_template.c"
#undef BIT_DEPTH
#define pb_7f (~0UL/255 * 0x7f)
#define pb_80 (~0UL/255 * 0x80)
-const uint8_t ff_zigzag_direct[64] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-};
-
/* Specific zigzag scan for 248 idct. NOTE that unlike the
specification, we interleave the fields */
const uint8_t ff_zigzag248_direct[64] = {
#undef op_put
#undef op_put_no_rnd
+void ff_put_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ put_pixels8_8_c(dst, src, stride, 8);
+}
+void ff_avg_pixels8x8_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ avg_pixels8_8_c(dst, src, stride, 8);
+}
+void ff_put_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ put_pixels16_8_c(dst, src, stride, 16);
+}
+void ff_avg_pixels16x16_c(uint8_t *dst, uint8_t *src, ptrdiff_t stride)
+{
+ avg_pixels16_8_c(dst, src, stride, 16);
+}
+
#define put_qpel8_mc00_c ff_put_pixels8x8_c
#define avg_qpel8_mc00_c ff_avg_pixels8x8_c
#define put_qpel16_mc00_c ff_put_pixels16x16_c
#define avg_qpel16_mc00_c ff_avg_pixels16x16_c
#define put_no_rnd_qpel8_mc00_c ff_put_pixels8x8_c
-#define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_8_c
+#define put_no_rnd_qpel16_mc00_c ff_put_pixels16x16_c
static void wmv2_mspel8_h_lowpass(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int h){
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
} while (len > 0);
}
-static void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
+static void jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct (block);
put_pixels_clamped_c(block, dest, line_size);
}
-static void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
+static void jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct (block);
add_pixels_clamped_c(block, dest, line_size);
{
int i;
- for(i=0;i<256;i++) ff_cropTbl[i + MAX_NEG_CROP] = i;
- for(i=0;i<MAX_NEG_CROP;i++) {
- ff_cropTbl[i] = 0;
- ff_cropTbl[i + MAX_NEG_CROP + 256] = 255;
- }
-
for(i=0;i<512;i++) {
ff_squareTbl[i] = (i - 256) * (i - 256);
}
c->idct_permutation_type = FF_NO_IDCT_PERM;
} else {
if(avctx->idct_algo==FF_IDCT_INT){
- c->idct_put= ff_jref_idct_put;
- c->idct_add= ff_jref_idct_add;
+ c->idct_put= jref_idct_put;
+ c->idct_add= jref_idct_add;
c->idct = ff_j_rev_dct;
c->idct_permutation_type= FF_LIBMPEG2_IDCT_PERM;
}else if(avctx->idct_algo==FF_IDCT_FAAN){
c->add_pixels8 = add_pixels8_c;
-#define hpel_funcs(prefix, idx, num) \
- c->prefix ## _pixels_tab idx [0] = prefix ## _pixels ## num ## _8_c; \
- c->prefix ## _pixels_tab idx [1] = prefix ## _pixels ## num ## _x2_8_c; \
- c->prefix ## _pixels_tab idx [2] = prefix ## _pixels ## num ## _y2_8_c; \
- c->prefix ## _pixels_tab idx [3] = prefix ## _pixels ## num ## _xy2_8_c
-
- hpel_funcs(put, [0], 16);
- hpel_funcs(put, [1], 8);
- hpel_funcs(put, [2], 4);
- hpel_funcs(put, [3], 2);
- hpel_funcs(put_no_rnd, [0], 16);
- hpel_funcs(put_no_rnd, [1], 8);
- hpel_funcs(avg, [0], 16);
- hpel_funcs(avg, [1], 8);
- hpel_funcs(avg, [2], 4);
- hpel_funcs(avg, [3], 2);
- hpel_funcs(avg_no_rnd,, 16);
-
#undef FUNC
#undef FUNCC
#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);\
+ c->draw_edges = FUNCC(draw_edges, 8);
+ c->clear_block = FUNCC(clear_block, 8);
+ c->clear_blocks = FUNCC(clear_blocks, 8);
+
+#define BIT_DEPTH_FUNCS(depth) \
+ c->get_pixels = FUNCC(get_pixels, depth);
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);
- }
+ BIT_DEPTH_FUNCS(16);
break;
default:
- BIT_DEPTH_FUNCS(8, _16);
+ BIT_DEPTH_FUNCS(8);
break;
}