diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 17:44:56 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-23 17:44:56 +0100 |
commit | ac8987591f5503768e7587c25693928f26fcb3d1 (patch) | |
tree | 2531b37d6673aea7f4d1c61549978664a2c807ac | |
parent | a793a587df05bfc789e040c13329825cf9a261a3 (diff) | |
parent | 88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f (diff) | |
download | ffmpeg-ac8987591f5503768e7587c25693928f26fcb3d1.tar.gz |
Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'
* commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f':
Drop DCTELEM typedef
Conflicts:
libavcodec/alpha/dsputil_alpha.h
libavcodec/alpha/motion_est_alpha.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/bfin/dsputil_bfin.h
libavcodec/bfin/pixels_bfin.S
libavcodec/cavs.c
libavcodec/cavsdec.c
libavcodec/dct-test.c
libavcodec/dnxhdenc.c
libavcodec/dsputil.c
libavcodec/dsputil.h
libavcodec/dsputil_template.c
libavcodec/eamad.c
libavcodec/h264_cavlc.c
libavcodec/h264idct_template.c
libavcodec/mpeg12.c
libavcodec/mpegvideo.c
libavcodec/mpegvideo.h
libavcodec/mpegvideo_enc.c
libavcodec/ppc/dsputil_altivec.c
libavcodec/proresdsp.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
169 files changed, 929 insertions, 907 deletions
diff --git a/doc/optimization.txt b/doc/optimization.txt index e3fd32401c..5a66d6bb3f 100644 --- a/doc/optimization.txt +++ b/doc/optimization.txt @@ -148,7 +148,7 @@ Alignment: Some instructions on some architectures have strict alignment restrictions, for example most SSE/SSE2 instructions on x86. The minimum guaranteed alignment is written in the .h files, for example: - void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size); + void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size); General Tips: diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 9d2b4f54c6..2db3026756 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -138,7 +138,7 @@ typedef struct FourXContext { int mv[256]; VLC pre_vlc; int last_dc; - DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; + DECLARE_ALIGNED(16, int16_t, block)[6][64]; void *bitstream_buffer; unsigned int bitstream_buffer_size; int version; @@ -153,7 +153,7 @@ typedef struct FourXContext { #define MULTIPLY(var, const) (((var) * (const)) >> 16) -static void idct(DCTELEM block[64]) +static void idct(int16_t block[64]) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; @@ -471,7 +471,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length) * decode block and dequantize. * Note this is almost identical to MJPEG. */ -static int decode_i_block(FourXContext *f, DCTELEM *block) +static int decode_i_block(FourXContext *f, int16_t *block) { int code, i, j, level, val; @@ -521,7 +521,7 @@ static int decode_i_block(FourXContext *f, DCTELEM *block) static inline void idct_put(FourXContext *f, int x, int y) { - DCTELEM (*block)[64] = f->block; + int16_t (*block)[64] = f->block; int stride = f->current_picture->linesize[0] >> 1; int i; uint16_t *dst = ((uint16_t*)f->current_picture->data[0]) + y * stride + x; @@ -542,7 +542,7 @@ static inline void idct_put(FourXContext *f, int x, int y) * cr = (-1b - 4g + 5r) / 14 */ for (y = 0; y < 8; y++) { for (x = 0; x < 8; x++) { - DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] + + int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] + 2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize int cb = block[4][x + 8 * y]; int cr = block[5][x + 8 * y]; diff --git a/libavcodec/alpha/dsputil_alpha.c b/libavcodec/alpha/dsputil_alpha.c index 38ac0209a8..7cfc1cb62b 100644 --- a/libavcodec/alpha/dsputil_alpha.c +++ b/libavcodec/alpha/dsputil_alpha.c @@ -23,15 +23,15 @@ #include "dsputil_alpha.h" #include "asm.h" -void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, +void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); -void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, +void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); #if 0 /* These functions were the base for the optimized assembler routines, and remain here for documentation purposes. */ -static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, +static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, int line_size) { int i = 8; @@ -55,7 +55,7 @@ static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, } while (--i); } -void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, +void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, int line_size) { int h = 8; @@ -100,9 +100,9 @@ void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, } #endif -static void clear_blocks_axp(DCTELEM *blocks) { +static void clear_blocks_axp(int16_t *blocks) { uint64_t *p = (uint64_t *) blocks; - int n = sizeof(DCTELEM) * 6 * 64; + int n = sizeof(int16_t) * 6 * 64; do { p[0] = 0; diff --git a/libavcodec/alpha/dsputil_alpha.h b/libavcodec/alpha/dsputil_alpha.h index 4bc09a497d..cdb51358de 100644 --- a/libavcodec/alpha/dsputil_alpha.h +++ b/libavcodec/alpha/dsputil_alpha.h @@ -19,26 +19,26 @@ #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H -#include "libavcodec/dsputil.h" +#include <stdint.h> -void ff_simple_idct_axp(DCTELEM *block); -void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block); +void ff_simple_idct_axp(int16_t *block); +void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block); void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, int line_size, int h); -void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, +void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, int line_size); -void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, +void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, int line_size); -extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, +extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); -extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, +extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, int line_size); -void get_pixels_mvi(DCTELEM *av_restrict block, - const uint8_t *av_restrict pixels, int line_size); -void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, +void get_pixels_mvi(int16_t *restrict block, + const uint8_t *restrict pixels, int line_size); +void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); diff --git a/libavcodec/alpha/dsputil_alpha_asm.S b/libavcodec/alpha/dsputil_alpha_asm.S index 32a8bc9562..557ba57a95 100644 --- a/libavcodec/alpha/dsputil_alpha_asm.S +++ b/libavcodec/alpha/dsputil_alpha_asm.S @@ -135,7 +135,7 @@ $aligned: .end put_pixels_axp_asm /************************************************************************ - * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, + * void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, * int line_size) */ .align 6 @@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm: .end put_pixels_clamped_mvi_asm /************************************************************************ - * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, + * void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, * int line_size) */ .align 6 diff --git a/libavcodec/alpha/motion_est_alpha.c b/libavcodec/alpha/motion_est_alpha.c index 927b25d992..9883feea85 100644 --- a/libavcodec/alpha/motion_est_alpha.c +++ b/libavcodec/alpha/motion_est_alpha.c @@ -23,8 +23,8 @@ #include "dsputil_alpha.h" #include "asm.h" -void get_pixels_mvi(DCTELEM *av_restrict block, - const uint8_t *av_restrict pixels, int line_size) +void get_pixels_mvi(int16_t *restrict block, + const uint8_t *restrict pixels, int line_size) { int h = 8; @@ -40,7 +40,7 @@ void get_pixels_mvi(DCTELEM *av_restrict block, } while (--h); } -void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, +void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) { int h = 8; uint64_t mask = 0x4040; diff --git a/libavcodec/alpha/mpegvideo_alpha.c b/libavcodec/alpha/mpegvideo_alpha.c index 28eca072c0..2e8cd79a84 100644 --- a/libavcodec/alpha/mpegvideo_alpha.c +++ b/libavcodec/alpha/mpegvideo_alpha.c @@ -23,7 +23,7 @@ #include "libavcodec/mpegvideo.h" #include "asm.h" -static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs, +static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs, uint64_t qscale, uint64_t qadd) { uint64_t qmul = qscale << 1; @@ -69,12 +69,12 @@ static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs, } } -static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block, +static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block, int n, int qscale) { int n_coeffs; uint64_t qadd; - DCTELEM block0 = block[0]; + int16_t block0 = block[0]; if (!s->h263_aic) { if (n < 4) @@ -96,7 +96,7 @@ static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block, block[0] = block0; } -static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block, +static void dct_unquantize_h263_inter_axp(MpegEncContext *s, int16_t *block, int n, int qscale) { int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]]; diff --git a/libavcodec/alpha/simple_idct_alpha.c b/libavcodec/alpha/simple_idct_alpha.c index 522efd2b4d..1a272bddaf 100644 --- a/libavcodec/alpha/simple_idct_alpha.c +++ b/libavcodec/alpha/simple_idct_alpha.c @@ -44,7 +44,7 @@ #define COL_SHIFT 20 /* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */ -static inline int idct_row(DCTELEM *row) +static inline int idct_row(int16_t *row) { int a0, a1, a2, a3, b0, b1, b2, b3, t; uint64_t l, r, t2; @@ -152,7 +152,7 @@ static inline int idct_row(DCTELEM *row) return 2; } -static inline void idct_col(DCTELEM *col) +static inline void idct_col(int16_t *col) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -229,7 +229,7 @@ static inline void idct_col(DCTELEM *col) /* If all rows but the first one are zero after row transformation, all rows will be identical after column transformation. */ -static inline void idct_col2(DCTELEM *col) +static inline void idct_col2(int16_t *col) { int i; uint64_t l, r; @@ -251,7 +251,7 @@ static inline void idct_col2(DCTELEM *col) stq(l, col + 14 * 4); stq(r, col + 15 * 4); } -void ff_simple_idct_axp(DCTELEM *block) +void ff_simple_idct_axp(int16_t *block) { int i; @@ -291,13 +291,13 @@ void ff_simple_idct_axp(DCTELEM *block) } } -void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block) { ff_simple_idct_axp(block); put_pixels_clamped_axp_p(block, dest, line_size); } -void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block) { ff_simple_idct_axp(block); add_pixels_clamped_axp_p(block, dest, line_size); diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index 45192d1b5c..ea75c3cc12 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -23,12 +23,12 @@ #include "libavcodec/dsputil.h" #include "dsputil_arm.h" -void ff_j_rev_dct_arm(DCTELEM *data); -void ff_simple_idct_arm(DCTELEM *data); +void ff_j_rev_dct_arm(int16_t *data); +void ff_simple_idct_arm(int16_t *data); /* XXX: local hack */ -static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); -static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); +static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); +static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); @@ -48,27 +48,27 @@ CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8) CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8) CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8) -void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest, +void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, int line_size); /* XXX: those functions should be suppressed ASAP when all IDCTs are converted */ -static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block) +static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct_arm (block); ff_put_pixels_clamped(block, dest, line_size); } -static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) +static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct_arm (block); ff_add_pixels_clamped(block, dest, line_size); } -static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block) +static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) { ff_simple_idct_arm (block); ff_put_pixels_clamped(block, dest, line_size); } -static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) +static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) { ff_simple_idct_arm (block); ff_add_pixels_clamped(block, dest, line_size); diff --git a/libavcodec/arm/dsputil_init_armv5te.c b/libavcodec/arm/dsputil_init_armv5te.c index b4f3f0616e..33d7970e68 100644 --- a/libavcodec/arm/dsputil_init_armv5te.c +++ b/libavcodec/arm/dsputil_init_armv5te.c @@ -21,9 +21,9 @@ #include "libavcodec/dsputil.h" #include "dsputil_arm.h" -void ff_simple_idct_armv5te(DCTELEM *data); -void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data); -void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data); +void ff_simple_idct_armv5te(int16_t *data); +void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data); av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) { diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index 1081135874..dc126fef8a 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -24,9 +24,9 @@ #include "libavcodec/dsputil.h" #include "dsputil_arm.h" -void ff_simple_idct_armv6(DCTELEM *data); -void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); -void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); +void ff_simple_idct_armv6(int16_t *data); +void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int); void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int); @@ -46,12 +46,12 @@ void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int); void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int); -void ff_add_pixels_clamped_armv6(const DCTELEM *block, - uint8_t *av_restrict pixels, +void ff_add_pixels_clamped_armv6(const int16_t *block, + uint8_t *restrict pixels, int line_size); -void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride); -void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1, +void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride); +void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c index 09248cc5fe..6aa430daba 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/dsputil_init_neon.c @@ -25,12 +25,12 @@ #include "libavcodec/dsputil.h" #include "dsputil_arm.h" -void ff_simple_idct_neon(DCTELEM *data); -void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data); -void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data); +void ff_simple_idct_neon(int16_t *data); +void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); -void ff_clear_block_neon(DCTELEM *block); -void ff_clear_blocks_neon(DCTELEM *blocks); +void ff_clear_block_neon(int16_t *block); +void ff_clear_blocks_neon(int16_t *blocks); void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int); void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int); @@ -62,9 +62,9 @@ void ff_avg_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); -void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); -void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); -void ff_put_signed_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); +void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int); +void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int); +void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int); void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int); void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int); diff --git a/libavcodec/arm/h264dsp_init_arm.c b/libavcodec/arm/h264dsp_init_arm.c index f150a4508d..4695707cf7 100644 --- a/libavcodec/arm/h264dsp_init_arm.c +++ b/libavcodec/arm/h264dsp_init_arm.c @@ -50,22 +50,22 @@ void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride, int height, int log2_den, int weightd, int weights, int offset); -void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride); +void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride); void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset, - DCTELEM *block, int stride, + int16_t *block, int stride, const uint8_t nnzc[6*8]); void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset, - DCTELEM *block, int stride, + int16_t *block, int stride, const uint8_t nnzc[6*8]); void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset, - DCTELEM *block, int stride, + int16_t *block, int stride, const uint8_t nnzc[6*8]); -void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride); -void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); +void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride); +void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride); void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset, - DCTELEM *block, int stride, + int16_t *block, int stride, const uint8_t nnzc[6*8]); static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) diff --git a/libavcodec/arm/jrevdct_arm.S b/libavcodec/arm/jrevdct_arm.S index 331ad85328..f951e2af34 100644 --- a/libavcodec/arm/jrevdct_arm.S +++ b/libavcodec/arm/jrevdct_arm.S @@ -66,7 +66,7 @@ row_loop: ldrsh r2, [lr, # 2] @ r2 = 'd2' @ Optimization for row that have all items except the first set to 0 - @ (this works as the DCTELEMS are always 4-byte aligned) + @ (this works as the int16_t are always 4-byte aligned) ldr r5, [lr, # 0] ldr r6, [lr, # 4] ldr r3, [lr, # 8] diff --git a/libavcodec/arm/mpegvideo_arm.c b/libavcodec/arm/mpegvideo_arm.c index 28838bb039..2e4f156d62 100644 --- a/libavcodec/arm/mpegvideo_arm.c +++ b/libavcodec/arm/mpegvideo_arm.c @@ -34,9 +34,9 @@ CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END); CHK_OFFS(MpegEncContext, h263_aic, H263_AIC); #endif -void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block, +void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block, int n, int qscale); -void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block, +void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block, int n, int qscale); void ff_MPV_common_init_arm(MpegEncContext *s) diff --git a/libavcodec/arm/mpegvideo_armv5te.c b/libavcodec/arm/mpegvideo_armv5te.c index 842620bad7..832c541084 100644 --- a/libavcodec/arm/mpegvideo_armv5te.c +++ b/libavcodec/arm/mpegvideo_armv5te.c @@ -25,7 +25,7 @@ #include "libavcodec/mpegvideo.h" #include "mpegvideo_arm.h" -void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count); +void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count); #ifdef ENABLE_ARM_TESTS /** @@ -33,7 +33,7 @@ void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int coun * have optimized implementations for each architecture. Is also used as a reference * implementation in regression tests */ -static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count) +static inline void dct_unquantize_h263_helper_c(int16_t *block, int qmul, int qadd, int count) { int i, level; for (i = 0; i < count; i++) { @@ -51,7 +51,7 @@ static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qa #endif static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int level, qmul, qadd; int nCoeffs; @@ -80,7 +80,7 @@ static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s, } static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int qmul, qadd; int nCoeffs; diff --git a/libavcodec/arm/rv34dsp_init_arm.c b/libavcodec/arm/rv34dsp_init_arm.c index 60ab82eed4..d3ce7a0516 100644 --- a/libavcodec/arm/rv34dsp_init_arm.c +++ b/libavcodec/arm/rv34dsp_init_arm.c @@ -24,11 +24,11 @@ #include "libavcodec/rv34dsp.h" #include "libavutil/arm/cpu.h" -void ff_rv34_inv_transform_noround_neon(DCTELEM *block); +void ff_rv34_inv_transform_noround_neon(int16_t *block); -void ff_rv34_inv_transform_noround_dc_neon(DCTELEM *block); +void ff_rv34_inv_transform_noround_dc_neon(int16_t *block); -void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); +void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block); void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc); void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp) diff --git a/libavcodec/arm/rv34dsp_neon.S b/libavcodec/arm/rv34dsp_neon.S index 522e387582..a29123f772 100644 --- a/libavcodec/arm/rv34dsp_neon.S +++ b/libavcodec/arm/rv34dsp_neon.S @@ -67,7 +67,7 @@ vsub.s32 q15, q14, q9 @ z0 - z3 .endm -/* void rv34_idct_add_c(uint8_t *dst, int stride, DCTELEM *block) */ +/* void rv34_idct_add_c(uint8_t *dst, int stride, int16_t *block) */ function ff_rv34_idct_add_neon, export=1 mov r3, r0 rv34_inv_transform r2 @@ -97,7 +97,7 @@ function ff_rv34_idct_add_neon, export=1 bx lr endfunc -/* void rv34_inv_transform_noround_neon(DCTELEM *block); */ +/* void rv34_inv_transform_noround_neon(int16_t *block); */ function ff_rv34_inv_transform_noround_neon, export=1 rv34_inv_transform r0 vshl.s32 q11, q2, #1 @@ -142,7 +142,7 @@ function ff_rv34_idct_dc_add_neon, export=1 bx lr endfunc -/* void rv34_inv_transform_dc_noround_c(DCTELEM *block) */ +/* void rv34_inv_transform_dc_noround_c(int16_t *block) */ function ff_rv34_inv_transform_noround_dc_neon, export=1 vld1.16 {d28[]}, [r0,:16] @ block[0] vmov.i16 d4, #251 diff --git a/libavcodec/arm/simple_idct_armv6.S b/libavcodec/arm/simple_idct_armv6.S index 0c19d267a8..79cf5d41fb 100644 --- a/libavcodec/arm/simple_idct_armv6.S +++ b/libavcodec/arm/simple_idct_armv6.S @@ -375,7 +375,7 @@ endfunc sub r0, r0, #(16*7) .endm -/* void ff_simple_idct_armv6(DCTELEM *data); */ +/* void ff_simple_idct_armv6(int16_t *data); */ function ff_simple_idct_armv6, export=1 push {r4-r11, lr} sub sp, sp, #128 @@ -390,7 +390,7 @@ function ff_simple_idct_armv6, export=1 pop {r4-r11, pc} endfunc -/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); */ +/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */ function ff_simple_idct_add_armv6, export=1 push {r0, r1, r4-r11, lr} sub sp, sp, #128 @@ -407,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1 pop {r4-r11, pc} endfunc -/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); */ +/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */ function ff_simple_idct_put_armv6, export=1 push {r0, r1, r4-r11, lr} sub sp, sp, #128 diff --git a/libavcodec/arm/simple_idct_neon.S b/libavcodec/arm/simple_idct_neon.S index a8fc13768e..c3e573c00a 100644 --- a/libavcodec/arm/simple_idct_neon.S +++ b/libavcodec/arm/simple_idct_neon.S @@ -261,7 +261,7 @@ endconst pop {r4-r7, pc} .endm -/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, DCTELEM *data); */ +/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */ function ff_simple_idct_put_neon, export=1 idct_start r2 @@ -316,7 +316,7 @@ function idct_col4_add8_neon bx lr endfunc -/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, DCTELEM *data); */ +/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */ function ff_simple_idct_add_neon, export=1 idct_start r2 @@ -355,7 +355,7 @@ function idct_col4_st16_neon bx lr endfunc -/* void ff_simple_idct_neon(DCTELEM *data); */ +/* void ff_simple_idct_neon(int16_t *data); */ function ff_simple_idct_neon, export=1 idct_start r0 diff --git a/libavcodec/arm/vp3dsp_init_arm.c b/libavcodec/arm/vp3dsp_init_arm.c index 4ce75fe651..5ffc8fd440 100644 --- a/libavcodec/arm/vp3dsp_init_arm.c +++ b/libavcodec/arm/vp3dsp_init_arm.c @@ -24,9 +24,9 @@ #include "libavcodec/dsputil.h" #include "libavcodec/vp3dsp.h" -void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data); -void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data); -void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data); +void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); +void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); +void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data); void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *); void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *); diff --git a/libavcodec/arm/vp8.h b/libavcodec/arm/vp8.h index 7574a51f50..709f83d9e5 100644 --- a/libavcodec/arm/vp8.h +++ b/libavcodec/arm/vp8.h @@ -23,7 +23,7 @@ #if HAVE_ARMV6_EXTERNAL #define decode_block_coeffs_internal ff_decode_block_coeffs_armv6 -int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, DCTELEM block[16], +int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16], uint8_t probs[8][3][NUM_DCT_TOKENS-1], int i, uint8_t *token_prob, int16_t qmul[2]); #endif diff --git a/libavcodec/arm/vp8dsp_armv6.S b/libavcodec/arm/vp8dsp_armv6.S index fd254ccc30..dfaba315b1 100644 --- a/libavcodec/arm/vp8dsp_armv6.S +++ b/libavcodec/arm/vp8dsp_armv6.S @@ -56,7 +56,7 @@ @ idct -@ void vp8_luma_dc_wht(DCTELEM block[4][4][16], DCTELEM dc[16]) +@ void vp8_luma_dc_wht(int16_t block[4][4][16], int16_t dc[16]) function ff_vp8_luma_dc_wht_armv6, export=1 push {r4-r10, lr} @@ -179,7 +179,7 @@ function ff_vp8_luma_dc_wht_armv6, export=1 pop {r4-r10, pc} endfunc -@ void vp8_luma_dc_wht_dc(DCTELEM block[4][4][16], DCTELEM dc[16]) +@ void vp8_luma_dc_wht_dc(int16_t block[4][4][16], int16_t dc[16]) function ff_vp8_luma_dc_wht_dc_armv6, export=1 ldrsh r2, [r1] mov r3, #0 @@ -192,7 +192,7 @@ function ff_vp8_luma_dc_wht_dc_armv6, export=1 bx lr endfunc -@ void vp8_idct_add(uint8_t *dst, DCTELEM block[16], int stride) +@ void vp8_idct_add(uint8_t *dst, int16_t block[16], int stride) function ff_vp8_idct_add_armv6, export=1 push {r4-r12, lr} sub sp, sp, #32 @@ -314,7 +314,7 @@ function ff_vp8_idct_add_armv6, export=1 pop {r4-r12, pc} endfunc -@ void vp8_idct_dc_add(uint8_t *dst, DCTELEM block[16], int stride) +@ void vp8_idct_dc_add(uint8_t *dst, int16_t block[16], int stride) function ff_vp8_idct_dc_add_armv6, export=1 push {r4-r6, lr} add r6, r0, r2, lsl #1 @@ -355,7 +355,7 @@ function ff_vp8_idct_dc_add_armv6, export=1 pop {r4-r6, pc} endfunc -@ void vp8_idct_dc_add4uv(uint8_t *dst, DCTELEM block[4][16], int stride) +@ void vp8_idct_dc_add4uv(uint8_t *dst, int16_t block[4][16], int stride) function ff_vp8_idct_dc_add4uv_armv6, export=1 push {r4, lr} @@ -371,7 +371,7 @@ function ff_vp8_idct_dc_add4uv_armv6, export=1 pop {r4, pc} endfunc -@ void vp8_idct_dc_add4y(uint8_t *dst, DCTELEM block[4][16], int stride) +@ void vp8_idct_dc_add4y(uint8_t *dst, int16_t block[4][16], int stride) function ff_vp8_idct_dc_add4y_armv6, export=1 push {r4, lr} diff --git a/libavcodec/arm/vp8dsp_init_armv6.c b/libavcodec/arm/vp8dsp_init_armv6.c index c3d024f5cb..e15e191e30 100644 --- a/libavcodec/arm/vp8dsp_init_armv6.c +++ b/libavcodec/arm/vp8dsp_init_armv6.c @@ -22,13 +22,13 @@ #include "libavcodec/vp8dsp.h" #include "vp8dsp.h" -void ff_vp8_luma_dc_wht_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]); -void ff_vp8_luma_dc_wht_dc_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]); +void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]); +void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]); -void ff_vp8_idct_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); -void ff_vp8_idct_dc_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); -void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); -void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); +void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride); +void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride); +void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); +void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); VP8_LF(armv6); diff --git a/libavcodec/arm/vp8dsp_init_neon.c b/libavcodec/arm/vp8dsp_init_neon.c index 965243c3e4..0468181f70 100644 --- a/libavcodec/arm/vp8dsp_init_neon.c +++ b/libavcodec/arm/vp8dsp_init_neon.c @@ -22,12 +22,12 @@ #include "libavcodec/vp8dsp.h" #include "vp8dsp.h" -void ff_vp8_luma_dc_wht_neon(DCTELEM block[4][4][16], DCTELEM dc[16]); +void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]); -void ff_vp8_idct_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); -void ff_vp8_idct_dc_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); -void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); -void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); +void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); +void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); +void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); +void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); VP8_LF(neon); diff --git a/libavcodec/asv.h b/libavcodec/asv.h index 4a6c799738..72d98c0b33 100644 --- a/libavcodec/asv.h +++ b/libavcodec/asv.h @@ -48,7 +48,7 @@ typedef struct ASV1Context{ int mb_height; int mb_width2; int mb_height2; - DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; + DECLARE_ALIGNED(16, int16_t, block)[6][64]; uint16_t intra_matrix[64]; int q_intra_matrix[64]; uint8_t *bitstream_buffer; diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index e4d950400f..b8a1f21026 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -94,7 +94,7 @@ static inline int asv2_get_level(GetBitContext *gb) return code - 31; } -static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]) +static inline int asv1_decode_block(ASV1Context *a, int16_t block[64]) { int i; @@ -125,7 +125,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]) return 0; } -static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64]) +static inline int asv2_decode_block(ASV1Context *a, int16_t block[64]) { int i, count, ccp; @@ -161,7 +161,7 @@ static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64]) return 0; } -static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]) +static inline int decode_mb(ASV1Context *a, int16_t block[6][64]) { int i; @@ -183,7 +183,7 @@ static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]) static inline void idct_put(ASV1Context *a, int mb_x, int mb_y) { - DCTELEM (*block)[64] = a->block; + int16_t (*block)[64] = a->block; int linesize = a->picture.linesize[0]; uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index e5f3b48ea4..a09aa73ce0 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -56,7 +56,7 @@ static inline void asv2_put_level(PutBitContext *pb, int level){ } } -static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){ +static inline void asv1_encode_block(ASV1Context *a, int16_t block[64]){ int i; int nc_count=0; @@ -89,7 +89,7 @@ static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){ put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]); } -static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){ +static inline void asv2_encode_block(ASV1Context *a, int16_t block[64]){ int i; int count=0; @@ -130,7 +130,7 @@ static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){ #define MAX_MB_SIZE (30*16*16*3/2/8) -static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){ +static inline int encode_mb(ASV1Context *a, int16_t block[6][64]){ int i; if (a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < MAX_MB_SIZE) { @@ -149,7 +149,7 @@ static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){ } static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ - DCTELEM (*block)[64]= a->block; + int16_t (*block)[64]= a->block; int linesize= a->picture.linesize[0]; int i; diff --git a/libavcodec/bfin/config_bfin.h b/libavcodec/bfin/config_bfin.h index f3a2c6ebc6..36439530e9 100644 --- a/libavcodec/bfin/config_bfin.h +++ b/libavcodec/bfin/config_bfin.h @@ -21,7 +21,7 @@ low level assembler interface wrapper DEFUN(put_pixels_clamped,mL1, - (DCTELEM *block, uint8_t *dest, int line_size)): + (int16_t *block, uint8_t *dest, int line_size)): body diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c index a1dcb14224..955aea01f6 100644 --- a/libavcodec/bfin/dsputil_bfin.c +++ b/libavcodec/bfin/dsputil_bfin.c @@ -27,20 +27,20 @@ int off; -static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block) +static void bfin_idct_add (uint8_t *dest, int line_size, int16_t *block) { ff_bfin_idct (block); ff_bfin_add_pixels_clamped (block, dest, line_size); } -static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block) +static void bfin_idct_put (uint8_t *dest, int line_size, int16_t *block) { ff_bfin_idct (block); ff_bfin_put_pixels_clamped (block, dest, line_size); } -static void bfin_clear_blocks (DCTELEM *blocks) +static void bfin_clear_blocks (int16_t *blocks) { // This is just a simple memset. // diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h index 43ac39c9e0..04f87cc2b8 100644 --- a/libavcodec/bfin/dsputil_bfin.h +++ b/libavcodec/bfin/dsputil_bfin.h @@ -24,8 +24,9 @@ #ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H #define AVCODEC_BFIN_DSPUTIL_BFIN_H +#include <stdint.h> + #include "config.h" -#include "libavcodec/dsputil.h" #if defined(__FDPIC__) && CONFIG_SRAM #define attribute_l1_text __attribute__ ((l1_text)) @@ -35,15 +36,15 @@ #define attribute_l1_data_b #endif -void ff_bfin_idct (DCTELEM *block) attribute_l1_text; -void ff_bfin_fdct (DCTELEM *block) attribute_l1_text; -void ff_bfin_vp3_idct (DCTELEM *block); -void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block); -void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block); -void ff_bfin_add_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text; -void ff_bfin_put_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text; -void ff_bfin_diff_pixels (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text; -void ff_bfin_get_pixels (DCTELEM *av_restrict block, const uint8_t *pixels, int line_size) attribute_l1_text; +void ff_bfin_idct (int16_t *block) attribute_l1_text; +void ff_bfin_fdct (int16_t *block) attribute_l1_text; +void ff_bfin_vp3_idct (int16_t *block); +void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block); +void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block); +void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text; +void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text; +void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text; +void ff_bfin_get_pixels (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text; int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text; int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; diff --git a/libavcodec/bfin/fdct_bfin.S b/libavcodec/bfin/fdct_bfin.S index e15acb654f..916957467c 100644 --- a/libavcodec/bfin/fdct_bfin.S +++ b/libavcodec/bfin/fdct_bfin.S @@ -20,7 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /* - void ff_bfin_fdct (DCTELEM *buf); + void ff_bfin_fdct (int16_t *buf); This implementation works only for 8x8 input. The range of input must be -256 to 255 i.e. 8bit input represented in a 16bit data @@ -61,9 +61,9 @@ Notation Other registers used: I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0. - Input - r0 - pointer to start of DCTELEM *block + Input - r0 - pointer to start of int16_t *block - Output - The DCT output coefficients in the DCTELEM *block + Output - The DCT output coefficients in the int16_t *block Register constraint: This code is called from jpeg_encode. @@ -147,7 +147,7 @@ vtmp: .space 128 .text DEFUN(fdct,mL1, - (DCTELEM *block)): + (int16_t *block)): [--SP] = (R7:4, P5:3); // Push the registers onto the stack. b0 = r0; diff --git a/libavcodec/bfin/idct_bfin.S b/libavcodec/bfin/idct_bfin.S index 66430096f0..bd80447bde 100644 --- a/libavcodec/bfin/idct_bfin.S +++ b/libavcodec/bfin/idct_bfin.S @@ -22,7 +22,7 @@ /* This blackfin DSP code implements an 8x8 inverse type II DCT. -Prototype : void ff_bfin_idct(DCTELEM *in) +Prototype : void ff_bfin_idct(int16_t *in) Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. @@ -90,7 +90,7 @@ vtmp: .space 256 .text DEFUN(idct,mL1, - (DCTELEM *block)): + (int16_t *block)): /********************** Function Prologue *********************************/ link 16; diff --git a/libavcodec/bfin/mpegvideo_bfin.c b/libavcodec/bfin/mpegvideo_bfin.c index f7f3d729de..41c47f4d27 100644 --- a/libavcodec/bfin/mpegvideo_bfin.c +++ b/libavcodec/bfin/mpegvideo_bfin.c @@ -26,7 +26,7 @@ #include "dsputil_bfin.h" static int dct_quantize_bfin (MpegEncContext *s, - DCTELEM *block, int n, + int16_t *block, int n, int qscale, int *overflow) { int last_non_zero, q, start_i; diff --git a/libavcodec/bfin/pixels_bfin.S b/libavcodec/bfin/pixels_bfin.S index 995d7b8cc8..2e3cd0f9bc 100644 --- a/libavcodec/bfin/pixels_bfin.S +++ b/libavcodec/bfin/pixels_bfin.S @@ -21,7 +21,7 @@ #include "config_bfin.h" DEFUN(put_pixels_clamped,mL1, - (DCTELEM *block, uint8_t *dest, int line_size)): + (int16_t *block, uint8_t *dest, int line_size)): [--SP] = (R7:4); R4 = 0; R5.l = 0x00ff; @@ -51,7 +51,7 @@ ppc$1: R2 = Max(R0, R4) (V) || [I1++M1] = R6; DEFUN_END(put_pixels_clamped) DEFUN(add_pixels_clamped,mL1, - (DCTELEM *block, uint8_t *dest, int line_size)): + (int16_t *block, uint8_t *dest, int line_size)): [-- SP] = (R7:4); R4 = 0; I0 = 0; @@ -442,7 +442,7 @@ LE$8OT: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5; rts; DEFUN(diff_pixels,mL1, - (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)): + (int16_t *block, uint8_t *s1, uint8_t *s2, int stride)): link 0; [--sp] = (r7:4); p0=8; @@ -518,7 +518,7 @@ DEFUN_END(pix_sum) DEFUN(get_pixels,mL1, - (DCTELEM *av_restrict block, const uint8_t *pixels, int line_size)): + (int16_t *av_restrict block, const uint8_t *pixels, int line_size)): [--sp] = (r7:4); i3=r0; // dest i0=r1; // src0 diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c index 6d6ac82636..06d3443a2f 100644 --- a/libavcodec/bfin/vp3_bfin.c +++ b/libavcodec/bfin/vp3_bfin.c @@ -23,7 +23,7 @@ #include "dsputil_bfin.h" /* Intra iDCT offset 128 */ -void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block) +void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block) { uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128; int i,j; @@ -36,7 +36,7 @@ void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block) } /* Inter iDCT */ -void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block) +void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block) { ff_bfin_vp3_idct (block); ff_bfin_add_pixels_clamped (block, dest, line_size); diff --git a/libavcodec/bfin/vp3_idct_bfin.S b/libavcodec/bfin/vp3_idct_bfin.S index 83747f9fcd..4e200459f4 100644 --- a/libavcodec/bfin/vp3_idct_bfin.S +++ b/libavcodec/bfin/vp3_idct_bfin.S @@ -22,7 +22,7 @@ /* This blackfin DSP code implements an 8x8 inverse type II DCT. -Prototype : void ff_bfin_vp3_idct(DCTELEM *in) +Prototype : void ff_bfin_vp3_idct(int16_t *in) Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. @@ -63,7 +63,7 @@ vtmp: .space 256 .text DEFUN(vp3_idct,mL1, - (DCTELEM *block)): + (int16_t *block)): /********************** Function Prologue *********************************/ link 16; diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 892e92184b..35fe962e8d 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -700,7 +700,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t * * @param masks_count number of masks to decode * @return 0 on success, negative value in other cases */ -static int read_residue(GetBitContext *gb, DCTELEM block[64], int masks_count) +static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count) { int coef_list[128]; int mode_list[128]; @@ -804,7 +804,7 @@ static int binkb_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, int v, col[2]; const uint8_t *scan; int xoff, yoff; - LOCAL_ALIGNED_16(DCTELEM, block, [64]); + LOCAL_ALIGNED_16(int16_t, block, [64]); LOCAL_ALIGNED_16(int32_t, dctblock, [64]); int coordmap[64]; int ybias = is_key ? -15 : 0; @@ -950,7 +950,7 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, int v, col[2]; const uint8_t *scan; int xoff, yoff; - LOCAL_ALIGNED_16(DCTELEM, block, [64]); + LOCAL_ALIGNED_16(int16_t, block, [64]); LOCAL_ALIGNED_16(uint8_t, ublock, [64]); LOCAL_ALIGNED_16(int32_t, dctblock, [64]); int coordmap[64]; diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index e1ac0befa3..bcdeb7c228 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -715,7 +715,7 @@ void ff_cavs_init_top_lines(AVSContext *h) { /* alloc space for co-located MVs and types */ h->col_mv = av_mallocz( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); h->col_type_base = av_mallocz(h->mb_width*h->mb_height); - h->block = av_mallocz(64*sizeof(DCTELEM)); + h->block = av_mallocz(64*sizeof(int16_t)); } av_cold int ff_cavs_init(AVCodecContext *avctx) { diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h index 649a567b41..73e6bfe8c6 100644 --- a/libavcodec/cavs.h +++ b/libavcodec/cavs.h @@ -234,7 +234,7 @@ typedef struct AVSContext { uint8_t *edge_emu_buffer; int got_keyframe; - DCTELEM *block; + int16_t *block; } AVSContext; extern const uint8_t ff_cavs_partition_flags[30]; diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 0074c4cf6d..9450ed137f 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -517,8 +517,8 @@ static inline int get_ue_code(GetBitContext *gb, int order) return get_ue_golomb(gb); } -static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, - DCTELEM *dst, int mul, int shift, int coeff_num) +static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf, + int16_t *dst, int mul, int shift, int coeff_num) { int round = 1 << (shift - 1); int pos = -1; @@ -553,9 +553,9 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, { int i, esc_code, level, mask; unsigned int level_code, run; - DCTELEM level_buf[65]; + int16_t level_buf[65]; uint8_t run_buf[65]; - DCTELEM *block = h->block; + int16_t *block = h->block; for (i = 0; i < 65; i++) { level_code = get_ue_code(gb, r->golomb_order); diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c index a9b136e2a3..f66cabca28 100644 --- a/libavcodec/cavsdsp.c +++ b/libavcodec/cavsdsp.c @@ -183,9 +183,9 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc * ****************************************************************************/ -static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) { +static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) { int i; - DCTELEM (*src)[8] = (DCTELEM(*)[8])block; + int16_t (*src)[8] = (int16_t(*)[8])block; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; src[0][0] += 8; diff --git a/libavcodec/cavsdsp.h b/libavcodec/cavsdsp.h index f6e3e18e83..4598c7d745 100644 --- a/libavcodec/cavsdsp.h +++ b/libavcodec/cavsdsp.h @@ -32,7 +32,7 @@ typedef struct CAVSDSPContext { void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); - void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); + void (*cavs_idct8_add)(uint8_t *dst, int16_t *block, int stride); int idct_perm; } CAVSDSPContext; diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 2c43b36aa4..e44ab125c2 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -39,6 +39,7 @@ #include "libavutil/lfg.h" #include "libavutil/time.h" +#include "dsputil.h" #include "simple_idct.h" #include "aandcttab.h" #include "faandct.h" @@ -48,28 +49,28 @@ #undef printf -void ff_mmx_idct(DCTELEM *data); -void ff_mmxext_idct(DCTELEM *data); +void ff_mmx_idct(int16_t *data); +void ff_mmxext_idct(int16_t *data); // BFIN -void ff_bfin_idct(DCTELEM *block); -void ff_bfin_fdct(DCTELEM *block); +void ff_bfin_idct(int16_t *block); +void ff_bfin_fdct(int16_t *block); // ALTIVEC -void ff_fdct_altivec(DCTELEM *block); +void ff_fdct_altivec(int16_t *block); // ARM -void ff_j_rev_dct_arm(DCTELEM *data); -void ff_simple_idct_arm(DCTELEM *data); -void ff_simple_idct_armv5te(DCTELEM *data); -void ff_simple_idct_armv6(DCTELEM *data); -void ff_simple_idct_neon(DCTELEM *data); +void ff_j_rev_dct_arm(int16_t *data); +void ff_simple_idct_arm(int16_t *data); +void ff_simple_idct_armv5te(int16_t *data); +void ff_simple_idct_armv6(int16_t *data); +void ff_simple_idct_neon(int16_t *data); -void ff_simple_idct_axp(DCTELEM *data); +void ff_simple_idct_axp(int16_t *data); struct algo { const char *name; - void (*func)(DCTELEM *block); + void (*func)(int16_t *block); enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM, SSE2_PERM, PARTTRANS_PERM, TRANSPOSE_PERM } format; int mm_support; @@ -103,9 +104,9 @@ static const struct algo fdct_tab[] = { #if ARCH_X86_64 && HAVE_MMX && HAVE_YASM void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, - DCTELEM *block, int16_t *qmat); + int16_t *block, int16_t *qmat); -static void ff_prores_idct_put_10_sse2_wrap(DCTELEM *dst){ +static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){ DECLARE_ALIGNED(16, static int16_t, qmat)[64]; DECLARE_ALIGNED(16, static int16_t, tmp)[64]; int i; @@ -193,10 +194,10 @@ static void idct_mmx_init(void) } } -DECLARE_ALIGNED(16, static DCTELEM, block)[64]; -DECLARE_ALIGNED(8, static DCTELEM, block1)[64]; +DECLARE_ALIGNED(16, static int16_t, block)[64]; +DECLARE_ALIGNED(8, static int16_t, block1)[64]; -static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, int vals) +static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng, int vals) { int i, j; @@ -226,7 +227,7 @@ static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, in } } -static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm) +static void permute(int16_t dst[64], const int16_t src[64], int perm) { int i; @@ -253,7 +254,7 @@ static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm) static int dct_error(const struct algo *dct, int test, int is_idct, int speed, const int bits) { - void (*ref)(DCTELEM *block) = is_idct ? ff_ref_idct : ff_ref_fdct; + void (*ref)(int16_t *block) = is_idct ? ff_ref_idct : ff_ref_fdct; int it, i, scale; int err_inf, v; int64_t err2, ti, ti1, it1, err_sum = 0; diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index 0fe03f9978..6e94d32ecc 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -45,11 +45,11 @@ typedef struct DNXHDContext { VLC ac_vlc, dc_vlc, run_vlc; int last_dc[3]; DSPContext dsp; - DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; + DECLARE_ALIGNED(16, int16_t, blocks)[8][64]; ScanTable scantable; const CIDEntry *cid_table; int bit_depth; // 8, 10 or 0 if not initialized at all. - void (*decode_dct_block)(struct DNXHDContext *ctx, DCTELEM *block, + void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block, int n, int qscale); int last_qscale; int luma_scale[64]; @@ -59,8 +59,8 @@ typedef struct DNXHDContext { #define DNXHD_VLC_BITS 9 #define DNXHD_DC_VLC_BITS 7 -static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, int n, int qscale); -static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, int n, int qscale); +static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale); +static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale); static av_cold int dnxhd_decode_init(AVCodecContext *avctx) { @@ -190,7 +190,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si } static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, - DCTELEM *block, int n, + int16_t *block, int n, int qscale, int index_bits, int level_bias, @@ -272,13 +272,13 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, CLOSE_READER(bs, &ctx->gb); } -static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, +static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale) { dnxhd_decode_dct_block(ctx, block, n, qscale, 4, 32, 6); } -static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, +static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale) { dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4); diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 690e64f869..5fbf46b281 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -51,7 +51,7 @@ static const AVClass class = { #define LAMBDA_FRAC_BITS 10 -static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size) +static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size) { int i; for (i = 0; i < 4; i++) { @@ -68,7 +68,7 @@ static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint memcpy(block + 24, block - 32, sizeof(*block) * 8); } -static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size) +static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size) { int i; const uint16_t* pixels16 = (const uint16_t*)pixels; @@ -88,7 +88,7 @@ static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *av_restrict memcpy(block + 24, block - 32, sizeof(*block) * 8); } -static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block, +static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block, int n, int qscale, int *overflow) { const uint8_t *scantable= ctx->intra_scantable.scantable; @@ -392,7 +392,7 @@ static av_always_inline void dnxhd_encode_dc(DNXHDEncContext *ctx, int diff) (ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1))); } -static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *block, int last_index, int n) +static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block, int last_index, int n) { int last_non_zero = 0; int slevel, i, j; @@ -415,7 +415,7 @@ static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *b put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB } -static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index) +static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n, int qscale, int last_index) { const uint8_t *weight_matrix; int level; @@ -456,7 +456,7 @@ static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *b } } -static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block) +static av_always_inline int dnxhd_ssd_block(int16_t *qblock, int16_t *block) { int score = 0; int i; @@ -465,7 +465,7 @@ static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block) return score; } -static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *block, int last_index) +static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index) { int last_non_zero = 0; int bits = 0; @@ -527,7 +527,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i DNXHDEncContext *ctx = avctx->priv_data; int mb_y = jobnr, mb_x; int qscale = ctx->qscale; - LOCAL_ALIGNED_16(DCTELEM, block, [64]); + LOCAL_ALIGNED_16(int16_t, block, [64]); ctx = ctx->thread[threadnr]; ctx->m.last_dc[0] = @@ -544,7 +544,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i dnxhd_get_blocks(ctx, mb_x, mb_y); for (i = 0; i < 8; i++) { - DCTELEM *src_block = ctx->blocks[i]; + int16_t *src_block = ctx->blocks[i]; int overflow, nbits, diff, last_index; int n = dnxhd_switch_matrix(ctx, i); @@ -593,7 +593,7 @@ static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int dnxhd_get_blocks(ctx, mb_x, mb_y); for (i = 0; i < 8; i++) { - DCTELEM *block = ctx->blocks[i]; + int16_t *block = ctx->blocks[i]; int overflow, n = dnxhd_switch_matrix(ctx, i); int last_index = ctx->m.dct_quantize(&ctx->m, block, 4&(2*i), qscale, &overflow); //START_TIMER; diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h index 36a42fb100..9b59b96d3e 100644 --- a/libavcodec/dnxhdenc.h +++ b/libavcodec/dnxhdenc.h @@ -64,7 +64,7 @@ typedef struct DNXHDEncContext { int nitris_compat; unsigned min_padding; - DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; + DECLARE_ALIGNED(16, int16_t, blocks)[8][64]; int (*qmatrix_c) [64]; int (*qmatrix_l) [64]; @@ -90,7 +90,7 @@ typedef struct DNXHDEncContext { RCCMPEntry *mb_cmp; RCEntry (*mb_rc)[8160]; - void (*get_pixels_8x4_sym)(DCTELEM * /*align 16*/, const uint8_t *, int); + void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int); } DNXHDEncContext; void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx); diff --git a/libavcodec/dsputil.c b/libavcodec/dsputil.c index 98d4596d82..80a85a951c 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -351,7 +351,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) return s; } -static void diff_pixels_c(DCTELEM *av_restrict block, const uint8_t *s1, +static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1, const uint8_t *s2, int stride){ int i; @@ -371,8 +371,7 @@ static void diff_pixels_c(DCTELEM *av_restrict block, const uint8_t *s1, } } - -static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -393,7 +392,7 @@ static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixe } } -static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void put_pixels_clamped4_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -410,7 +409,7 @@ static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pix } } -static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void put_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -425,7 +424,7 @@ static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pix } } -static void put_signed_pixels_clamped_c(const DCTELEM *block, +static void put_signed_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { @@ -446,7 +445,7 @@ static void put_signed_pixels_clamped_c(const DCTELEM *block, } } -static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -466,7 +465,7 @@ static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixe } } -static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void add_pixels_clamped4_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -482,7 +481,7 @@ static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pix } } -static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pixels, +static void add_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pixels, int line_size) { int i; @@ -496,7 +495,7 @@ static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pix } } -static int sum_abs_dctelem_c(DCTELEM *block) +static int sum_abs_dctelem_c(int16_t *block) { int sum=0, i; for(i=0; i<64; i++) @@ -1834,10 +1833,10 @@ static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){ * @param scantable the used scantable, this is only used to speed the permutation up, the block is not * (inverse) permutated to scantable order! */ -void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last) +void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last) { int i; - DCTELEM temp[64]; + int16_t temp[64]; if(last<=0) return; //if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations @@ -2160,7 +2159,7 @@ static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - LOCAL_ALIGNED_16(DCTELEM, temp, [64]); + LOCAL_ALIGNED_16(int16_t, temp, [64]); av_assert2(h==8); @@ -2199,7 +2198,7 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - DCTELEM dct[8][8]; + int16_t dct[8][8]; int i; int sum=0; @@ -2224,7 +2223,7 @@ static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - LOCAL_ALIGNED_16(DCTELEM, temp, [64]); + LOCAL_ALIGNED_16(int16_t, temp, [64]); int sum=0, i; av_assert2(h==8); @@ -2240,8 +2239,8 @@ static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; - LOCAL_ALIGNED_16(DCTELEM, temp, [64*2]); - DCTELEM * const bak = temp+64; + LOCAL_ALIGNED_16(int16_t, temp, [64*2]); + int16_t * const bak = temp+64; int sum=0, i; av_assert2(h==8); @@ -2249,7 +2248,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s s->dsp.diff_pixels(temp, src1, src2, stride); - memcpy(bak, temp, 64*sizeof(DCTELEM)); + memcpy(bak, temp, 64*sizeof(int16_t)); s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i); s->dct_unquantize_inter(s, temp, 0, s->qscale); @@ -2264,7 +2263,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; const uint8_t *scantable= s->intra_scantable.permutated; - LOCAL_ALIGNED_16(DCTELEM, temp, [64]); + LOCAL_ALIGNED_16(int16_t, temp, [64]); LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]); LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]); int i, last, run, bits, level, distortion, start_i; @@ -2340,7 +2339,7 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ MpegEncContext * const s= (MpegEncContext *)c; const uint8_t *scantable= s->intra_scantable.permutated; - LOCAL_ALIGNED_16(DCTELEM, temp, [64]); + LOCAL_ALIGNED_16(int16_t, temp, [64]); int i, last, run, bits, level, start_i; const int esc_length= s->ac_esc_length; uint8_t * length; @@ -2577,44 +2576,44 @@ static void vector_clip_int32_c(int32_t *dst, const int32_t *src, int32_t min, } while (len > 0); } -static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_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, DCTELEM *block) +static void ff_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); } -static void ff_jref_idct4_put(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct4_put(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct4 (block); put_pixels_clamped4_c(block, dest, line_size); } -static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct4_add(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct4 (block); add_pixels_clamped4_c(block, dest, line_size); } -static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct2_put(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct2 (block); put_pixels_clamped2_c(block, dest, line_size); } -static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct2_add(uint8_t *dest, int line_size, int16_t *block) { ff_j_rev_dct2 (block); add_pixels_clamped2_c(block, dest, line_size); } -static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct1_put(uint8_t *dest, int line_size, int16_t *block) { dest[0] = av_clip_uint8((block[0] + 4)>>3); } -static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block) +static void ff_jref_idct1_add(uint8_t *dest, int line_size, int16_t *block) { dest[0] = av_clip_uint8(dest[0] + ((block[0] + 4)>>3)); } diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 0b27ebd54b..606555a8d4 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -36,37 +36,36 @@ //#define DEBUG /* dct code */ -typedef short DCTELEM; -void ff_fdct_ifast (DCTELEM *data); -void ff_fdct_ifast248 (DCTELEM *data); -void ff_jpeg_fdct_islow_8(DCTELEM *data); -void ff_jpeg_fdct_islow_10(DCTELEM *data); -void ff_fdct248_islow_8(DCTELEM *data); -void ff_fdct248_islow_10(DCTELEM *data); +void ff_fdct_ifast(int16_t *data); +void ff_fdct_ifast248(int16_t *data); +void ff_jpeg_fdct_islow_8(int16_t *data); +void ff_jpeg_fdct_islow_10(int16_t *data); +void ff_fdct248_islow_8(int16_t *data); +void ff_fdct248_islow_10(int16_t *data); -void ff_j_rev_dct (DCTELEM *data); -void ff_j_rev_dct4 (DCTELEM *data); -void ff_j_rev_dct2 (DCTELEM *data); -void ff_j_rev_dct1 (DCTELEM *data); +void ff_j_rev_dct(int16_t *data); +void ff_j_rev_dct4(int16_t *data); +void ff_j_rev_dct2(int16_t *data); +void ff_j_rev_dct1(int16_t *data); -void ff_fdct_mmx(DCTELEM *block); -void ff_fdct_mmxext(DCTELEM *block); -void ff_fdct_sse2(DCTELEM *block); +void ff_fdct_mmx(int16_t *block); +void ff_fdct_mmxext(int16_t *block); +void ff_fdct_sse2(int16_t *block); #define H264_IDCT(depth) \ -void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ -void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ -void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ -void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ -void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ -void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ -void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ -void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ -void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ -void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(DCTELEM *output, DCTELEM *input, int qmul);\ -void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);\ -void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul); +void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ +void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ +void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ +void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ +void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ +void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ +void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\ +void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\ +void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul); H264_IDCT( 8) H264_IDCT( 9) @@ -74,8 +73,8 @@ H264_IDCT(10) H264_IDCT(12) H264_IDCT(14) -void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp); -void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc); +void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp); +void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc); /* encoding scans */ extern const uint8_t ff_alternate_horizontal_scan[64]; @@ -135,11 +134,11 @@ could be reached easily ... */ /* -void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size); -void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride); -void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size); -void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size); -void clear_blocks_c(DCTELEM *blocks); +void get_pixels_c(int16_t *block, const uint8_t *pixels, int line_size); +void diff_pixels_c(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); +void put_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size); +void add_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size); +void clear_blocks_c(int16_t *blocks); */ /* add and put pixel (decoding) */ @@ -212,14 +211,14 @@ typedef struct DSPContext { int dct_bits; /* pixel ops : interface with DCT */ - void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size); - void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride); - void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); - void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); - void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); - void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size); - void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size); - int (*sum_abs_dctelem)(DCTELEM *block/*align 16*/); + 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); + void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); + void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); + void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); + void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size); + void (*add_pixels4)(uint8_t *pixels, int16_t *block, int line_size); + int (*sum_abs_dctelem)(int16_t *block/*align 16*/); /** * translational global motion compensation. */ @@ -229,8 +228,8 @@ typedef struct DSPContext { */ void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); - void (*clear_block)(DCTELEM *block/*align 16*/); - void (*clear_blocks)(DCTELEM *blocks/*align 16*/); + void (*clear_block)(int16_t *block/*align 16*/); + void (*clear_blocks)(int16_t *blocks/*align 16*/); int (*pix_sum)(uint8_t * pix, int line_size); int (*pix_norm1)(uint8_t * pix, int line_size); // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4 @@ -362,24 +361,24 @@ typedef struct DSPContext { void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */); /* (I)DCT */ - void (*fdct)(DCTELEM *block/* align 16*/); - void (*fdct248)(DCTELEM *block/* align 16*/); + void (*fdct)(int16_t *block/* align 16*/); + void (*fdct248)(int16_t *block/* align 16*/); /* IDCT really*/ - void (*idct)(DCTELEM *block/* align 16*/); + void (*idct)(int16_t *block/* align 16*/); /** * block -> idct -> clip to unsigned 8 bit -> dest. * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...) * @param line_size size in bytes of a horizontal line of dest */ - void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); + void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); /** * block -> idct -> add dest -> clip to unsigned 8 bit -> dest. * @param line_size size in bytes of a horizontal line of dest */ - void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); + void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); /** * idct input permutation. @@ -470,7 +469,7 @@ int ff_check_alignment(void); * permute block according to permuatation. * @param last last non zero element in scantable order */ -void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last); +void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last); void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type); diff --git a/libavcodec/dsputil_template.c b/libavcodec/dsputil_template.c index 5162304d05..3c98086a64 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -114,7 +114,7 @@ static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height, } #define DCTELEM_FUNCS(dctcoef, suffix) \ -static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block, \ +static void FUNCC(get_pixels ## suffix)(int16_t *av_restrict _block, \ const uint8_t *_pixels, \ int line_size) \ { \ @@ -138,7 +138,7 @@ static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block, \ } \ \ static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \ - DCTELEM *_block, \ + int16_t *_block, \ int line_size) \ { \ int i; \ @@ -161,7 +161,7 @@ static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \ } \ \ static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \ - DCTELEM *_block, \ + int16_t *_block, \ int line_size) \ { \ int i; \ @@ -179,20 +179,20 @@ static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \ } \ } \ \ -static void FUNCC(clear_block ## suffix)(DCTELEM *block) \ +static void FUNCC(clear_block ## suffix)(int16_t *block) \ { \ memset(block, 0, sizeof(dctcoef)*64); \ } \ \ /** \ - * memset(blocks, 0, sizeof(DCTELEM)*6*64) \ + * memset(blocks, 0, sizeof(int16_t)*6*64) \ */ \ -static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks) \ +static void FUNCC(clear_blocks ## suffix)(int16_t *blocks) \ { \ memset(blocks, 0, sizeof(dctcoef)*6*64); \ } -DCTELEM_FUNCS(DCTELEM, _16) +DCTELEM_FUNCS(int16_t, _16) #if BIT_DEPTH > 8 DCTELEM_FUNCS(dctcoef, _32) #endif diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 18c90c2b6c..e2a00a6c14 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -417,7 +417,7 @@ typedef struct EncBlockInfo { int cur_ac; int cno; int dct_mode; - DCTELEM mb[64]; + int16_t mb[64]; uint8_t next[64]; uint8_t sign[64]; uint8_t partial_bit_count; @@ -506,7 +506,7 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i { const int *weight; const uint8_t* zigzag_scan; - LOCAL_ALIGNED_16(DCTELEM, blk, [64]); + LOCAL_ALIGNED_16(int16_t, blk, [64]); int i, area; /* We offer two different methods for class number assignment: the method suggested in SMPTE 314M Table 22, and an improved diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index b1fa44ae39..97c20e3a1a 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -40,9 +40,9 @@ typedef struct DVVideoContext { uint8_t dv_zigzag[2][64]; - void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size); - void (*fdct[2])(DCTELEM *block); - void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block); + void (*get_pixels)(int16_t *block, const uint8_t *pixels, int line_size); + void (*fdct[2])(int16_t *block); + void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block); me_cmp_func ildct_cmp; } DVVideoContext; diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index fd00cc18d6..bb60fc0b13 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -49,7 +49,7 @@ typedef struct BlockInfo { const uint32_t *factor_table; const uint8_t *scan_table; uint8_t pos; /* position in block */ - void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); + void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); uint8_t partial_bit_count; uint32_t partial_bit_buffer; int shift_offset; @@ -58,7 +58,7 @@ typedef struct BlockInfo { static const int dv_iweight_bits = 14; /* decode AC coefficients */ -static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block) +static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block) { int last_index = gb->size_in_bits; const uint8_t *scan_table = mb->scan_table; @@ -136,14 +136,14 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) int quant, dc, dct_mode, class1, j; int mb_index, mb_x, mb_y, last_index; int y_stride, linesize; - DCTELEM *block, *block1; + int16_t *block, *block1; int c_offset; uint8_t *y_ptr; const uint8_t *buf_ptr; PutBitContext pb, vs_pb; GetBitContext gb; BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; - LOCAL_ALIGNED_16(DCTELEM, sblock, [5*DV_MAX_BPM], [64]); + LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]); LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ const int log2_blocksize = 3-s->avctx->lowres; diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c index 175c1c47c0..6ba1faf614 100644 --- a/libavcodec/eaidct.c +++ b/libavcodec/eaidct.c @@ -64,7 +64,7 @@ #define MUNGE_8BIT(x) av_clip_uint8((x)>>4) #define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_8BIT,src) -static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) { +static inline void ea_idct_col(int16_t *dest, const int16_t *src) { if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) { dest[0] = dest[8] = @@ -78,9 +78,9 @@ static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) { IDCT_COL(dest, src); } -void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) { +void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) { int i; - DCTELEM temp[64]; + int16_t temp[64]; block[0] += 4; for (i=0; i<8; i++) ea_idct_col(&temp[i], &block[i]); diff --git a/libavcodec/eaidct.h b/libavcodec/eaidct.h index a436673e88..6b9ec1c91c 100644 --- a/libavcodec/eaidct.h +++ b/libavcodec/eaidct.h @@ -20,8 +20,7 @@ #define AVCODEC_EAIDCT_H #include <stdint.h> -#include "dsputil.h" -void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); +void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block); #endif /* AVCODEC_EAIDCT_H */ diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 2f9559fe8e..75285dccec 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -51,7 +51,7 @@ typedef struct MadContext { GetBitContext gb; void *bitstream_buf; unsigned int bitstream_buf_size; - DECLARE_ALIGNED(16, DCTELEM, block)[64]; + DECLARE_ALIGNED(16, int16_t, block)[64]; ScanTable scantable; uint16_t quant_matrix[64]; int mb_x; @@ -102,7 +102,7 @@ static inline void comp_block(MadContext *t, int mb_x, int mb_y, } } -static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, int j) +static inline void idct_put(MadContext *t, int16_t *block, int mb_x, int mb_y, int j) { if (j < 4) { ff_ea_idct_put_c( @@ -116,7 +116,7 @@ static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, i } } -static inline int decode_block_intra(MadContext *s, DCTELEM * block) +static inline int decode_block_intra(MadContext *s, int16_t * block) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index c38b3cdf9c..fba6e831cf 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -43,7 +43,7 @@ typedef struct TgqContext { int width,height; ScanTable scantable; int qtable[64]; - DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; + DECLARE_ALIGNED(16, int16_t, block)[6][64]; GetByteContext gb; } TgqContext; @@ -58,7 +58,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){ return 0; } -static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb){ +static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb){ uint8_t *perm = s->scantable.permutated; int i,j,value; block[0] = get_sbits(gb,8) * s->qtable[0]; @@ -103,7 +103,7 @@ static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb block[0] += 128<<4; } -static void tgq_idct_put_mb(TgqContext *s, DCTELEM (*block)[64], int mb_x, int mb_y){ +static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], int mb_x, int mb_y){ int linesize= s->frame.linesize[0]; uint8_t *dest_y = s->frame.data[0] + (mb_y * 16* linesize ) + mb_x * 16; uint8_t *dest_cb = s->frame.data[1] + (mb_y * 8 * s->frame.linesize[1]) + mb_x * 8; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 306331f359..6f535efa7a 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -40,7 +40,7 @@ typedef struct TqiContext { AVFrame frame; void *bitstream_buf; unsigned int bitstream_buf_size; - DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; + DECLARE_ALIGNED(16, int16_t, block)[6][64]; } TqiContext; static av_cold int tqi_decode_init(AVCodecContext *avctx) @@ -58,7 +58,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx) return 0; } -static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64]) +static int tqi_decode_mb(MpegEncContext *s, int16_t (*block)[64]) { int n; s->dsp.clear_blocks(block[0]); @@ -69,7 +69,7 @@ static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64]) return 0; } -static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64]) +static inline void tqi_idct_put(TqiContext *t, int16_t (*block)[64]) { MpegEncContext *s = &t->s; int linesize= t->frame.linesize[0]; diff --git a/libavcodec/faandct.c b/libavcodec/faandct.c index 1379394aa9..0219e20eab 100644 --- a/libavcodec/faandct.c +++ b/libavcodec/faandct.c @@ -64,7 +64,7 @@ B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7, B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7, }; -static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) +static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data) { FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp10, tmp11, tmp12, tmp13; @@ -119,7 +119,7 @@ static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) } } -void ff_faandct(DCTELEM * data) +void ff_faandct(int16_t *data) { FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp10, tmp11, tmp12, tmp13; @@ -179,7 +179,7 @@ void ff_faandct(DCTELEM * data) } } -void ff_faandct248(DCTELEM * data) +void ff_faandct248(int16_t *data) { FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp10, tmp11, tmp12, tmp13; diff --git a/libavcodec/faandct.h b/libavcodec/faandct.h index a12dcaf92f..c5ef96dcf1 100644 --- a/libavcodec/faandct.h +++ b/libavcodec/faandct.h @@ -29,9 +29,9 @@ #ifndef AVCODEC_FAANDCT_H #define AVCODEC_FAANDCT_H -#include "dsputil.h" +#include <stdint.h> -void ff_faandct(DCTELEM * data); -void ff_faandct248(DCTELEM * data); +void ff_faandct(int16_t *data); +void ff_faandct248(int16_t *data); #endif /* AVCODEC_FAANDCT_H */ diff --git a/libavcodec/faanidct.c b/libavcodec/faanidct.c index 1e9bfaf48a..5f34fa508f 100644 --- a/libavcodec/faanidct.c +++ b/libavcodec/faanidct.c @@ -47,7 +47,7 @@ B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8, B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, }; -static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ +static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ int i; FLOAT av_unused tmp0; FLOAT s04, d04, s17, d17, s26, d26, s53, d53; @@ -129,7 +129,7 @@ static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int s } } -void ff_faanidct(DCTELEM block[64]){ +void ff_faanidct(int16_t block[64]){ FLOAT temp[64]; int i; @@ -142,7 +142,7 @@ void ff_faanidct(DCTELEM block[64]){ p8idct(block, temp, NULL, 0, 8, 1, 1); } -void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){ +void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){ FLOAT temp[64]; int i; @@ -155,7 +155,7 @@ void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){ p8idct(NULL , temp, dest, line_size, 8, 1, 2); } -void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]){ +void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){ FLOAT temp[64]; int i; diff --git a/libavcodec/faanidct.h b/libavcodec/faanidct.h index 4cf1189286..4cd2c7858f 100644 --- a/libavcodec/faanidct.h +++ b/libavcodec/faanidct.h @@ -23,10 +23,9 @@ #define AVCODEC_FAANIDCT_H #include <stdint.h> -#include "dsputil.h" -void ff_faanidct(DCTELEM block[64]); -void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]); -void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]); +void ff_faanidct(int16_t block[64]); +void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]); +void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]); #endif /* AVCODEC_FAANIDCT_H */ diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 7cca7bb82e..22fa031a51 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -48,7 +48,7 @@ static VLC h261_mtype_vlc; static VLC h261_mv_vlc; static VLC h261_cbp_vlc; -static int h261_decode_block(H261Context * h, DCTELEM * block, int n, int coded); +static int h261_decode_block(H261Context * h, int16_t * block, int n, int coded); static av_cold void h261_decode_init_vlc(H261Context *h){ static int done = 0; @@ -366,7 +366,7 @@ intra: * Decode a macroblock. * @return <0 if an error occurred */ -static int h261_decode_block(H261Context * h, DCTELEM * block, +static int h261_decode_block(H261Context * h, int16_t * block, int n, int coded) { MpegEncContext * const s = &h->s; diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 29bee5d46e..edf01f99b5 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -35,7 +35,7 @@ extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; -static void h261_encode_block(H261Context * h, DCTELEM * block, +static void h261_encode_block(H261Context * h, int16_t * block, int n); int ff_h261_get_picture_format(int width, int height){ @@ -144,7 +144,7 @@ static void h261_encode_motion(H261Context * h, int val){ } static inline int get_cbp(MpegEncContext * s, - DCTELEM block[6][64]) + int16_t block[6][64]) { int i, cbp; cbp= 0; @@ -155,7 +155,7 @@ static inline int get_cbp(MpegEncContext * s, return cbp; } void ff_h261_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { H261Context * h = (H261Context *)s; @@ -256,7 +256,7 @@ void ff_h261_encode_init(MpegEncContext *s){ * @param block the 8x8 block * @param n block index (0-3 are luma, 4-5 are chroma) */ -static void h261_encode_block(H261Context * h, DCTELEM * block, int n){ +static void h261_encode_block(H261Context * h, int16_t * block, int n){ MpegEncContext * const s = &h->s; int level, run, i, j, last_index, last_non_zero, sign, slevel, code; RLTable *rl; diff --git a/libavcodec/h263.c b/libavcodec/h263.c index 5b77106d7d..2390e0d945 100644 --- a/libavcodec/h263.c +++ b/libavcodec/h263.c @@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ } } -void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n) +void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n) { int x, y, wrap, a, c, pred_dc, scale, i; int16_t *dc_val, *ac_val, *ac_val1; diff --git a/libavcodec/h263.h b/libavcodec/h263.h index 34d79a088d..3cb06f387a 100644 --- a/libavcodec/h263.h +++ b/libavcodec/h263.h @@ -73,7 +73,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVPacket *avpkt); int ff_h263_decode_end(AVCodecContext *avctx); void ff_h263_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number); void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); @@ -89,7 +89,7 @@ int ff_h263_decode_mba(MpegEncContext *s); void ff_h263_encode_mba(MpegEncContext *s); void ff_init_qscale_tab(MpegEncContext *s); int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); -void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n); +void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n); /** @@ -99,7 +99,7 @@ void ff_h263_show_pict_info(MpegEncContext *s); int ff_intel_h263_decode_picture_header(MpegEncContext *s); int ff_h263_decode_mb(MpegEncContext *s, - DCTELEM block[6][64]); + int16_t block[6][64]); /** * Return the value of the 3bit "source format" syntax element. @@ -144,7 +144,7 @@ static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y } static inline int get_p_cbp(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y){ int cbp, i; diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 34d16baec8..89d2a6b540 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1769,7 +1769,7 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y, } } -static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth, +static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth, int index) { if (high_bit_depth) { @@ -1778,7 +1778,7 @@ static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth, return AV_RN16A(mb + index); } -static av_always_inline void dctcoef_set(DCTELEM *mb, int high_bit_depth, +static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth, int index, int value) { if (high_bit_depth) { @@ -1797,8 +1797,8 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, uint8_t *dest_y, int p) { MpegEncContext *const s = &h->s; - void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); - void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride); + void (*idct_add)(uint8_t *dst, int16_t *block, int stride); + void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride); int i; int qscale = p == 0 ? s->qscale : h->chroma_qp[p - 1]; block_offset += 16 * p; @@ -1914,7 +1914,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type, uint8_t *dest_y, int p) { MpegEncContext *const s = &h->s; - void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); + void (*idct_add)(uint8_t *dst, int16_t *block, int stride); int i; block_offset += 16 * p; if (!IS_INTRA4x4(mb_type)) { diff --git a/libavcodec/h264.h b/libavcodec/h264.h index e7ad07db8e..6989178af2 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -29,7 +29,6 @@ #define AVCODEC_H264_H #include "libavutil/intreadwrite.h" -#include "dsputil.h" #include "cabac.h" #include "mpegvideo.h" #include "h264dsp.h" @@ -390,9 +389,9 @@ typedef struct H264Context { GetBitContext *intra_gb_ptr; GetBitContext *inter_gb_ptr; - DECLARE_ALIGNED(16, DCTELEM, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space. - DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[3][16 * 2]; - DCTELEM mb_padding[256 * 2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb + DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space. + DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2]; + int16_t mb_padding[256 * 2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb /** * Cabac diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 76a648143d..bbca26ab4d 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1560,7 +1560,7 @@ static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, } static av_always_inline void -decode_cabac_residual_internal(H264Context *h, DCTELEM *block, +decode_cabac_residual_internal(H264Context *h, int16_t *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff, int is_dc, int chroma422) @@ -1744,18 +1744,27 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block, } -static void decode_cabac_residual_dc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { +static void decode_cabac_residual_dc_internal(H264Context *h, int16_t *block, + int cat, int n, + const uint8_t *scantable, + int max_coeff) +{ decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0); } -static void decode_cabac_residual_dc_internal_422(H264Context *h, DCTELEM *block, +static void decode_cabac_residual_dc_internal_422(H264Context *h, int16_t *block, int cat, int n, const uint8_t *scantable, int max_coeff) { decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1); } -static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { +static void decode_cabac_residual_nondc_internal(H264Context *h, int16_t *block, + int cat, int n, + const uint8_t *scantable, + const uint32_t *qmul, + int max_coeff) +{ decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0); } @@ -1771,7 +1780,12 @@ static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block * because it allows improved constant propagation into get_cabac_cbf_ctx, * as well as because most blocks have zero CBFs. */ -static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { +static av_always_inline void decode_cabac_residual_dc(H264Context *h, + int16_t *block, + int cat, int n, + const uint8_t *scantable, + int max_coeff) +{ /* read coded block flag */ if( get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 1 ) ] ) == 0 ) { h->non_zero_count_cache[scan8[n]] = 0; @@ -1781,7 +1795,7 @@ static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM * } static av_always_inline void -decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block, +decode_cabac_residual_dc_422(H264Context *h, int16_t *block, int cat, int n, const uint8_t *scantable, int max_coeff) { @@ -1793,7 +1807,13 @@ decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block, decode_cabac_residual_dc_internal_422(h, block, cat, n, scantable, max_coeff); } -static av_always_inline void decode_cabac_residual_nondc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) { +static av_always_inline void decode_cabac_residual_nondc(H264Context *h, + int16_t *block, + int cat, int n, + const uint8_t *scantable, + const uint32_t *qmul, + int max_coeff) +{ /* read coded block flag */ if( (cat != 5 || CHROMA444) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) { if( max_coeff == 64 ) { @@ -2361,7 +2381,7 @@ decode_intra_mb: if( cbp&0x20 ) { int c, i, i8x8; for( c = 0; c < 2; c++ ) { - DCTELEM *mb = h->mb + (16*(16 + 16*c) << pixel_shift); + int16_t *mb = h->mb + (16*(16 + 16*c) << pixel_shift); qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]]; for (i8x8 = 0; i8x8 < 2; i8x8++) { for (i = 0; i < 4; i++) { diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index cd1130a4bc..7ca2bb2a1f 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){ * @param max_coeff number of coefficients in the block * @return <0 if an error occurred */ -static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ +static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ MpegEncContext * const s = &h->s; static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3}; int level[16]; @@ -662,7 +662,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, GetBitContext * for(i8x8=0; i8x8<4; i8x8++){ if(cbp & (1<<i8x8)){ if(IS_8x8DCT(mb_type)){ - DCTELEM *buf = &h->mb[64*i8x8+256*p << pixel_shift]; + int16_t *buf = &h->mb[64*i8x8+256*p << pixel_shift]; uint8_t *nnz; for(i4x4=0; i4x4<4; i4x4++){ const int index= i4x4 + 4*i8x8 + p*16; @@ -1143,7 +1143,7 @@ decode_intra_mb: if(cbp&0x20){ for(chroma_idx=0; chroma_idx<2; chroma_idx++){ const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]]; - DCTELEM *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift); + int16_t *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift); for (i8x8=0; i8x8<num_c8x8; i8x8++) { for (i4x4=0; i4x4<4; i4x4++) { const int index= 16 + 16*chroma_idx + 8*i8x8 + i4x4; diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c index a11009412c..34e63dcc32 100644 --- a/libavcodec/h264_mb_template.c +++ b/libavcodec/h264_mb_template.c @@ -52,7 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h) const int transform_bypass = !SIMPLE && (s->qscale == 0 && h->sps.transform_bypass); /* is_h264 should always be true if SVQ3 is disabled. */ const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || s->codec_id == AV_CODEC_ID_H264; - void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); + void (*idct_add)(uint8_t *dst, int16_t *block, int stride); const int block_h = 16 >> s->chroma_y_shift; const int chroma422 = CHROMA422; diff --git a/libavcodec/h264dsp.h b/libavcodec/h264dsp.h index 45f81a09c8..f0eaacc79e 100644 --- a/libavcodec/h264dsp.h +++ b/libavcodec/h264dsp.h @@ -29,8 +29,6 @@ #include <stdint.h> -#include "dsputil.h" - typedef void (*h264_weight_func)(uint8_t *block, int stride, int height, int log2_denom, int weight, int offset); typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, @@ -80,29 +78,29 @@ typedef struct H264DSPContext { /* IDCT */ void (*h264_idct_add)(uint8_t *dst /*align 4*/, - DCTELEM *block /*align 16*/, int stride); + int16_t *block /*align 16*/, int stride); void (*h264_idct8_add)(uint8_t *dst /*align 8*/, - DCTELEM *block /*align 16*/, int stride); + int16_t *block /*align 16*/, int stride); void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/, - DCTELEM *block /*align 16*/, int stride); + int16_t *block /*align 16*/, int stride); void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/, - DCTELEM *block /*align 16*/, int stride); + int16_t *block /*align 16*/, int stride); void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset, - DCTELEM *block /*align 16*/, int stride, + int16_t *block /*align 16*/, int stride, const uint8_t nnzc[15 * 8]); void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset, - DCTELEM *block /*align 16*/, int stride, + int16_t *block /*align 16*/, int stride, const uint8_t nnzc[15 * 8]); void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset, - DCTELEM *block /*align 16*/, int stride, + int16_t *block /*align 16*/, int stride, const uint8_t nnzc[15 * 8]); void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset, - DCTELEM *block /*align 16*/, + int16_t *block /*align 16*/, int stride, const uint8_t nnzc[15 * 8]); - void (*h264_luma_dc_dequant_idct)(DCTELEM *output, - DCTELEM *input /*align 16*/, int qmul); - void (*h264_chroma_dc_dequant_idct)(DCTELEM *block, int qmul); + void (*h264_luma_dc_dequant_idct)(int16_t *output, + int16_t *input /*align 16*/, int qmul); + void (*h264_chroma_dc_dequant_idct)(int16_t *block, int qmul); } H264DSPContext; void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, diff --git a/libavcodec/h264idct_template.c b/libavcodec/h264idct_template.c index 313732b466..4a029a081c 100644 --- a/libavcodec/h264idct_template.c +++ b/libavcodec/h264idct_template.c @@ -47,7 +47,7 @@ static const uint8_t scan8[16*3]={ }; #endif -void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride) +void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride) { int i; pixel *dst = (pixel*)_dst; @@ -81,7 +81,7 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride) } } -void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ +void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){ int i; pixel *dst = (pixel*)_dst; dctcoef *block = (dctcoef*)_block; @@ -154,10 +154,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ } // assumes all AC coefs are 0 -void FUNCC(ff_h264_idct_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){ +void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, int16_t *block, int stride){ int i, j; int dc = (((dctcoef*)block)[0] + 32) >> 6; - pixel *dst = (pixel*)p_dst; + pixel *dst = (pixel*)_dst; stride >>= sizeof(pixel)-1; for( j = 0; j < 4; j++ ) { @@ -167,10 +167,10 @@ void FUNCC(ff_h264_idct_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){ } } -void FUNCC(ff_h264_idct8_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){ +void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *block, int stride){ int i, j; int dc = (((dctcoef*)block)[0] + 32) >> 6; - pixel *dst = (pixel*)p_dst; + pixel *dst = (pixel*)_dst; stride >>= sizeof(pixel)-1; for( j = 0; j < 8; j++ ) { @@ -180,7 +180,7 @@ void FUNCC(ff_h264_idct8_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){ } } -void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i++){ int nnz = nnzc[ scan8[i] ]; @@ -191,7 +191,7 @@ void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *b } } -void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i++){ if(nnzc[ scan8[i] ]) FUNCC(ff_h264_idct_add )(dst + block_offset[i], block + i*16*sizeof(pixel), stride); @@ -199,7 +199,7 @@ void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTEL } } -void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i+=4){ int nnz = nnzc[ scan8[i] ]; @@ -210,7 +210,7 @@ void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *b } } -void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i, j; for(j=1; j<3; j++){ for(i=j*16; i<j*16+4; i++){ @@ -222,7 +222,7 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM * } } -void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i, j; for(j=1; j<3; j++){ @@ -248,13 +248,13 @@ void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTEL * IDCT transforms the 16 dc values and dequantizes them. * @param qmul quantization parameter */ -void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){ +void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){ #define stride 16 int i; int temp[16]; static const uint8_t x_offset[4]={0, 2*stride, 8*stride, 10*stride}; - dctcoef *input = (dctcoef*)p_input; - dctcoef *output = (dctcoef*)p_output; + dctcoef *input = (dctcoef*)_input; + dctcoef *output = (dctcoef*)_output; for(i=0; i<4; i++){ const int z0= input[4*i+0] + input[4*i+1]; @@ -283,7 +283,7 @@ void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, in #undef stride } -void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){ +void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){ const int stride= 16*2; const int xStride= 16; int i; @@ -310,7 +310,7 @@ void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){ } } -void FUNCC(ff_h264_chroma_dc_dequant_idct)(DCTELEM *_block, int qmul){ +void FUNCC(ff_h264_chroma_dc_dequant_idct)(int16_t *_block, int qmul){ const int stride= 16*2; const int xStride= 16; int a,b,c,d,e; diff --git a/libavcodec/h264pred.h b/libavcodec/h264pred.h index 33f39447df..36b542b7be 100644 --- a/libavcodec/h264pred.h +++ b/libavcodec/h264pred.h @@ -28,8 +28,8 @@ #ifndef AVCODEC_H264PRED_H #define AVCODEC_H264PRED_H -#include "libavutil/common.h" -#include "dsputil.h" +#include <stddef.h> +#include <stdint.h> /** * Prediction types @@ -98,15 +98,15 @@ typedef struct H264PredContext { void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride); void(*pred4x4_add[2])(uint8_t *pix /*align 4*/, - const DCTELEM *block /*align 16*/, ptrdiff_t stride); + const int16_t *block /*align 16*/, ptrdiff_t stride); void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/, - const DCTELEM *block /*align 16*/, ptrdiff_t stride); + const int16_t *block /*align 16*/, ptrdiff_t stride); void(*pred8x8_add[3])(uint8_t *pix /*align 8*/, const int *block_offset, - const DCTELEM *block /*align 16*/, ptrdiff_t stride); + const int16_t *block /*align 16*/, ptrdiff_t stride); void(*pred16x16_add[3])(uint8_t *pix /*align 16*/, const int *block_offset, - const DCTELEM *block /*align 16*/, ptrdiff_t stride); + const int16_t *block /*align 16*/, ptrdiff_t stride); } H264PredContext; void ff_h264_pred_init(H264PredContext *h, int codec_id, diff --git a/libavcodec/h264pred_template.c b/libavcodec/h264pred_template.c index f08fdf4ba4..e78f2d423c 100644 --- a/libavcodec/h264pred_template.c +++ b/libavcodec/h264pred_template.c @@ -1132,7 +1132,7 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, #undef PL #undef SRC -static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, +static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; @@ -1151,7 +1151,7 @@ static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, } } -static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, +static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; @@ -1169,7 +1169,7 @@ static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, } } -static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, +static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; @@ -1192,7 +1192,7 @@ static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, } } -static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, +static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block, ptrdiff_t stride) { int i; @@ -1215,7 +1215,7 @@ static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, } static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, + const int16_t *block, ptrdiff_t stride) { int i; @@ -1225,7 +1225,7 @@ static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, + const int16_t *block, ptrdiff_t stride) { int i; @@ -1234,7 +1234,7 @@ static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, } static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, ptrdiff_t stride) + const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) @@ -1242,7 +1242,7 @@ static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, } static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, ptrdiff_t stride) + const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) @@ -1252,7 +1252,7 @@ static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, } static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, + const int16_t *block, ptrdiff_t stride) { int i; @@ -1262,7 +1262,7 @@ static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, const int *block_offset, - const DCTELEM *block, ptrdiff_t stride) + const int16_t *block, ptrdiff_t stride) { int i; for(i=0; i<4; i++) diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c index 44b13aa5ed..ec9a4c4257 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -439,7 +439,7 @@ static void h263_decode_dquant(MpegEncContext *s){ ff_set_qscale(s, s->qscale); } -static int h263_decode_block(MpegEncContext * s, DCTELEM * block, +static int h263_decode_block(MpegEncContext * s, int16_t * block, int n, int coded) { int code, level, i, j, last, run; @@ -564,7 +564,7 @@ not_coded: static int h263_skip_b_part(MpegEncContext *s, int cbp) { - LOCAL_ALIGNED_16(DCTELEM, dblock, [64]); + LOCAL_ALIGNED_16(int16_t, dblock, [64]); int i, mbi; int bli[6]; @@ -603,7 +603,7 @@ static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb) } int ff_h263_decode_mb(MpegEncContext *s, - DCTELEM block[6][64]) + int16_t block[6][64]) { int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; int16_t *mot_val; diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 3eb198f2ce..2c0f6dbc74 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -303,7 +303,7 @@ static const int dquant_code[5]= {1,0,9,2,3}; * @param block the 8x8 block * @param n block index (0-3 are luma, 4-5 are chroma) */ -static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) +static void h263_encode_block(MpegEncContext * s, int16_t * block, int n) { int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code; RLTable *rl; @@ -452,7 +452,7 @@ static void h263p_encode_umotion(MpegEncContext * s, int val) } void ff_h263_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { int cbpc, cbpy, i, cbp, pred_x, pred_y; diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c index 3e30e5d535..b2e41f107e 100644 --- a/libavcodec/jfdctfst.c +++ b/libavcodec/jfdctfst.c @@ -136,17 +136,17 @@ #endif -/* Multiply a DCTELEM variable by an int32_t constant, and immediately - * descale to yield a DCTELEM result. +/* Multiply a int16_t variable by an int32_t constant, and immediately + * descale to yield a int16_t result. */ -#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) +#define MULTIPLY(var,const) ((int16_t) DESCALE((var) * (const), CONST_BITS)) -static av_always_inline void row_fdct(DCTELEM * data){ +static av_always_inline void row_fdct(int16_t * data){ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1, z2, z3, z4, z5, z11, z13; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; /* Pass 1: process rows. */ @@ -205,12 +205,12 @@ static av_always_inline void row_fdct(DCTELEM * data){ */ GLOBAL(void) -ff_fdct_ifast (DCTELEM * data) +ff_fdct_ifast (int16_t * data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1, z2, z3, z4, z5, z11, z13; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; row_fdct(data); @@ -271,12 +271,12 @@ ff_fdct_ifast (DCTELEM * data) */ GLOBAL(void) -ff_fdct_ifast248 (DCTELEM * data) +ff_fdct_ifast248 (int16_t * data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; row_fdct(data); diff --git a/libavcodec/jfdctint_template.c b/libavcodec/jfdctint_template.c index 5175390710..d2fe093b2b 100644 --- a/libavcodec/jfdctint_template.c +++ b/libavcodec/jfdctint_template.c @@ -184,12 +184,12 @@ #endif -static av_always_inline void FUNC(row_fdct)(DCTELEM *data) +static av_always_inline void FUNC(row_fdct)(int16_t *data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1, z2, z3, z4, z5; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; /* Pass 1: process rows. */ @@ -216,13 +216,13 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data) tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); - dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); + dataptr[0] = (int16_t) ((tmp10 + tmp11) << PASS1_BITS); + dataptr[4] = (int16_t) ((tmp10 - tmp11) << PASS1_BITS); z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); - dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), + dataptr[2] = (int16_t) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), + dataptr[6] = (int16_t) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), CONST_BITS-PASS1_BITS); /* Odd part per figure 8 --- note paper omits factor of sqrt(2). @@ -248,10 +248,10 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data) z3 += z5; z4 += z5; - dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); + dataptr[7] = (int16_t) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); + dataptr[5] = (int16_t) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); + dataptr[3] = (int16_t) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); + dataptr[1] = (int16_t) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); dataptr += DCTSIZE; /* advance pointer to next row */ } @@ -262,12 +262,12 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data) */ GLOBAL(void) -FUNC(ff_jpeg_fdct_islow)(DCTELEM *data) +FUNC(ff_jpeg_fdct_islow)(int16_t *data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1, z2, z3, z4, z5; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; FUNC(row_fdct)(data); @@ -344,12 +344,12 @@ FUNC(ff_jpeg_fdct_islow)(DCTELEM *data) * you do even part two times. */ GLOBAL(void) -FUNC(ff_fdct248_islow)(DCTELEM *data) +FUNC(ff_fdct248_islow)(int16_t *data) { int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int tmp10, tmp11, tmp12, tmp13; int z1; - DCTELEM *dataptr; + int16_t *dataptr; int ctr; FUNC(row_fdct)(data); diff --git a/libavcodec/jrevdct.c b/libavcodec/jrevdct.c index 395eb8c638..897842cf69 100644 --- a/libavcodec/jrevdct.c +++ b/libavcodec/jrevdct.c @@ -74,7 +74,7 @@ #define RIGHT_SHIFT(x, n) ((x) >> (n)) -typedef DCTELEM DCTBLOCK[DCTSIZE2]; +typedef int16_t DCTBLOCK[DCTSIZE2]; #define CONST_BITS 13 @@ -213,7 +213,7 @@ void ff_j_rev_dct(DCTBLOCK data) int32_t tmp10, tmp11, tmp12, tmp13; int32_t z1, z2, z3, z4, z5; int32_t d0, d1, d2, d3, d4, d5, d6, d7; - register DCTELEM *dataptr; + register int16_t *dataptr; int rowctr; /* Pass 1: process rows. */ @@ -249,7 +249,7 @@ void ff_j_rev_dct(DCTBLOCK data) /* AC terms all zero */ if (d0) { /* Compute a 32 bit value to assign. */ - DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS); + int16_t dcval = (int16_t) (d0 << PASS1_BITS); register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); idataptr[0] = v; @@ -574,14 +574,14 @@ void ff_j_rev_dct(DCTBLOCK data) } /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); - dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); - dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); - dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); - dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); - dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); + dataptr[0] = (int16_t) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); + dataptr[7] = (int16_t) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); + dataptr[1] = (int16_t) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); + dataptr[6] = (int16_t) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); + dataptr[2] = (int16_t) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); + dataptr[5] = (int16_t) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); + dataptr[3] = (int16_t) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); + dataptr[4] = (int16_t) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); dataptr += DCTSIZE; /* advance pointer to next row */ } @@ -920,21 +920,21 @@ void ff_j_rev_dct(DCTBLOCK data) /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3, + dataptr[DCTSIZE*0] = (int16_t) DESCALE(tmp10 + tmp3, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3, + dataptr[DCTSIZE*7] = (int16_t) DESCALE(tmp10 - tmp3, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2, + dataptr[DCTSIZE*1] = (int16_t) DESCALE(tmp11 + tmp2, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2, + dataptr[DCTSIZE*6] = (int16_t) DESCALE(tmp11 - tmp2, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1, + dataptr[DCTSIZE*2] = (int16_t) DESCALE(tmp12 + tmp1, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1, + dataptr[DCTSIZE*5] = (int16_t) DESCALE(tmp12 - tmp1, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0, + dataptr[DCTSIZE*3] = (int16_t) DESCALE(tmp13 + tmp0, CONST_BITS+PASS1_BITS+3); - dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0, + dataptr[DCTSIZE*4] = (int16_t) DESCALE(tmp13 - tmp0, CONST_BITS+PASS1_BITS+3); dataptr++; /* advance pointer to next column */ @@ -951,7 +951,7 @@ void ff_j_rev_dct4(DCTBLOCK data) int32_t tmp10, tmp11, tmp12, tmp13; int32_t z1; int32_t d0, d2, d4, d6; - register DCTELEM *dataptr; + register int16_t *dataptr; int rowctr; /* Pass 1: process rows. */ @@ -983,7 +983,7 @@ void ff_j_rev_dct4(DCTBLOCK data) /* AC terms all zero */ if (d0) { /* Compute a 32 bit value to assign. */ - DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS); + int16_t dcval = (int16_t) (d0 << PASS1_BITS); register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); idataptr[0] = v; @@ -1045,10 +1045,10 @@ void ff_j_rev_dct4(DCTBLOCK data) /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ - dataptr[0] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS); - dataptr[1] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS); - dataptr[2] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS); - dataptr[3] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS); + dataptr[0] = (int16_t) DESCALE(tmp10, CONST_BITS-PASS1_BITS); + dataptr[1] = (int16_t) DESCALE(tmp11, CONST_BITS-PASS1_BITS); + dataptr[2] = (int16_t) DESCALE(tmp12, CONST_BITS-PASS1_BITS); + dataptr[3] = (int16_t) DESCALE(tmp13, CONST_BITS-PASS1_BITS); dataptr += DCTSTRIDE; /* advance pointer to next row */ } diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 364e999513..68e850c60e 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -45,14 +45,14 @@ typedef struct MDECContext{ int mb_width; int mb_height; int mb_x, mb_y; - DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; + DECLARE_ALIGNED(16, int16_t, block)[6][64]; uint8_t *bitstream_buffer; unsigned int bitstream_buffer_size; int block_last_index[6]; } MDECContext; //very similar to MPEG-1 -static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n) +static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) { int level, diff, i, j, run; int component; @@ -119,7 +119,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n) return 0; } -static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){ +static inline int decode_mb(MDECContext *a, int16_t block[6][64]){ int i; const int block_index[6]= {5,4,0,1,2,3}; @@ -134,7 +134,7 @@ static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){ } static inline void idct_put(MDECContext *a, int mb_x, int mb_y){ - DCTELEM (*block)[64]= a->block; + int16_t (*block)[64]= a->block; int linesize= a->picture.linesize[0]; uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 880bbc0ddd..f0579fd031 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -47,7 +47,7 @@ typedef struct { AVFrame buf_ptrs [16]; AVPicture flipped_ptrs[16]; - DECLARE_ALIGNED(16, DCTELEM, dct_block)[64]; + DECLARE_ALIGNED(16, int16_t, dct_block)[64]; GetBitContext gb; ScanTable scantable; @@ -183,7 +183,7 @@ static const int8_t vlcdec_lookup[9][64] = { static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale) { - DCTELEM *block = ctx->dct_block; + int16_t *block = ctx->dct_block; unsigned int pos; ctx->dsp.clear_block(block); diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 78a0453d57..6551b52630 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -498,7 +498,7 @@ static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index) } /* decode block and dequantize */ -static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component, +static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int ac_index, int16_t *quant_matrix) { int code, i, j, level, val; @@ -546,7 +546,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component, return 0; } -static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block, +static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block, int component, int dc_index, int16_t *quant_matrix, int Al) { @@ -564,7 +564,7 @@ static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block, } /* decode block and dequantize - progressive JPEG version */ -static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, +static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block, uint8_t *last_nnz, int ac_index, int16_t *quant_matrix, int ss, int se, int Al, int *EOBRUN) @@ -662,7 +662,7 @@ for (; ; i++) { \ } /* decode block and dequantize - progressive JPEG refinement pass */ -static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block, +static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block, uint8_t *last_nnz, int ac_index, int16_t *quant_matrix, int ss, int se, int Al, int *EOBRUN) @@ -1081,7 +1081,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, } else { int block_idx = s->block_stride[c] * (v * mb_y + y) + (h * mb_x + x); - DCTELEM *block = s->blocks[c][block_idx]; + int16_t *block = s->blocks[c][block_idx]; if (Ah) block[0] += get_bits1(&s->gb) * s->quant_matrixes[s->quant_index[c]][0] << Al; @@ -1139,7 +1139,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, for (mb_y = 0; mb_y < s->mb_height; mb_y++) { uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres); int block_idx = mb_y * s->block_stride[c]; - DCTELEM (*block)[64] = &s->blocks[c][block_idx]; + int16_t (*block)[64] = &s->blocks[c][block_idx]; uint8_t *last_nnz = &s->last_nnz[c][block_idx]; for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) { int ret; diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index 6c6195b3d3..01f4323bc7 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -91,8 +91,8 @@ typedef struct MJpegDecodeContext { int got_picture; ///< we found a SOF and picture is valid, too. int linesize[MAX_COMPONENTS]; ///< linesize << interlaced int8_t *qscale_table; - DECLARE_ALIGNED(16, DCTELEM, block)[64]; - DCTELEM (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) + DECLARE_ALIGNED(16, int16_t, block)[64]; + int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) uint8_t *last_nnz[MAX_COMPONENTS]; uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode) ScanTable scantable; diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 7ac304295c..2a92dbdf73 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -397,7 +397,7 @@ void ff_mjpeg_encode_dc(MpegEncContext *s, int val, } } -static void encode_block(MpegEncContext *s, DCTELEM *block, int n) +static void encode_block(MpegEncContext *s, int16_t *block, int n) { int mant, nbits, code, i, j; int component, dc, run, last_index, val; @@ -455,7 +455,7 @@ static void encode_block(MpegEncContext *s, DCTELEM *block, int n) put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]); } -void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]) +void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]) { int i; if (s->chroma_format == CHROMA_444) { diff --git a/libavcodec/mjpegenc.h b/libavcodec/mjpegenc.h index 06f77c6a15..ce0c1cce15 100644 --- a/libavcodec/mjpegenc.h +++ b/libavcodec/mjpegenc.h @@ -33,7 +33,8 @@ #ifndef AVCODEC_MJPEGENC_H #define AVCODEC_MJPEGENC_H -#include "dsputil.h" +#include <stdint.h> + #include "mpegvideo.h" typedef struct MJpegContext { @@ -55,6 +56,6 @@ void ff_mjpeg_encode_picture_trailer(MpegEncContext *s); void ff_mjpeg_encode_stuffing(MpegEncContext *s); void ff_mjpeg_encode_dc(MpegEncContext *s, int val, uint8_t *huff_size, uint16_t *huff_code); -void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]); +void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]); #endif /* AVCODEC_MJPEGENC_H */ diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index d8e22a26af..c385853edc 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -81,7 +81,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred) return sign_extend(val, 5 + shift); } -static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n) { int level, dc, diff, i, j, run; int component; @@ -152,12 +152,12 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, in return 0; } -int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) +int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n) { return mpeg1_decode_block_intra(s, block, n); } -static inline int mpeg1_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; @@ -237,7 +237,7 @@ end: * Changing this would eat up any speed benefits it has. * Do not use "fast" flag if you need the code to be robust. */ -static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; @@ -309,7 +309,7 @@ end: } -static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; @@ -394,7 +394,7 @@ end: * Do not use "fast" flag if you need the code to be robust. */ static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, - DCTELEM *block, int n) + int16_t *block, int n) { int level, i, j, run; RLTable *rl = &ff_rl_mpeg1; @@ -455,7 +455,7 @@ end: } -static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, int n) { int level, dc, diff, i, j, run; int component; @@ -538,7 +538,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, in * Changing this would eat up any speed benefits it has. * Do not use "fast" flag if you need the code to be robust. */ -static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) +static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *block, int n) { int level, dc, diff, j, run; int component; @@ -737,7 +737,7 @@ static inline int get_qscale(MpegEncContext *s) static void exchange_uv(MpegEncContext *s) { - DCTELEM (*tmp)[64]; + int16_t (*tmp)[64]; tmp = s->pblocks[4]; s->pblocks[4] = s->pblocks[5]; @@ -750,7 +750,7 @@ static void exchange_uv(MpegEncContext *s) #define MT_16X8 2 #define MT_DMV 3 -static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) +static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) { int i, j, k, cbp, val, mb_type, motion_type; const int mb_block_count = 4 + (1 << s->chroma_format); diff --git a/libavcodec/mpeg12.h b/libavcodec/mpeg12.h index 6e60c8695f..1f369176a5 100644 --- a/libavcodec/mpeg12.h +++ b/libavcodec/mpeg12.h @@ -71,6 +71,6 @@ static inline int decode_dc(GetBitContext *gb, int component) return diff; } -extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n); +extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n); #endif /* AVCODEC_MPEG12_H */ diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index f2b5c05f0d..4a54ed58ec 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -52,7 +52,7 @@ static const uint8_t svcd_scan_offset_placeholder[14] = { }; static void mpeg1_encode_block(MpegEncContext *s, - DCTELEM *block, + int16_t *block, int component); static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added @@ -471,7 +471,7 @@ static inline void put_mb_modes(MpegEncContext *s, int n, int bits, } static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y, int mb_block_count) { @@ -695,7 +695,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, } } -void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y) +void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y) { if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8); @@ -878,7 +878,7 @@ static inline void encode_dc(MpegEncContext *s, int diff, int component) } static void mpeg1_encode_block(MpegEncContext *s, - DCTELEM *block, + int16_t *block, int n) { int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; diff --git a/libavcodec/mpeg4video.h b/libavcodec/mpeg4video.h index 97c39b6ed6..400ce4d184 100644 --- a/libavcodec/mpeg4video.h +++ b/libavcodec/mpeg4video.h @@ -83,9 +83,9 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; extern const uint8_t ff_mpeg4_dc_threshold[8]; void ff_mpeg4_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); -void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, +void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n, int dir); void ff_set_mpeg4_time(MpegEncContext * s); void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index acbc525a38..62106d9e30 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -53,7 +53,7 @@ static const int mb_type_b_map[4]= { * @param n block index (0-3 are luma, 4-5 are chroma) * @param dir the ac prediction direction */ -void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, +void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n, int dir) { int i; @@ -843,7 +843,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s) * Decode a block. * @return <0 if an error occurred */ -static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, +static inline int mpeg4_decode_block(MpegEncContext * s, int16_t * block, int n, int coded, int intra, int rvlc) { int level, i, last, run; @@ -1089,7 +1089,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, * decode partition C of one MB. * @return <0 if an error occurred */ -static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) +static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, mb_type; const int xy= s->mb_x + s->mb_y*s->mb_stride; @@ -1172,7 +1172,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) } static int mpeg4_decode_mb(MpegEncContext *s, - DCTELEM block[6][64]) + int16_t block[6][64]) { int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; int16_t *mot_val; diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 33115061fe..0cc4df9a07 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -59,7 +59,7 @@ max run: 29/41 * Return the number of bits that encoding the 8x8 block in block would need. * @param[in] block_last_index last index in scantable order that refers to a non zero element in block. */ -static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){ +static inline int get_block_rate(MpegEncContext * s, int16_t block[64], int block_last_index, uint8_t scantable[64]){ int last=0; int j; int rate=0; @@ -91,7 +91,7 @@ static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int bloc * @param[out] st scantable for each 8x8 block * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order */ -static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], const int zigzag_last_index[6]) +static inline void restore_ac_coeffs(MpegEncContext * s, int16_t block[6][64], const int dir[6], uint8_t *st[6], const int zigzag_last_index[6]) { int i, n; memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6); @@ -122,7 +122,7 @@ static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], c * @param[out] st scantable for each 8x8 block * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order */ -static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6]) +static inline int decide_ac_pred(MpegEncContext * s, int16_t block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6]) { int score= 0; int i, n; @@ -294,7 +294,7 @@ static inline int mpeg4_get_dc_length(int level, int n){ * Encode an 8x8 block. * @param n block index (0-3 are luma, 4-5 are chroma) */ -static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, +static inline void mpeg4_encode_block(MpegEncContext * s, int16_t * block, int n, int intra_dc, uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) { int i, last_non_zero; @@ -345,7 +345,7 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n } } -static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, +static int mpeg4_get_block_length(MpegEncContext * s, int16_t * block, int n, int intra_dc, uint8_t *scan_table) { int i, last_non_zero; @@ -396,7 +396,7 @@ static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, in return len; } -static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6], +static inline void mpeg4_encode_blocks(MpegEncContext * s, int16_t block[6][64], int intra_dc[6], uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){ int i; @@ -425,7 +425,7 @@ static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], } } -static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64], +static inline int get_b_cbp(MpegEncContext * s, int16_t block[6][64], int motion_x, int motion_y, int mb_type) { int cbp = 0, i; @@ -469,7 +469,7 @@ static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64], static const int dquant_code[5]= {1,0,9,2,3}; void ff_mpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { int cbpc, cbpy, pred_x, pred_y; diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index a21054b5ff..e6e7337082 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -43,19 +43,19 @@ //#include <assert.h> static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_h263_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); static void dct_unquantize_h263_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale); + int16_t *block, int n, int qscale); //#define DEBUG @@ -392,7 +392,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared) } if (s->avctx->debug&FF_DEBUG_DCT_COEFF) { FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.dct_coeff, - 64 * mb_array_size * sizeof(DCTELEM) * 6, fail) + 64 * mb_array_size * sizeof(int16_t) * 6, fail) } pic->f.qstride = s->mb_stride; FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.pan_scan, @@ -469,7 +469,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base) 2 * 64 * sizeof(int), fail) } } - FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(DCTELEM), fail) + FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(int16_t), fail) s->block = s->blocks[0]; for (i = 0; i < 12; i++) { @@ -2434,7 +2434,7 @@ unhandled: /* put block[] to dest[] */ static inline void put_dct(MpegEncContext *s, - DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale) + int16_t *block, int i, uint8_t *dest, int line_size, int qscale) { s->dct_unquantize_intra(s, block, i, qscale); s->dsp.idct_put (dest, line_size, block); @@ -2442,7 +2442,7 @@ static inline void put_dct(MpegEncContext *s, /* add block[] to dest[] */ static inline void add_dct(MpegEncContext *s, - DCTELEM *block, int i, uint8_t *dest, int line_size) + int16_t *block, int i, uint8_t *dest, int line_size) { if (s->block_last_index[i] >= 0) { s->dsp.idct_add (dest, line_size, block); @@ -2450,7 +2450,7 @@ static inline void add_dct(MpegEncContext *s, } static inline void add_dequant_dct(MpegEncContext *s, - DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale) + int16_t *block, int i, uint8_t *dest, int line_size, int qscale) { if (s->block_last_index[i] >= 0) { s->dct_unquantize_inter(s, block, i, qscale); @@ -2503,7 +2503,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) s->interlaced_dct : true if interlaced dct used (mpeg2) */ static av_always_inline -void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], +void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], int lowres_flag, int is_mpeg12) { const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; @@ -2515,7 +2515,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { /* save DCT coefficients */ int i,j; - DCTELEM *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6]; + int16_t *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6]; av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); for(i=0; i<6; i++){ for(j=0; j<64; j++){ @@ -2746,7 +2746,7 @@ skip_idct: } } -void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ +void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){ #if !CONFIG_SMALL if(s->out_format == FMT_MPEG1) { if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1); @@ -2888,7 +2888,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){ } static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; @@ -2917,7 +2917,7 @@ static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, } static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; @@ -2946,7 +2946,7 @@ static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, } static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; @@ -2973,7 +2973,7 @@ static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, } static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; @@ -3004,7 +3004,7 @@ static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, } static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, nCoeffs; const uint16_t *quant_matrix; @@ -3035,7 +3035,7 @@ static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, } static void dct_unquantize_h263_intra_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, qmul, qadd; int nCoeffs; @@ -3069,7 +3069,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s, } static void dct_unquantize_h263_inter_c(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, qmul, qadd; int nCoeffs; diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index a2320ad405..03f4f9ff1e 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -681,39 +681,39 @@ typedef struct MpegEncContext { uint8_t *ptr_lastgob; int swap_uv; //vcr2 codec is an MPEG-2 variant with U and V swapped - DCTELEM (*pblocks[12])[64]; + int16_t (*pblocks[12])[64]; - DCTELEM (*block)[64]; ///< points to one of the following blocks - DCTELEM (*blocks)[12][64]; // for HQ mode we need to keep the best block - int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch() + int16_t (*block)[64]; ///< points to one of the following blocks + int16_t (*blocks)[12][64]; // for HQ mode we need to keep the best block + int (*decode_mb)(struct MpegEncContext *s, int16_t block[6][64]); // used by some codecs to avoid a switch() #define SLICE_OK 0 #define SLICE_ERROR -1 #define SLICE_END -2 ///<end marker found #define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_h263_intra)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_h263_inter)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_h261_intra)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_h261_inter)(struct MpegEncContext *s, - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) - DCTELEM *block/*align 16*/, int n, int qscale); + int16_t *block/*align 16*/, int n, int qscale); void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) - DCTELEM *block/*align 16*/, int n, int qscale); - int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); - int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); - void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block); + int16_t *block/*align 16*/, int n, int qscale); + int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); + int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); + void (*denoise_dct)(struct MpegEncContext *s, int16_t *block); int mpv_flags; ///< flags set by private options int quantizer_noise_shaping; @@ -776,7 +776,7 @@ int ff_MPV_common_init(MpegEncContext *s); int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize); int ff_MPV_common_frame_size_change(MpegEncContext *s); void ff_MPV_common_end(MpegEncContext *s); -void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]); +void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]); int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); void ff_MPV_frame_end(MpegEncContext *s); int ff_MPV_encode_init(AVCodecContext *avctx); @@ -796,7 +796,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict); void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); void ff_release_unused_pictures(MpegEncContext *s, int remove_current); int ff_find_unused_picture(MpegEncContext *s, int shared); -void ff_denoise_dct(MpegEncContext *s, DCTELEM *block); +void ff_denoise_dct(MpegEncContext *s, int16_t *block); int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src); int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir); void ff_MPV_report_decode_progress(MpegEncContext *s); @@ -812,7 +812,7 @@ int ff_dct_common_init(MpegEncContext *s); int ff_dct_encode_init(MpegEncContext *s); void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64], const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra); -int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); +int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow); void ff_init_block_index(MpegEncContext *s); void ff_copy_picture(Picture *dst, Picture *src); @@ -887,7 +887,7 @@ extern const uint8_t * const ff_mpeg2_dc_scale_table[4]; void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); void ff_mpeg1_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); void ff_mpeg1_encode_init(MpegEncContext *s); void ff_mpeg1_encode_slice_header(MpegEncContext *s); @@ -902,7 +902,7 @@ extern const uint8_t ff_h263_loop_filter_strength[32]; void ff_h261_loop_filter(MpegEncContext *s); void ff_h261_reorder_mb_index(MpegEncContext* s); void ff_h261_encode_mb(MpegEncContext *s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number); void ff_h261_encode_init(MpegEncContext *s); @@ -919,7 +919,7 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number); void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number); void ff_msmpeg4_encode_ext_header(MpegEncContext * s); void ff_msmpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); int ff_msmpeg4_decode_picture_header(MpegEncContext * s); int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size); @@ -927,14 +927,14 @@ int ff_msmpeg4_decode_init(AVCodecContext *avctx); void ff_msmpeg4_encode_init(MpegEncContext *s); int ff_wmv2_decode_picture_header(MpegEncContext * s); int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s); -void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); +void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); void ff_mspel_motion(MpegEncContext *s, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, uint8_t **ref_picture, op_pixels_func (*pix_op)[4], int motion_x, int motion_y, int h); int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); void ff_wmv2_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y); #endif /* AVCODEC_MPEGVIDEO_H */ diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 1e4c58d9ce..ef9e0f398d 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -52,10 +52,10 @@ //#include <assert.h> static int encode_picture(MpegEncContext *s, int picture_number); -static int dct_quantize_refine(MpegEncContext *s, DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale); +static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale); static int sse_mb(MpegEncContext *s); -static void denoise_dct_c(MpegEncContext *s, DCTELEM *block); -static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); +static void denoise_dct_c(MpegEncContext *s, int16_t *block); +static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow); //#define DEBUG @@ -1727,7 +1727,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s, int score = 0; int run = 0; int i; - DCTELEM *block = s->block[n]; + int16_t *block = s->block[n]; const int last_index = s->block_last_index[n]; int skip_dc; @@ -1767,7 +1767,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s, s->block_last_index[n] = -1; } -static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block, +static inline void clip_coeffs(MpegEncContext *s, int16_t *block, int last_index) { int i; @@ -1832,7 +1832,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int mb_block_count) { int16_t weight[12][64]; - DCTELEM orig[12][64]; + int16_t orig[12][64]; const int mb_x = s->mb_x; const int mb_y = s->mb_y; int i; @@ -2093,7 +2093,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, get_visual_weight(weight[7], ptr_cr + uv_dct_offset, wrap_c); } - memcpy(orig[0], s->block[0], sizeof(DCTELEM) * 64 * mb_block_count); + memcpy(orig[0], s->block[0], sizeof(int16_t) * 64 * mb_block_count); } /* DCT & quantize */ @@ -2839,7 +2839,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD const int last_qp= backup_s.qscale; int qpi, qp, dc[6]; - DCTELEM ac[6][16]; + int16_t ac[6][16]; const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0; static const int dquant_tab[4]={-1,1,-2,2}; @@ -2864,7 +2864,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(s->mb_intra && s->dc_val[0]){ for(i=0; i<6; i++){ dc[i]= s->dc_val[0][ s->block_index[i] ]; - memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(DCTELEM)*16); + memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(int16_t)*16); } } @@ -2874,7 +2874,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(s->mb_intra && s->dc_val[0]){ for(i=0; i<6; i++){ s->dc_val[0][ s->block_index[i] ]= dc[i]; - memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(DCTELEM)*16); + memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(int16_t)*16); } } } @@ -3479,7 +3479,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) return 0; } -static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){ +static void denoise_dct_c(MpegEncContext *s, int16_t *block){ const int intra= s->mb_intra; int i; @@ -3504,7 +3504,7 @@ static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){ } static int dct_quantize_trellis_c(MpegEncContext *s, - DCTELEM *block, int n, + int16_t *block, int n, int qscale, int *overflow){ const int *qmat; const uint8_t *scantable= s->intra_scantable.scantable; @@ -3611,7 +3611,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, *overflow= s->max_qcoeff < max; //overflow might have happened if(last_non_zero < start_i){ - memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); + memset(block + start_i, 0, (64-start_i)*sizeof(int16_t)); return last_non_zero; } @@ -3743,7 +3743,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, dc= FFABS(block[0]); last_non_zero= last_i - 1; - memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); + memset(block + start_i, 0, (64-start_i)*sizeof(int16_t)); if(last_non_zero < start_i) return last_non_zero; @@ -3818,10 +3818,10 @@ static void build_basis(uint8_t *perm){ } static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? - DCTELEM *block, int16_t *weight, DCTELEM *orig, + int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale){ int16_t rem[64]; - LOCAL_ALIGNED_16(DCTELEM, d1, [64]); + LOCAL_ALIGNED_16(int16_t, d1, [64]); const uint8_t *scantable= s->intra_scantable.scantable; const uint8_t *perm_scantable= s->intra_scantable.permutated; // unsigned int threshold1, threshold2; @@ -4191,7 +4191,7 @@ STOP_TIMER("iterative search") } int ff_dct_quantize_c(MpegEncContext *s, - DCTELEM *block, int n, + int16_t *block, int n, int qscale, int *overflow) { int i, j, level, last_non_zero, q, start_i; diff --git a/libavcodec/mpegvideo_xvmc.c b/libavcodec/mpegvideo_xvmc.c index 6247e6240c..30a37e911a 100644 --- a/libavcodec/mpegvideo_xvmc.c +++ b/libavcodec/mpegvideo_xvmc.c @@ -44,7 +44,7 @@ void ff_xvmc_init_block(MpegEncContext *s) struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2]; assert(render && render->xvmc_id == AV_XVMC_ID); - s->block = (DCTELEM (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); + s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); } /** diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 00fac8c4b2..278c5fcfdc 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -404,7 +404,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) return val; } -static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) +static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; uint32_t * const mb_type_ptr = &s->current_picture.f.mb_type[s->mb_x + s->mb_y*s->mb_stride]; @@ -494,7 +494,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) return 0; } -static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) +static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) { int cbp, code, i; uint8_t *coded_val; @@ -938,7 +938,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) } //#define ERROR_DETAILS -int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, +int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, int n, int coded, const uint8_t *scan_table) { int level, i, last, run, run_diff; diff --git a/libavcodec/msmpeg4.h b/libavcodec/msmpeg4.h index abc414cfdd..a723888192 100644 --- a/libavcodec/msmpeg4.h +++ b/libavcodec/msmpeg4.h @@ -26,7 +26,6 @@ #include "config.h" #include "avcodec.h" -#include "dsputil.h" #include "mpegvideo.h" #include "msmpeg4data.h" #include "put_bits.h" @@ -45,17 +44,17 @@ extern VLC ff_inter_intra_vlc; void ff_msmpeg4_code012(PutBitContext *pb, int n); void ff_msmpeg4_common_init(MpegEncContext *s); -void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n); +void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n); void ff_msmpeg4_handle_slices(MpegEncContext *s); void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, uint8_t **coded_block_ptr); int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); -int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, +int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, int n, int coded, const uint8_t *scan_table); int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, int16_t **dc_val_ptr, int *dir_ptr); -int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]); +int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]); #define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ CONFIG_MSMPEG4V2_DECODER || \ diff --git a/libavcodec/msmpeg4enc.c b/libavcodec/msmpeg4enc.c index 71b84df739..82e6646fba 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -369,7 +369,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) } void ff_msmpeg4_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { int cbp, coded_cbp, i; @@ -570,7 +570,7 @@ static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr /* Encoding of a block. Very similar to MPEG4 except for a different escape coding (same as H263) and more vlc tables. */ -void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n) +void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n) { int level, run, last, i, j, last_index; int last_non_zero, sign, slevel; diff --git a/libavcodec/ppc/dsputil_altivec.c b/libavcodec/ppc/dsputil_altivec.c index 149cbf522a..ab8e3b7fb1 100644 --- a/libavcodec/ppc/dsputil_altivec.c +++ b/libavcodec/ppc/dsputil_altivec.c @@ -476,7 +476,7 @@ static int pix_sum_altivec(uint8_t * pix, int line_size) return s; } -static void get_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size) +static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size) { int i; vector unsigned char perm = vec_lvsl(0, pixels); @@ -502,7 +502,7 @@ static void get_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *pixels } } -static void diff_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *s1, +static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, const uint8_t *s2, int stride) { int i; @@ -576,7 +576,7 @@ static void diff_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *s1, } -static void clear_block_altivec(DCTELEM *block) { +static void clear_block_altivec(int16_t *block) { LOAD_ZERO; vec_st(zero_s16v, 0, block); vec_st(zero_s16v, 16, block); diff --git a/libavcodec/ppc/dsputil_ppc.c b/libavcodec/ppc/dsputil_ppc.c index 1537d92643..50aa188829 100644 --- a/libavcodec/ppc/dsputil_ppc.c +++ b/libavcodec/ppc/dsputil_ppc.c @@ -47,7 +47,7 @@ distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required. see <http://developer.apple.com/technotes/tn/tn2087.html> and <http://developer.apple.com/technotes/tn/tn2086.html> */ -static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) +static void clear_blocks_dcbz32_ppc(int16_t *blocks) { register int misal = ((unsigned long)blocks & 0x00000010); register int i = 0; @@ -58,7 +58,7 @@ static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) ((unsigned long*)blocks)[3] = 0L; i += 16; } - for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) { + for ( ; i < sizeof(int16_t)*6*64-31 ; i += 32) { __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory"); } if (misal) { @@ -73,7 +73,7 @@ static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) /* same as above, when dcbzl clear a whole 128B cache line i.e. the PPC970 aka G5 */ #if HAVE_DCBZL -static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) +static void clear_blocks_dcbz128_ppc(int16_t *blocks) { register int misal = ((unsigned long)blocks & 0x0000007f); register int i = 0; @@ -81,17 +81,17 @@ static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) // we could probably also optimize this case, // but there's not much point as the machines // aren't available yet (2003-06-26) - memset(blocks, 0, sizeof(DCTELEM)*6*64); + memset(blocks, 0, sizeof(int16_t)*6*64); } else - for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) { + for ( ; i < sizeof(int16_t)*6*64 ; i += 128) { __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory"); } } #else -static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) +static void clear_blocks_dcbz128_ppc(int16_t *blocks) { - memset(blocks, 0, sizeof(DCTELEM)*6*64); + memset(blocks, 0, sizeof(int16_t)*6*64); } #endif diff --git a/libavcodec/ppc/h264_altivec.c b/libavcodec/ppc/h264_altivec.c index be54b48303..619f326d55 100644 --- a/libavcodec/ppc/h264_altivec.c +++ b/libavcodec/ppc/h264_altivec.c @@ -315,7 +315,7 @@ H264_MC(avg_, 16, altivec) va_u32 = vec_splat((vec_u32)va_u8, 0); \ vec_ste(va_u32, element, (uint32_t*)dst); -static void ff_h264_idct_add_altivec(uint8_t *dst, DCTELEM *block, int stride) +static void ff_h264_idct_add_altivec(uint8_t *dst, int16_t *block, int stride) { vec_s16 va0, va1, va2, va3; vec_s16 vz0, vz1, vz2, vz3; @@ -429,7 +429,7 @@ static void ff_h264_idct_add_altivec(uint8_t *dst, DCTELEM *block, int stride) vec_st( hv, 0, dest ); \ } -static void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) { +static void ff_h264_idct8_add_altivec( uint8_t *dst, int16_t *dct, int stride ) { vec_s16 s0, s1, s2, s3, s4, s5, s6, s7; vec_s16 d0, d1, d2, d3, d4, d5, d6, d7; vec_s16 idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7; @@ -473,7 +473,7 @@ static void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel); } -static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, DCTELEM *block, int stride, int size) +static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, int16_t *block, int stride, int size) { vec_s16 dc16; vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner; @@ -518,17 +518,17 @@ static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, DCTELEM *bl } } -static void h264_idct_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride) +static void h264_idct_dc_add_altivec(uint8_t *dst, int16_t *block, int stride) { h264_idct_dc_add_internal(dst, block, stride, 4); } -static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride) +static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, int16_t *block, int stride) { h264_idct_dc_add_internal(dst, block, stride, 8); } -static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i++){ int nnz = nnzc[ scan8[i] ]; @@ -539,7 +539,7 @@ static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, DC } } -static void ff_h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +static void ff_h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i++){ if(nnzc[ scan8[i] ]) ff_h264_idct_add_altivec(dst + block_offset[i], block + i*16, stride); @@ -547,7 +547,7 @@ static void ff_h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offse } } -static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i; for(i=0; i<16; i+=4){ int nnz = nnzc[ scan8[i] ]; @@ -558,7 +558,7 @@ static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DC } } -static void ff_h264_idct_add8_altivec(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ +static void ff_h264_idct_add8_altivec(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ int i, j; for (j = 1; j < 3; j++) { for(i = j * 16; i < j * 16 + 4; i++){ diff --git a/libavcodec/ppc/mpegvideo_altivec.c b/libavcodec/ppc/mpegvideo_altivec.c index bbc102bc21..6a1a06537f 100644 --- a/libavcodec/ppc/mpegvideo_altivec.c +++ b/libavcodec/ppc/mpegvideo_altivec.c @@ -35,7 +35,7 @@ /* AltiVec version of dct_unquantize_h263 this code assumes `block' is 16 bytes-aligned */ static void dct_unquantize_h263_altivec(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { int i, level, qmul, qadd; int nCoeffs; diff --git a/libavcodec/ppc/vc1dsp_altivec.c b/libavcodec/ppc/vc1dsp_altivec.c index 33e87afc3a..c1a0055cf1 100644 --- a/libavcodec/ppc/vc1dsp_altivec.c +++ b/libavcodec/ppc/vc1dsp_altivec.c @@ -129,7 +129,7 @@ do { \ /** Do inverse transform on 8x8 block */ -static void vc1_inv_trans_8x8_altivec(DCTELEM block[64]) +static void vc1_inv_trans_8x8_altivec(int16_t block[64]) { vector signed short src0, src1, src2, src3, src4, src5, src6, src7; vector signed int s0, s1, s2, s3, s4, s5, s6, s7; @@ -224,7 +224,7 @@ static void vc1_inv_trans_8x8_altivec(DCTELEM block[64]) /** Do inverse transform on 8x4 part of block */ -static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, DCTELEM *block) +static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block) { vector signed short src0, src1, src2, src3, src4, src5, src6, src7; vector signed int s0, s1, s2, s3, s4, s5, s6, s7; diff --git a/libavcodec/ppc/vp3dsp_altivec.c b/libavcodec/ppc/vp3dsp_altivec.c index 6271dea560..54e291e483 100644 --- a/libavcodec/ppc/vp3dsp_altivec.c +++ b/libavcodec/ppc/vp3dsp_altivec.c @@ -116,7 +116,7 @@ static inline vec_s16 M16(vec_s16 a, vec_s16 C) #define ADD8(a) vec_add(a, eight) #define SHIFT4(a) vec_sra(a, four) -static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) +static void vp3_idct_put_altivec(uint8_t *dst, int stride, int16_t block[64]) { vec_u8 t; IDCT_START @@ -145,7 +145,7 @@ static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) memset(block, 0, sizeof(*block) * 64); } -static void vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]) +static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64]) { LOAD_ZERO; vec_u8 t, vdst; diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index 3b3175a41a..4634e704e2 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -294,10 +294,10 @@ static int decode_picture_header(AVCodecContext *avctx, const uint8_t *buf, cons static const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70}; -static av_always_inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, +static av_always_inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out, int blocks_per_slice) { - DCTELEM prev_dc; + int16_t prev_dc; int code, i, sign; OPEN_READER(re, gb); @@ -325,7 +325,7 @@ static const uint8_t run_to_cb[16] = { 0x06, 0x06, 0x05, 0x05, 0x04, 0x29, 0x29, static const uint8_t lev_to_cb[10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28, 0x28, 0x28, 0x4C }; static av_always_inline void decode_ac_coeffs(AVCodecContext *avctx, GetBitContext *gb, - DCTELEM *out, int blocks_per_slice) + int16_t *out, int blocks_per_slice) { ProresContext *ctx = avctx->priv_data; int block_mask, sign; @@ -372,8 +372,8 @@ static void decode_slice_luma(AVCodecContext *avctx, SliceContext *slice, const int16_t *qmat) { ProresContext *ctx = avctx->priv_data; - LOCAL_ALIGNED_16(DCTELEM, blocks, [8*4*64]); - DCTELEM *block; + LOCAL_ALIGNED_16(int16_t, blocks, [8*4*64]); + int16_t *block; GetBitContext gb; int i, blocks_per_slice = slice->mb_count<<2; @@ -402,8 +402,8 @@ static void decode_slice_chroma(AVCodecContext *avctx, SliceContext *slice, const int16_t *qmat, int log2_blocks_per_mb) { ProresContext *ctx = avctx->priv_data; - LOCAL_ALIGNED_16(DCTELEM, blocks, [8*4*64]); - DCTELEM *block; + LOCAL_ALIGNED_16(int16_t, blocks, [8*4*64]); + int16_t *block; GetBitContext gb; int i, j, blocks_per_slice = slice->mb_count << log2_blocks_per_mb; diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index a25ecca3c9..5c53882ce3 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -34,6 +34,7 @@ #include "libavutil/intmath.h" #include "avcodec.h" +#include "dsputil.h" #include "internal.h" #include "proresdata.h" #include "proresdsp.h" @@ -45,7 +46,7 @@ typedef struct { int x_pos, y_pos; int slice_width; int prev_slice_sf; ///< scalefactor of the previous decoded slice - DECLARE_ALIGNED(16, DCTELEM, blocks)[8 * 4 * 64]; + DECLARE_ALIGNED(16, int16_t, blocks)[8 * 4 * 64]; DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; } ProresThreadData; @@ -340,10 +341,10 @@ static inline int decode_vlc_codeword(GetBitContext *gb, unsigned codebook) /** * Decode DC coefficients for all blocks in a slice. */ -static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, +static inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out, int nblocks) { - DCTELEM prev_dc; + int16_t prev_dc; int i, sign; int16_t delta; unsigned int code; @@ -368,7 +369,7 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, /** * Decode AC coefficients for all blocks in a slice. */ -static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out, +static inline void decode_ac_coeffs(GetBitContext *gb, int16_t *out, int blocks_per_slice, int plane_size_factor, const uint8_t *scan) @@ -421,7 +422,7 @@ static void decode_slice_plane(ProresContext *ctx, ProresThreadData *td, const int16_t *qmat, int is_chroma) { GetBitContext gb; - DCTELEM *block_ptr; + int16_t *block_ptr; int mb_num, blocks_per_slice; blocks_per_slice = mbs_per_slice * blocks_per_mb; diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c index 9e063b0974..dd6d72511e 100644 --- a/libavcodec/proresdsp.c +++ b/libavcodec/proresdsp.c @@ -20,6 +20,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "dsputil.h" #include "proresdsp.h" #include "simple_idct.h" #include "libavutil/common.h" @@ -34,7 +35,7 @@ /** * Add bias value, clamp and output pixels of a slice */ -static void put_pixels(uint16_t *dst, int stride, const DCTELEM *in) +static void put_pixels(uint16_t *dst, int stride, const int16_t *in) { int x, y, src_offset, dst_offset; @@ -47,7 +48,7 @@ static void put_pixels(uint16_t *dst, int stride, const DCTELEM *in) } } -static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat) +static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const int16_t *qmat) { ff_prores_idct(block, qmat); put_pixels(out, linesize >> 1, block); @@ -55,7 +56,7 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const #endif #if CONFIG_PRORES_KOSTYA_ENCODER -static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block) +static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block) { int x, y; const uint16_t *tsrc = src; diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h index 09541d9642..a9df91851f 100644 --- a/libavcodec/proresdsp.h +++ b/libavcodec/proresdsp.h @@ -23,7 +23,7 @@ #ifndef AVCODEC_PRORESDSP_H #define AVCODEC_PRORESDSP_H -#include "dsputil.h" +#include <stdint.h> #define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder @@ -32,8 +32,8 @@ typedef struct ProresDSPContext { uint8_t idct_permutation[64]; int dct_permutation_type; uint8_t dct_permutation[64]; - void (* idct_put) (uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat); - void (* fdct) (const uint16_t *src, int linesize, DCTELEM *block); + void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat); + void (* fdct) (const uint16_t *src, int linesize, int16_t *block); } ProresDSPContext; void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx); diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 8c71ca5aea..1e73757d73 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -198,7 +198,7 @@ static av_always_inline int get_level(int val) static const uint8_t dc_codebook[7] = { 0x04, 0x28, 0x28, 0x4D, 0x4D, 0x70, 0x70}; -static void encode_dc_coeffs(PutBitContext *pb, DCTELEM *in, +static void encode_dc_coeffs(PutBitContext *pb, int16_t *in, int blocks_per_slice, int *qmat) { int prev_dc, code; @@ -230,7 +230,7 @@ static const uint8_t lev_to_cb[10] = { 0x04, 0x0A, 0x05, 0x06, 0x04, 0x28, 0x28, 0x28, 0x28, 0x4C }; static void encode_ac_coeffs(AVCodecContext *avctx, PutBitContext *pb, - DCTELEM *in, int blocks_per_slice, int *qmat) + int16_t *in, int blocks_per_slice, int *qmat) { int prev_run = 4; int prev_level = 2; @@ -260,7 +260,7 @@ static void encode_ac_coeffs(AVCodecContext *avctx, PutBitContext *pb, } } -static void get(uint8_t *pixels, int stride, DCTELEM* block) +static void get(uint8_t *pixels, int stride, int16_t* block) { int16_t *p = (int16_t*)pixels; int i, j; @@ -275,7 +275,7 @@ static void get(uint8_t *pixels, int stride, DCTELEM* block) } } -static void fdct_get(uint8_t *pixels, int stride, DCTELEM* block) +static void fdct_get(uint8_t *pixels, int stride, int16_t* block) { get(pixels, stride, block); ff_jpeg_fdct_islow_10(block); @@ -285,7 +285,7 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count, uint8_t *src, int src_stride, uint8_t *buf, unsigned buf_size, int *qmat, int chroma) { - DECLARE_ALIGNED(16, DCTELEM, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block; + DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH << 8], *block; int i, blocks_per_slice; PutBitContext pb; diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 0462c74b13..8da13ac822 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -25,6 +25,7 @@ #include "libavutil/opt.h" #include "avcodec.h" +#include "dsputil.h" #include "put_bits.h" #include "bytestream.h" #include "internal.h" @@ -170,7 +171,7 @@ struct TrellisNode { #define MAX_STORED_Q 16 typedef struct ProresThreadData { - DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; + DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; DECLARE_ALIGNED(16, uint16_t, emu_buf)[16 * 16]; int16_t custom_q[64]; struct TrellisNode *nodes; @@ -178,7 +179,7 @@ typedef struct ProresThreadData { typedef struct ProresContext { AVClass *class; - DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; + DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16]; int16_t quants[MAX_STORED_Q][64]; int16_t custom_q[64]; @@ -213,7 +214,7 @@ typedef struct ProresContext { static void get_slice_data(ProresContext *ctx, const uint16_t *src, int linesize, int x, int y, int w, int h, - DCTELEM *blocks, uint16_t *emu_buf, + int16_t *blocks, uint16_t *emu_buf, int mbs_per_slice, int blocks_per_mb, int is_chroma) { const uint16_t *esrc; @@ -317,7 +318,7 @@ static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int #define GET_SIGN(x) ((x) >> 31) #define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x)) -static void encode_dcs(PutBitContext *pb, DCTELEM *blocks, +static void encode_dcs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, int scale) { int i; @@ -343,7 +344,7 @@ static void encode_dcs(PutBitContext *pb, DCTELEM *blocks, } } -static void encode_acs(PutBitContext *pb, DCTELEM *blocks, +static void encode_acs(PutBitContext *pb, int16_t *blocks, int blocks_per_slice, int plane_size_factor, const uint8_t *scan, const int16_t *qmat) @@ -379,7 +380,7 @@ static void encode_acs(PutBitContext *pb, DCTELEM *blocks, static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb, const uint16_t *src, int linesize, - int mbs_per_slice, DCTELEM *blocks, + int mbs_per_slice, int16_t *blocks, int blocks_per_mb, int plane_size_factor, const int16_t *qmat) { @@ -481,7 +482,7 @@ static inline int estimate_vlc(unsigned codebook, int val) } } -static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice, +static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice, int scale) { int i; @@ -512,7 +513,7 @@ static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice, return bits; } -static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice, +static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slice, int plane_size_factor, const uint8_t *scan, const int16_t *qmat) { diff --git a/libavcodec/rtjpeg.c b/libavcodec/rtjpeg.c index 7797a655c1..2bd4416fdf 100644 --- a/libavcodec/rtjpeg.c +++ b/libavcodec/rtjpeg.c @@ -44,7 +44,7 @@ * aligned this could be done faster in a different way, e.g. as it is done * in MPlayer libmpcodecs/native/rtjpegn.c. */ -static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, +static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *scan, const uint32_t *quant) { int coeff, i, n; int8_t ac; @@ -61,7 +61,7 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc // normally we would only need to clear the (63 - coeff) last values, // but since we do not know where they are we just clear the whole block - memset(block, 0, 64 * sizeof(DCTELEM)); + memset(block, 0, 64 * sizeof(int16_t)); // 2 bits per coefficient while (coeff) { @@ -121,7 +121,7 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, if (res > 0) \ c->dsp->idct_put(dst, stride, block); \ } while (0) - DCTELEM *block = c->block; + int16_t *block = c->block; BLOCK(c->lquant, y1, f->linesize[0]); y1 += 8; BLOCK(c->lquant, y1, f->linesize[0]); diff --git a/libavcodec/rtjpeg.h b/libavcodec/rtjpeg.h index 0fd24a356c..294b06c697 100644 --- a/libavcodec/rtjpeg.h +++ b/libavcodec/rtjpeg.h @@ -35,7 +35,7 @@ typedef struct RTJpegContext { uint8_t scan[64]; uint32_t lquant[64]; uint32_t cquant[64]; - DECLARE_ALIGNED(16, DCTELEM, block)[64]; + DECLARE_ALIGNED(16, int16_t, block)[64]; } RTJpegContext; void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 73b6cb78d9..7a9778a101 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -217,7 +217,7 @@ static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table) /** * Get one coefficient value from the bitstream and store it. */ -static inline void decode_coeff(DCTELEM *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q) +static inline void decode_coeff(int16_t *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q) { if(coef){ if(coef == esc){ @@ -237,7 +237,7 @@ static inline void decode_coeff(DCTELEM *dst, int coef, int esc, GetBitContext * /** * Decode 2x2 subblock of coefficients. */ -static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q) +static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q) { int flags = modulo_three_table[code]; @@ -255,13 +255,13 @@ static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, /** * Decode a single coefficient. */ -static inline void decode_subblock1(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, int q) +static inline void decode_subblock1(int16_t *dst, int code, GetBitContext *gb, VLC *vlc, int q) { int coeff = modulo_three_table[code] >> 6; decode_coeff(dst, coeff, 3, gb, vlc, q); } -static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, +static inline void decode_subblock3(int16_t *dst, int code, GetBitContext *gb, VLC *vlc, int q_dc, int q_ac1, int q_ac2) { int flags = modulo_three_table[code]; @@ -283,7 +283,7 @@ static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, V * o--o */ -static int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2) +static int rv34_decode_block(int16_t *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2) { int code, pattern, has_ac = 1; @@ -995,7 +995,7 @@ static inline void rv34_process_block(RV34DecContext *r, int fc, int sc, int q_dc, int q_ac) { MpegEncContext *s = &r->s; - DCTELEM *ptr = s->block[0]; + int16_t *ptr = s->block[0]; int has_ac = rv34_decode_block(ptr, &s->gb, r->cur_vlcs, fc, sc, q_dc, q_ac, q_ac); if(has_ac){ @@ -1008,13 +1008,13 @@ static inline void rv34_process_block(RV34DecContext *r, static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp) { - LOCAL_ALIGNED_16(DCTELEM, block16, [16]); + LOCAL_ALIGNED_16(int16_t, block16, [16]); MpegEncContext *s = &r->s; GetBitContext *gb = &s->gb; int q_dc = rv34_qscale_tab[ r->luma_dc_quant_i[s->qscale] ], q_ac = rv34_qscale_tab[s->qscale]; uint8_t *dst = s->dest[0]; - DCTELEM *ptr = s->block[0]; + int16_t *ptr = s->block[0]; int i, j, itype, has_ac; memset(block16, 0, 16 * sizeof(*block16)); @@ -1180,7 +1180,7 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) MpegEncContext *s = &r->s; GetBitContext *gb = &s->gb; uint8_t *dst = s->dest[0]; - DCTELEM *ptr = s->block[0]; + int16_t *ptr = s->block[0]; int mb_pos = s->mb_x + s->mb_y * s->mb_stride; int cbp, cbp2; int q_dc, q_ac, has_ac; @@ -1220,7 +1220,7 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) if(r->is16){ // Only for RV34_MB_P_MIX16x16 - LOCAL_ALIGNED_16(DCTELEM, block16, [16]); + LOCAL_ALIGNED_16(int16_t, block16, [16]); memset(block16, 0, 16 * sizeof(*block16)); q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ]; q_ac = rv34_qscale_tab[s->qscale]; diff --git a/libavcodec/rv34dsp.c b/libavcodec/rv34dsp.c index 86a2ffd58e..676e823787 100644 --- a/libavcodec/rv34dsp.c +++ b/libavcodec/rv34dsp.c @@ -33,7 +33,7 @@ * @{ */ -static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block) +static av_always_inline void rv34_row_transform(int temp[16], int16_t *block) { int i; @@ -54,12 +54,12 @@ static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block) * Real Video 3.0/4.0 inverse transform + sample reconstruction * Code is almost the same as in SVQ3, only scaling is different. */ -static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block){ +static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, int16_t *block){ int temp[16]; int i; rv34_row_transform(temp, block); - memset(block, 0, 16*sizeof(DCTELEM)); + memset(block, 0, 16*sizeof(int16_t)); for(i = 0; i < 4; i++){ const int z0 = 13*(temp[4*0+i] + temp[4*2+i]) + 0x200; @@ -82,7 +82,7 @@ static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block){ * Code is almost the same as rv34_inv_transform() * but final coefficients are multiplied by 1.5 and have no rounding. */ -static void rv34_inv_transform_noround_c(DCTELEM *block){ +static void rv34_inv_transform_noround_c(int16_t *block){ int temp[16]; int i; @@ -115,9 +115,9 @@ static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc) } } -static void rv34_inv_transform_dc_noround_c(DCTELEM *block) +static void rv34_inv_transform_dc_noround_c(int16_t *block) { - DCTELEM dc = (13 * 13 * 3 * block[0]) >> 11; + int16_t dc = (13 * 13 * 3 * block[0]) >> 11; int i, j; for (i = 0; i < 4; i++, block += 4) diff --git a/libavcodec/rv34dsp.h b/libavcodec/rv34dsp.h index f0263b12fe..e04a47d35d 100644 --- a/libavcodec/rv34dsp.h +++ b/libavcodec/rv34dsp.h @@ -34,9 +34,9 @@ typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/, uint8_t *src2/*align width (8 or 16)*/, int w1, int w2, ptrdiff_t stride); -typedef void (*rv34_inv_transform_func)(DCTELEM *block); +typedef void (*rv34_inv_transform_func)(int16_t *block); -typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); +typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block); typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride, int dc); diff --git a/libavcodec/sh4/dsputil_sh4.c b/libavcodec/sh4/dsputil_sh4.c index 7deab41d62..5296bcf1b7 100644 --- a/libavcodec/sh4/dsputil_sh4.c +++ b/libavcodec/sh4/dsputil_sh4.c @@ -47,12 +47,12 @@ static void memzero_align8(void *dst,size_t size) fp_single_leave(fpscr); } -static void clear_blocks_sh4(DCTELEM *blocks) +static void clear_blocks_sh4(int16_t *blocks) { - memzero_align8(blocks,sizeof(DCTELEM)*6*64); + memzero_align8(blocks,sizeof(int16_t)*6*64); } -static void idct_put(uint8_t *dest, int line_size, DCTELEM *block) +static void idct_put(uint8_t *dest, int line_size, int16_t *block) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; @@ -70,7 +70,7 @@ static void idct_put(uint8_t *dest, int line_size, DCTELEM *block) block+=8; } } -static void idct_add(uint8_t *dest, int line_size, DCTELEM *block) +static void idct_add(uint8_t *dest, int line_size, int16_t *block) { int i; uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; diff --git a/libavcodec/sh4/dsputil_sh4.h b/libavcodec/sh4/dsputil_sh4.h index f2cb11e378..1c041ae27d 100644 --- a/libavcodec/sh4/dsputil_sh4.h +++ b/libavcodec/sh4/dsputil_sh4.h @@ -22,7 +22,7 @@ #include "libavcodec/avcodec.h" #include "libavcodec/dsputil.h" -void ff_idct_sh4(DCTELEM *block); +void ff_idct_sh4(int16_t *block); void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx); #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */ diff --git a/libavcodec/sh4/idct_sh4.c b/libavcodec/sh4/idct_sh4.c index e54c330857..654a167710 100644 --- a/libavcodec/sh4/idct_sh4.c +++ b/libavcodec/sh4/idct_sh4.c @@ -89,7 +89,7 @@ static const float odd_table[] __attribute__ ((aligned(8))) = { //optimized -void ff_idct_sh4(DCTELEM *block) +void ff_idct_sh4(int16_t *block) { DEFREG; diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c index 293185074b..2cbe568c20 100644 --- a/libavcodec/simple_idct.c +++ b/libavcodec/simple_idct.c @@ -50,7 +50,7 @@ and the butterfly must be multiplied by 0.5 * sqrt(2.0) */ #define C_SHIFT (4+1+12) -static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col) +static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col) { int c0, c1, c2, c3, a0, a1, a2, a3; @@ -86,10 +86,10 @@ static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col /* XXX: I think a 1.0/sqrt(2) normalization should be needed to compensate the extra butterfly stage - I don't have the full DV specification */ -void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block) { int i; - DCTELEM *ptr; + int16_t *ptr; /* butterfly */ ptr = block; @@ -129,7 +129,7 @@ void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block) #define C2 C_FIX(0.2705980501) #define C3 C_FIX(0.5) #define C_SHIFT (4+1+12) -static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col) +static inline void idct4col_add(uint8_t *dest, int line_size, const int16_t *col) { int c0, c1, c2, c3, a0, a1, a2, a3; @@ -156,7 +156,7 @@ static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col #define R2 R_FIX(0.2705980501) #define R3 R_FIX(0.5) #define R_SHIFT 11 -static inline void idct4row(DCTELEM *row) +static inline void idct4row(int16_t *row) { int c0, c1, c2, c3, a0, a1, a2, a3; @@ -174,7 +174,7 @@ static inline void idct4row(DCTELEM *row) row[3]= (c0 - c1) >> R_SHIFT; } -void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block) { int i; @@ -189,7 +189,7 @@ void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) } } -void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block) { int i; @@ -204,7 +204,7 @@ void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block) } } -void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block) { int i; @@ -219,7 +219,7 @@ void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block) } } -void ff_prores_idct(DCTELEM *block, const int16_t *qmat) +void ff_prores_idct(int16_t *block, const int16_t *qmat) { int i; diff --git a/libavcodec/simple_idct.h b/libavcodec/simple_idct.h index 64d3c2ac31..3fec5e0087 100644 --- a/libavcodec/simple_idct.h +++ b/libavcodec/simple_idct.h @@ -29,30 +29,29 @@ #define AVCODEC_SIMPLE_IDCT_H #include <stdint.h> -#include "dsputil.h" -void ff_simple_idct_put_8(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct_add_8(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct_8(DCTELEM *block); +void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_8(int16_t *block); -void ff_simple_idct_put_10(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct_add_10(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct_10(DCTELEM *block); +void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct_10(int16_t *block); /** * Special version of ff_simple_idct_10() which does dequantization * and scales by a factor of 2 more between the two IDCTs to account * for larger scale of input coefficients. */ -void ff_prores_idct(DCTELEM *block, const int16_t *qmat); +void ff_prores_idct(int16_t *block, const int16_t *qmat); void ff_simple_idct_mmx(int16_t *block); void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block); +void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block); -void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block); -void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block); +void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block); +void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block); #endif /* AVCODEC_SIMPLE_IDCT_H */ diff --git a/libavcodec/simple_idct_template.c b/libavcodec/simple_idct_template.c index b67893c2b2..dabfbda8a0 100644 --- a/libavcodec/simple_idct_template.c +++ b/libavcodec/simple_idct_template.c @@ -85,7 +85,7 @@ #endif -static inline void FUNC(idctRowCondDC)(DCTELEM *row, int extra_shift) +static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -221,7 +221,7 @@ static inline void FUNC(idctRowCondDC)(DCTELEM *row, int extra_shift) } while (0) static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, - DCTELEM *col) + int16_t *col) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -245,7 +245,7 @@ static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, } static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, - DCTELEM *col) + int16_t *col) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -268,7 +268,7 @@ static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, dest[0] = av_clip_pixel(dest[0] + ((a0 - b0) >> COL_SHIFT)); } -static inline void FUNC(idctSparseCol)(DCTELEM *col) +static inline void FUNC(idctSparseCol)(int16_t *col) { int a0, a1, a2, a3, b0, b1, b2, b3; @@ -284,7 +284,7 @@ static inline void FUNC(idctSparseCol)(DCTELEM *col) col[56] = ((a0 - b0) >> COL_SHIFT); } -void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block) +void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block) { pixel *dest = (pixel *)dest_; int i; @@ -298,7 +298,7 @@ void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block) FUNC(idctSparseColPut)(dest + i, line_size, block + i); } -void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block) +void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, int16_t *block) { pixel *dest = (pixel *)dest_; int i; @@ -312,7 +312,7 @@ void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block) FUNC(idctSparseColAdd)(dest + i, line_size, block + i); } -void FUNC(ff_simple_idct)(DCTELEM *block) +void FUNC(ff_simple_idct)(int16_t *block) { int i; diff --git a/libavcodec/sparc/dsputil_vis.h b/libavcodec/sparc/dsputil_vis.h index e1cbcb49e3..d7e2e63ab9 100644 --- a/libavcodec/sparc/dsputil_vis.h +++ b/libavcodec/sparc/dsputil_vis.h @@ -20,10 +20,9 @@ #define AVCODEC_SPARC_DSPUTIL_VIS_H #include <stdint.h> -#include "libavcodec/dsputil.h" -void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data); -void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data); -void ff_simple_idct_vis(DCTELEM *data); +void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data); +void ff_simple_idct_vis(int16_t *data); #endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */ diff --git a/libavcodec/sparc/simple_idct_vis.c b/libavcodec/sparc/simple_idct_vis.c index 45ca010588..46345a6b25 100644 --- a/libavcodec/sparc/simple_idct_vis.c +++ b/libavcodec/sparc/simple_idct_vis.c @@ -388,7 +388,7 @@ static const DECLARE_ALIGNED(8, uint16_t, expand)[4] = { "st %%f14, [%12+" dest "] \n\t"\ -void ff_simple_idct_vis(DCTELEM *data) { +void ff_simple_idct_vis(int16_t *data) { int out1, out2, out3, out4; DECLARE_ALIGNED(8, int16_t, temp)[8*8]; @@ -428,7 +428,7 @@ void ff_simple_idct_vis(DCTELEM *data) { ); } -void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data) { +void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data) { int out1, out2, out3, out4, out5; int r1, r2, r3, r4, r5, r6, r7; @@ -478,7 +478,7 @@ void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data) { ); } -void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data) { +void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data) { int out1, out2, out3, out4, out5, out6; int r1, r2, r3, r4, r5, r6, r7; diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index c12c75f51b..05832bfb56 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -139,7 +139,7 @@ static const uint32_t svq3_dequant_coeff[32] = { 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533 }; -void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) +void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) { const int qmul = svq3_dequant_coeff[qp]; #define stride 16 @@ -174,7 +174,7 @@ void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) } #undef stride -void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, +void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc) { const int qmul = svq3_dequant_coeff[qp]; @@ -212,7 +212,7 @@ void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, } } -static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block, +static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, int index, const int type) { static const uint8_t *const scan_patterns[4] = diff --git a/libavcodec/vc1.h b/libavcodec/vc1.h index 4ed8923469..e32a507a65 100644 --- a/libavcodec/vc1.h +++ b/libavcodec/vc1.h @@ -384,7 +384,7 @@ typedef struct VC1Context{ int bi_type; int x8_type; - DCTELEM (*block)[6][64]; + int16_t (*block)[6][64]; int n_allocated_blks, cur_blk_idx, left_blk_idx, topleft_blk_idx, top_blk_idx; uint32_t *cbp_base, *cbp; uint8_t *is_intra_base, *is_intra; diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index e0d3d7a200..ee485427aa 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -2556,7 +2556,7 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, * @param coded are AC coeffs present or not * @param codingset set of VLC to decode data */ -static int vc1_decode_i_block(VC1Context *v, DCTELEM block[64], int n, +static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, int coded, int codingset) { GetBitContext *gb = &v->s.gb; @@ -2719,7 +2719,7 @@ not_coded: * @param codingset set of VLC to decode data * @param mquant quantizer value for this macroblock */ -static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, +static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, int coded, int codingset, int mquant) { GetBitContext *gb = &v->s.gb; @@ -2931,7 +2931,7 @@ static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, * @param mquant block quantizer * @param codingset set of VLC to decode data */ -static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, +static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, int coded, int mquant, int codingset) { GetBitContext *gb = &v->s.gb; @@ -3141,7 +3141,7 @@ static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, /** Decode P block */ -static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n, +static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n, int mquant, int ttmb, int first_block, uint8_t *dst, int linesize, int skip_block, int *ttmb_out) @@ -4523,7 +4523,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) s->mb_x = 0; ff_init_block_index(s); for (;s->mb_x < s->mb_width; s->mb_x++) { - DCTELEM (*block)[64] = v->block[v->cur_blk_idx]; + int16_t (*block)[64] = v->block[v->cur_blk_idx]; ff_update_block_index(s); s->dsp.clear_blocks(block[0]); mb_pos = s->mb_x + s->mb_y * s->mb_stride; diff --git a/libavcodec/vc1dsp.c b/libavcodec/vc1dsp.c index 6963736578..9ddd7c7b96 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -80,7 +80,7 @@ static void vc1_h_overlap_c(uint8_t* src, int stride) } } -static void vc1_v_s_overlap_c(DCTELEM *top, DCTELEM *bottom) +static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom) { int i; int a, b, c, d; @@ -106,7 +106,7 @@ static void vc1_v_s_overlap_c(DCTELEM *top, DCTELEM *bottom) } } -static void vc1_h_s_overlap_c(DCTELEM *left, DCTELEM *right) +static void vc1_h_s_overlap_c(int16_t *left, int16_t *right) { int i; int a, b, c, d; @@ -230,7 +230,7 @@ static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq) /** Do inverse transform on 8x8 block */ -static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block) { int i; int dc = block[0]; @@ -249,11 +249,11 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) } } -static void vc1_inv_trans_8x8_c(DCTELEM block[64]) +static void vc1_inv_trans_8x8_c(int16_t block[64]) { int i; register int t1,t2,t3,t4,t5,t6,t7,t8; - DCTELEM *src, *dst, temp[64]; + int16_t *src, *dst, temp[64]; src = block; dst = temp; @@ -320,7 +320,7 @@ static void vc1_inv_trans_8x8_c(DCTELEM block[64]) /** Do inverse transform on 8x4 part of block */ -static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block) { int i; int dc = block[0]; @@ -339,11 +339,11 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) } } -static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block) { int i; register int t1,t2,t3,t4,t5,t6,t7,t8; - DCTELEM *src, *dst; + int16_t *src, *dst; src = block; dst = block; @@ -395,7 +395,7 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) /** Do inverse transform on 4x8 parts of block */ -static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block) { int i; int dc = block[0]; @@ -410,11 +410,11 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) } } -static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block) { int i; register int t1,t2,t3,t4,t5,t6,t7,t8; - DCTELEM *src, *dst; + int16_t *src, *dst; src = block; dst = block; @@ -466,7 +466,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) /** Do inverse transform on 4x4 part of block */ -static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block) { int i; int dc = block[0]; @@ -481,11 +481,11 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) } } -static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block) +static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block) { int i; register int t1,t2,t3,t4; - DCTELEM *src, *dst; + int16_t *src, *dst; src = block; dst = block; diff --git a/libavcodec/vc1dsp.h b/libavcodec/vc1dsp.h index 877581861f..901e46abc9 100644 --- a/libavcodec/vc1dsp.h +++ b/libavcodec/vc1dsp.h @@ -32,18 +32,18 @@ typedef struct VC1DSPContext { /* vc1 functions */ - void (*vc1_inv_trans_8x8)(DCTELEM *b); - void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, DCTELEM *block); - void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, DCTELEM *block); + void (*vc1_inv_trans_8x8)(int16_t *b); + void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, int16_t *block); + void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, int16_t *block); void (*vc1_v_overlap)(uint8_t *src, int stride); void (*vc1_h_overlap)(uint8_t *src, int stride); - void (*vc1_v_s_overlap)(DCTELEM *top, DCTELEM *bottom); - void (*vc1_h_s_overlap)(DCTELEM *left, DCTELEM *right); + void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom); + void (*vc1_h_s_overlap)(int16_t *left, int16_t *right); void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq); void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq); void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq); diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 11436e5772..792dbb2a61 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -142,7 +142,7 @@ typedef struct Vp3DecodeContext { DSPContext dsp; VideoDSPContext vdsp; VP3DSPContext vp3dsp; - DECLARE_ALIGNED(16, DCTELEM, block)[64]; + DECLARE_ALIGNED(16, int16_t, block)[64]; int flipped_image; int last_slice_end; int skip_loop_filter; @@ -926,7 +926,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, int i, j = 0; int token; int zero_run = 0; - DCTELEM coeff = 0; + int16_t coeff = 0; int bits_to_get; int blocks_ended; int coeff_i = 0; @@ -1356,7 +1356,7 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int ye * for the next block in coding order */ static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, - int plane, int inter, DCTELEM block[64]) + int plane, int inter, int16_t block[64]) { int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; uint8_t *perm = s->scantable.permutated; @@ -1465,7 +1465,7 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int static void render_slice(Vp3DecodeContext *s, int slice) { int x, y, i, j, fragment; - DCTELEM *block = s->block; + int16_t *block = s->block; int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; int motion_halfpel_index; uint8_t *motion_source; diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c index df39007649..2c22130642 100644 --- a/libavcodec/vp3dsp.c +++ b/libavcodec/vp3dsp.c @@ -213,18 +213,23 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int } } -static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ +static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, + int16_t *block/*align 16*/) +{ idct(dest, line_size, block, 1); memset(block, 0, sizeof(*block) * 64); } -static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ +static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, + int16_t *block/*align 16*/) +{ idct(dest, line_size, block, 2); memset(block, 0, sizeof(*block) * 64); } static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, - DCTELEM *block/*align 16*/){ + int16_t *block/*align 16*/) +{ int i, dc = (block[0] + 15) >> 5; for(i = 0; i < 8; i++){ diff --git a/libavcodec/vp3dsp.h b/libavcodec/vp3dsp.h index 35bd95c684..8ffecca780 100644 --- a/libavcodec/vp3dsp.h +++ b/libavcodec/vp3dsp.h @@ -21,7 +21,6 @@ #include <stddef.h> #include <stdint.h> -#include "dsputil.h" typedef struct VP3DSPContext { /** @@ -39,9 +38,9 @@ typedef struct VP3DSPContext { const uint8_t *b, ptrdiff_t stride, int h); - void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); - void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block); - void (*idct_dc_add)(uint8_t *dest, int line_size, DCTELEM *block); + void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); + void (*idct_add)(uint8_t *dest, int line_size, int16_t *block); + void (*idct_dc_add)(uint8_t *dest, int line_size, int16_t *block); void (*v_loop_filter)(uint8_t *src, int stride, int *bounding_values); void (*h_loop_filter)(uint8_t *src, int stride, int *bounding_values); diff --git a/libavcodec/vp56.h b/libavcodec/vp56.h index 3f0c647432..223a202a03 100644 --- a/libavcodec/vp56.h +++ b/libavcodec/vp56.h @@ -67,7 +67,7 @@ typedef struct VP56RangeCoder { typedef struct VP56RefDc { uint8_t not_null_dc; VP56Frame ref_frame; - DCTELEM dc_coeff; + int16_t dc_coeff; } VP56RefDc; typedef struct VP56Macroblock { @@ -125,12 +125,12 @@ struct vp56_context { VP56RefDc *above_blocks; VP56RefDc left_block[4]; int above_block_idx[6]; - DCTELEM prev_dc[3][3]; /* [plan][ref_frame] */ + int16_t prev_dc[3][3]; /* [plan][ref_frame] */ /* blocks / macroblock */ VP56mb mb_type; VP56Macroblock *macroblocks; - DECLARE_ALIGNED(16, DCTELEM, block_coeff)[6][64]; + DECLARE_ALIGNED(16, int16_t, block_coeff)[6][64]; /* motion vectors */ VP56mv mv[6]; /* vectors for each block in MB */ diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index a851fbcf07..fc6fd3728f 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -761,7 +761,7 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, * @return 0 if no coeffs were decoded * otherwise, the index of the last coeff decoded plus one */ -static int decode_block_coeffs_internal(VP56RangeCoder *r, DCTELEM block[16], +static int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS-1], int i, uint8_t *token_prob, int16_t qmul[2]) { @@ -829,7 +829,7 @@ skip_eob: * otherwise, the index of the last coeff decoded plus one */ static av_always_inline -int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16], +int decode_block_coeffs(VP56RangeCoder *c, int16_t block[16], uint8_t probs[16][3][NUM_DCT_TOKENS-1], int i, int zero_nhood, int16_t qmul[2]) { diff --git a/libavcodec/vp8.h b/libavcodec/vp8.h index dbbc751e17..19763907d7 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -96,8 +96,8 @@ typedef struct VP8Macroblock { } VP8Macroblock; typedef struct VP8ThreadData { - DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16]; - DECLARE_ALIGNED(16, DCTELEM, block_dc)[16]; + DECLARE_ALIGNED(16, int16_t, block)[6][4][16]; + DECLARE_ALIGNED(16, int16_t, block_dc)[16]; /** * This is the index plus one of the last non-zero coeff * for each of the blocks in the current macroblock. diff --git a/libavcodec/vp8dsp.c b/libavcodec/vp8dsp.c index a53643cd26..017278ebea 100644 --- a/libavcodec/vp8dsp.c +++ b/libavcodec/vp8dsp.c @@ -29,7 +29,7 @@ #include "libavutil/common.h" // TODO: Maybe add dequant -static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16]) +static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) { int i, t0, t1, t2, t3; @@ -62,7 +62,7 @@ static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16]) } } -static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16]) +static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) { int i, val = (dc[0] + 3) >> 3; dc[0] = 0; @@ -78,10 +78,10 @@ static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16]) #define MUL_20091(a) ((((a)*20091) >> 16) + (a)) #define MUL_35468(a) (((a)*35468) >> 16) -static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) +static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) { int i, t0, t1, t2, t3; - DCTELEM tmp[16]; + int16_t tmp[16]; for (i = 0; i < 4; i++) { t0 = block[0*4+i] + block[2*4+i]; @@ -113,7 +113,7 @@ static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) } } -static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) +static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) { int i, dc = (block[0] + 4) >> 3; block[0] = 0; @@ -127,7 +127,7 @@ static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) } } -static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride) +static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride) { vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride); vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride); @@ -135,7 +135,7 @@ static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t s vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride); } -static void vp8_idct_dc_add4y_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride) +static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride) { vp8_idct_dc_add_c(dst+ 0, block[0], stride); vp8_idct_dc_add_c(dst+ 4, block[1], stride); diff --git a/libavcodec/vp8dsp.h b/libavcodec/vp8dsp.h index c4b9aa1a22..6308ff46cf 100644 --- a/libavcodec/vp8dsp.h +++ b/libavcodec/vp8dsp.h @@ -27,20 +27,21 @@ #ifndef AVCODEC_VP8DSP_H #define AVCODEC_VP8DSP_H -#include "dsputil.h" +#include <stddef.h> +#include <stdint.h> typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride, uint8_t *src/*align 1*/, ptrdiff_t srcStride, int h, int x, int y); typedef struct VP8DSPContext { - void (*vp8_luma_dc_wht)(DCTELEM block[4][4][16], DCTELEM dc[16]); - void (*vp8_luma_dc_wht_dc)(DCTELEM block[4][4][16], DCTELEM dc[16]); - void (*vp8_idct_add)(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); - void (*vp8_idct_dc_add)(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); - void (*vp8_idct_dc_add4y)(uint8_t *dst, DCTELEM block[4][16], + void (*vp8_luma_dc_wht)(int16_t block[4][4][16], int16_t dc[16]); + void (*vp8_luma_dc_wht_dc)(int16_t block[4][4][16], int16_t dc[16]); + void (*vp8_idct_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); + void (*vp8_idct_dc_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); + void (*vp8_idct_dc_add4y)(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); - void (*vp8_idct_dc_add4uv)(uint8_t *dst, DCTELEM block[4][16], + void (*vp8_idct_dc_add4uv)(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); // loop filter applied to edges between macroblocks diff --git a/libavcodec/wmv2.c b/libavcodec/wmv2.c index fc82cb2723..9c94498bf1 100644 --- a/libavcodec/wmv2.c +++ b/libavcodec/wmv2.c @@ -48,7 +48,7 @@ av_cold void ff_wmv2_common_init(Wmv2Context * w){ s->dsp.idct = NULL; } -static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ +static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int stride, int n){ MpegEncContext * const s= &w->s; if (s->block_last_index[n] >= 0) { @@ -72,7 +72,7 @@ static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int st } } -void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){ +void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){ Wmv2Context * const w= (Wmv2Context*)s; wmv2_add_block(w, block1[0], dest_y , s->linesize, 0); diff --git a/libavcodec/wmv2.h b/libavcodec/wmv2.h index fd7118776d..5ebfae7141 100644 --- a/libavcodec/wmv2.h +++ b/libavcodec/wmv2.h @@ -52,7 +52,7 @@ typedef struct Wmv2Context{ int hshift; ScanTable abt_scantable[2]; - DECLARE_ALIGNED(16, DCTELEM, abt_block2)[6][64]; + DECLARE_ALIGNED(16, int16_t, abt_block2)[6][64]; }Wmv2Context; void ff_wmv2_common_init(Wmv2Context * w); diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index dccdd54b6c..5c2df48d14 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -291,7 +291,7 @@ static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){ return mot_val; } -static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){ +static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp){ MpegEncContext * const s= &w->s; static const int sub_cbp_table[3]= {2,3,1}; int sub_cbp; @@ -331,7 +331,7 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, } -int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) +int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) { Wmv2Context * const w= (Wmv2Context*)s; int cbp, code, i; diff --git a/libavcodec/wmv2dsp.c b/libavcodec/wmv2dsp.c index 8e8b006d79..9627442b37 100644 --- a/libavcodec/wmv2dsp.c +++ b/libavcodec/wmv2dsp.c @@ -19,6 +19,7 @@ #include "libavutil/attributes.h" #include "libavutil/common.h" #include "avcodec.h" +#include "dsputil.h" #include "wmv2dsp.h" #define W0 2048 @@ -91,7 +92,7 @@ static void wmv2_idct_col(short * b) b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14; } -static void wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block) +static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block) { int i; @@ -114,7 +115,7 @@ static void wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block) } } -static void wmv2_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block) +static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block) { int i; diff --git a/libavcodec/wmv2dsp.h b/libavcodec/wmv2dsp.h index 242389bdeb..37bee205aa 100644 --- a/libavcodec/wmv2dsp.h +++ b/libavcodec/wmv2dsp.h @@ -20,11 +20,10 @@ #define AVCODEC_WMV2DSP_H #include <stdint.h> -#include "dsputil.h" typedef struct WMV2DSPContext { - void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block); - void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); + void (*idct_add)(uint8_t *dest, int line_size, int16_t *block); + void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); int idct_perm; } WMV2DSPContext; diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index e5f3752145..7ec32c60b5 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -152,7 +152,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) * useless M$ crap features. It is duplicated here in case someone wants * to add support for these crap features. */ void ff_wmv2_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { Wmv2Context * const w= (Wmv2Context*)s; diff --git a/libavcodec/x86/dnxhdenc.c b/libavcodec/x86/dnxhdenc.c index b2ba894bf3..98b8b17e16 100644 --- a/libavcodec/x86/dnxhdenc.c +++ b/libavcodec/x86/dnxhdenc.c @@ -26,7 +26,7 @@ #if HAVE_SSE2_INLINE -static void get_pixels_8x4_sym_sse2(DCTELEM *block, const uint8_t *pixels, int line_size) +static void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, int line_size) { __asm__ volatile( "pxor %%xmm5, %%xmm5 \n\t" diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 858eb90773..2bbe7ff9d3 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -226,10 +226,10 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 }; /***********************************/ /* standard MMX */ -void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, +void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size) { - const DCTELEM *p; + const int16_t *p; uint8_t *pix; /* read the pixels */ @@ -301,7 +301,7 @@ void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, "movq %%mm3, (%0, %3, 2) \n\t" \ "movq %%mm4, (%0, %1) \n\t" -void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, +void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size) { x86_reg line_skip = line_size; @@ -318,10 +318,10 @@ void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, : "memory"); } -void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, +void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size) { - const DCTELEM *p; + const int16_t *p; uint8_t *pix; int i; @@ -423,7 +423,7 @@ static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, } #define CLEAR_BLOCKS(name, n) \ -static void name(DCTELEM *blocks) \ +static void name(int16_t *blocks) \ { \ __asm__ volatile ( \ "pxor %%mm7, %%mm7 \n\t" \ @@ -443,7 +443,7 @@ static void name(DCTELEM *blocks) \ CLEAR_BLOCKS(clear_blocks_mmx, 6) CLEAR_BLOCKS(clear_block_mmx, 1) -static void clear_block_sse(DCTELEM *block) +static void clear_block_sse(int16_t *block) { __asm__ volatile ( "xorps %%xmm0, %%xmm0 \n" @@ -460,7 +460,7 @@ static void clear_block_sse(DCTELEM *block) ); } -static void clear_blocks_sse(DCTELEM *blocks) +static void clear_blocks_sse(int16_t *blocks) { __asm__ volatile ( "xorps %%xmm0, %%xmm0 \n" @@ -1882,28 +1882,28 @@ void ff_avg_dirac_pixels32_sse2(uint8_t *dst, const uint8_t *src[5], int stride, * converted. */ #if CONFIG_GPL static void ff_libmpeg2mmx_idct_put(uint8_t *dest, int line_size, - DCTELEM *block) + int16_t *block) { ff_mmx_idct(block); ff_put_pixels_clamped_mmx(block, dest, line_size); } static void ff_libmpeg2mmx_idct_add(uint8_t *dest, int line_size, - DCTELEM *block) + int16_t *block) { ff_mmx_idct(block); ff_add_pixels_clamped_mmx(block, dest, line_size); } static void ff_libmpeg2mmx2_idct_put(uint8_t *dest, int line_size, - DCTELEM *block) + int16_t *block) { ff_mmxext_idct(block); ff_put_pixels_clamped_mmx(block, dest, line_size); } static void ff_libmpeg2mmx2_idct_add(uint8_t *dest, int line_size, - DCTELEM *block) + int16_t *block) { ff_mmxext_idct(block); ff_add_pixels_clamped_mmx(block, dest, line_size); diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index a0a44c1275..033a175a15 100644 --- a/libavcodec/x86/dsputil_mmx.h +++ b/libavcodec/x86/dsputil_mmx.h @@ -83,9 +83,9 @@ extern const double ff_pd_2[2]; void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); -void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); -void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); -void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); +void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); +void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); +void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); @@ -100,8 +100,8 @@ void ff_put_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, int line_size) void ff_avg_rv40_qpel8_mc33_mmx(uint8_t *block, uint8_t *pixels, int line_size); void ff_avg_rv40_qpel16_mc33_mmx(uint8_t *block, uint8_t *pixels, int line_size); -void ff_mmx_idct(DCTELEM *block); -void ff_mmxext_idct(DCTELEM *block); +void ff_mmx_idct(int16_t *block); +void ff_mmxext_idct(int16_t *block); void ff_deinterlace_line_mmx(uint8_t *dst, diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm index 55eacf5b96..1839bee24a 100644 --- a/libavcodec/x86/dsputilenc.asm +++ b/libavcodec/x86/dsputilenc.asm @@ -335,7 +335,7 @@ cglobal sse16, 5, 5, 8 RET INIT_MMX mmx -; get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size) +; get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size) cglobal get_pixels, 3,4 movsxdifnidn r2, r2d add r0, 128 @@ -392,7 +392,7 @@ cglobal get_pixels, 3, 4 RET INIT_MMX mmx -; diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const unint8_t *s2, stride) +; diff_pixels_mmx(int16_t *block, const uint8_t *s1, const unint8_t *s2, stride) cglobal diff_pixels, 4,5 movsxdifnidn r3, r3d pxor m7, m7 diff --git a/libavcodec/x86/dsputilenc_mmx.c b/libavcodec/x86/dsputilenc_mmx.c index 8a50a26ce2..5ac3c1c10a 100644 --- a/libavcodec/x86/dsputilenc_mmx.c +++ b/libavcodec/x86/dsputilenc_mmx.c @@ -30,9 +30,9 @@ #include "libavcodec/mathops.h" #include "dsputil_mmx.h" -void ff_get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size); -void ff_get_pixels_sse2(DCTELEM *block, const uint8_t *pixels, int line_size); -void ff_diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride); +void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size); +void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, int line_size); +void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); int ff_pix_sum16_mmx(uint8_t * pix, int line_size); int ff_pix_norm1_mmx(uint8_t *pix, int line_size); @@ -798,7 +798,7 @@ static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1, HSUM(%%xmm0, %%xmm1, %0) #define DCT_SAD_FUNC(cpu) \ -static int sum_abs_dctelem_##cpu(DCTELEM *block){\ +static int sum_abs_dctelem_##cpu(int16_t *block){\ int sum;\ __asm__ volatile(\ DCT_SAD\ diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm index d0ac0fe16d..8fef7b8199 100644 --- a/libavcodec/x86/h264_idct.asm +++ b/libavcodec/x86/h264_idct.asm @@ -302,7 +302,7 @@ cglobal h264_idct8_dc_add_8, 3, 3, 0 INIT_MMX mmx ; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg xor r5, r5 %ifdef PIC @@ -324,7 +324,7 @@ cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, REP_RET ; ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg %assign pad 128+4-(stack_offset&7) SUB rsp, pad @@ -357,7 +357,7 @@ cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, INIT_MMX mmxext ; ff_h264_idct_add16_mmxext(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg xor r5, r5 %ifdef PIC @@ -402,7 +402,7 @@ cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride INIT_MMX mmx ; ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg xor r5, r5 %ifdef PIC @@ -426,7 +426,7 @@ cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, st INIT_MMX mmxext ; ff_h264_idct_add16intra_mmxext(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, +; int16_t *block, int stride, ; const uint8_t nnzc[6*8]) cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg xor r5, r5 @@ -469,7 +469,7 @@ cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, s REP_RET ; ff_h264_idct8_add4_mmxext(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, +; int16_t *block, int stride, ; const uint8_t nnzc[6*8]) cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg %assign pad 128+4-(stack_offset&7) @@ -530,7 +530,7 @@ cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride INIT_XMM sse2 ; ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg xor r5, r5 %ifdef PIC @@ -605,7 +605,7 @@ h264_idct_add8_mmx_plane: rep ret ; ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg mov r5, 16 add r2, 512 @@ -669,7 +669,7 @@ h264_idct_add8_mmxext_plane: INIT_MMX mmxext ; ff_h264_idct_add8_mmxext(uint8_t **dest, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg mov r5, 16 add r2, 512 @@ -746,7 +746,7 @@ h264_add8x4_idct_sse2: %endmacro ; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 %if ARCH_X86_64 mov r5, r0 @@ -793,7 +793,7 @@ cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 %endmacro ; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 %if ARCH_X86_64 mov r7, r0 @@ -844,7 +844,7 @@ cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 %endmacro ; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, -; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) +; int16_t *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8 add r2, 512 %if ARCH_X86_64 @@ -861,7 +861,7 @@ cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8 add8_sse2_cycle 3, 0x64 RET -;void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul) +;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul) %macro WALSH4_1D 5 SUMSUB_BADC w, %4, %3, %2, %1, %5 diff --git a/libavcodec/x86/h264_intrapred_init.c b/libavcodec/x86/h264_intrapred_init.c index deededaddb..015cc6ff19 100644 --- a/libavcodec/x86/h264_intrapred_init.c +++ b/libavcodec/x86/h264_intrapred_init.c @@ -20,6 +20,7 @@ #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" +#include "libavcodec/avcodec.h" #include "libavcodec/h264pred.h" #define PRED4x4(TYPE, DEPTH, OPT) \ diff --git a/libavcodec/x86/h264dsp_init.c b/libavcodec/x86/h264dsp_init.c index 65d300fe4d..a0c22eb186 100644 --- a/libavcodec/x86/h264dsp_init.c +++ b/libavcodec/x86/h264dsp_init.c @@ -48,7 +48,7 @@ IDCT_ADD_FUNC(8, 10, avx) #define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \ void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ (uint8_t *dst, const int *block_offset, \ - DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); + int16_t *block, int stride, const uint8_t nnzc[6 * 8]); IDCT_ADD_REP_FUNC(8, 4, 8, mmx) IDCT_ADD_REP_FUNC(8, 4, 8, mmxext) @@ -70,7 +70,7 @@ IDCT_ADD_REP_FUNC(, 16intra, 10, avx) #define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \ void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ (uint8_t **dst, const int *block_offset, \ - DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); + int16_t *block, int stride, const uint8_t nnzc[6 * 8]); IDCT_ADD_REP_FUNC2(, 8, 8, mmx) IDCT_ADD_REP_FUNC2(, 8, 8, mmxext) @@ -78,8 +78,8 @@ IDCT_ADD_REP_FUNC2(, 8, 8, sse2) IDCT_ADD_REP_FUNC2(, 8, 10, sse2) IDCT_ADD_REP_FUNC2(, 8, 10, avx) -void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul); -void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul); +void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul); +void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul); /***********************************/ /* deblocking */ diff --git a/libavcodec/x86/idct_mmx_xvid.c b/libavcodec/x86/idct_mmx_xvid.c index b62865e679..5e9f405452 100644 --- a/libavcodec/x86/idct_mmx_xvid.c +++ b/libavcodec/x86/idct_mmx_xvid.c @@ -531,25 +531,25 @@ __asm__ volatile( :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16)); } -void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block) +void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block) { ff_idct_xvid_mmx(block); ff_put_pixels_clamped_mmx(block, dest, line_size); } -void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block) +void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block) { ff_idct_xvid_mmx(block); ff_add_pixels_clamped_mmx(block, dest, line_size); } -void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block) +void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block) { ff_idct_xvid_mmxext(block); ff_put_pixels_clamped_mmx(block, dest, line_size); } -void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block) +void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block) { ff_idct_xvid_mmxext(block); ff_add_pixels_clamped_mmx(block, dest, line_size); diff --git a/libavcodec/x86/idct_xvid.h b/libavcodec/x86/idct_xvid.h index a584fba377..7a2847b864 100644 --- a/libavcodec/x86/idct_xvid.h +++ b/libavcodec/x86/idct_xvid.h @@ -28,15 +28,13 @@ #include <stdint.h> -#include "libavcodec/dsputil.h" - void ff_idct_xvid_mmx(short *block); -void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block); -void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block); +void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block); +void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block); void ff_idct_xvid_mmxext(short *block); -void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block); -void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block); +void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block); +void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block); void ff_idct_xvid_sse2(short *block); void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block); diff --git a/libavcodec/x86/mpegvideo.c b/libavcodec/x86/mpegvideo.c index 9870ed7d51..f4bf05ffdd 100644 --- a/libavcodec/x86/mpegvideo.c +++ b/libavcodec/x86/mpegvideo.c @@ -29,7 +29,7 @@ #if HAVE_INLINE_ASM static void dct_unquantize_h263_intra_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg level, qmul, qadd, nCoeffs; @@ -104,7 +104,7 @@ __asm__ volatile( static void dct_unquantize_h263_inter_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg qmul, qadd, nCoeffs; @@ -187,7 +187,7 @@ __asm__ volatile( high3 += tlow1 */ static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg nCoeffs; const uint16_t *quant_matrix; @@ -256,7 +256,7 @@ __asm__ volatile( } static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg nCoeffs; const uint16_t *quant_matrix; @@ -322,7 +322,7 @@ __asm__ volatile( } static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg nCoeffs; const uint16_t *quant_matrix; @@ -388,7 +388,7 @@ __asm__ volatile( } static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s, - DCTELEM *block, int n, int qscale) + int16_t *block, int n, int qscale) { x86_reg nCoeffs; const uint16_t *quant_matrix; @@ -464,7 +464,7 @@ __asm__ volatile( ); } -static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){ +static void denoise_dct_mmx(MpegEncContext *s, int16_t *block){ const int intra= s->mb_intra; int *sum= s->dct_error_sum[intra]; uint16_t *offset= s->dct_offset[intra]; @@ -518,7 +518,7 @@ static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){ ); } -static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ +static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){ const int intra= s->mb_intra; int *sum= s->dct_error_sum[intra]; uint16_t *offset= s->dct_offset[intra]; diff --git a/libavcodec/x86/mpegvideoenc_template.c b/libavcodec/x86/mpegvideoenc_template.c index 47c3b43f94..1e0505ea3c 100644 --- a/libavcodec/x86/mpegvideoenc_template.c +++ b/libavcodec/x86/mpegvideoenc_template.c @@ -92,7 +92,7 @@ #endif static int RENAME(dct_quantize)(MpegEncContext *s, - DCTELEM *block, int n, + int16_t *block, int n, int qscale, int *overflow) { x86_reg last_non_zero_p1; diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm index 094f872bc8..aedacc2cdc 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -232,7 +232,7 @@ section .text align=16 %endmacro ; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride, -; DCTELEM *block, const int16_t *qmat); +; int16_t *block, const int16_t *qmat); %macro idct_put_fn 1 cglobal prores_idct_put_10, 4, 4, %1 movsxd r1, r1d diff --git a/libavcodec/x86/proresdsp_init.c b/libavcodec/x86/proresdsp_init.c index 21ce0986d2..91ff257564 100644 --- a/libavcodec/x86/proresdsp_init.c +++ b/libavcodec/x86/proresdsp_init.c @@ -21,14 +21,15 @@ */ #include "libavutil/x86/cpu.h" +#include "libavcodec/dsputil.h" #include "libavcodec/proresdsp.h" void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, - DCTELEM *block, const int16_t *qmat); + int16_t *block, const int16_t *qmat); void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize, - DCTELEM *block, const int16_t *qmat); + int16_t *block, const int16_t *qmat); void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize, - DCTELEM *block, const int16_t *qmat); + int16_t *block, const int16_t *qmat); void ff_proresdsp_x86_init(ProresDSPContext *dsp, AVCodecContext *avctx) { diff --git a/libavcodec/x86/rv34dsp.asm b/libavcodec/x86/rv34dsp.asm index c099ac5b1f..4d9c35b600 100644 --- a/libavcodec/x86/rv34dsp.asm +++ b/libavcodec/x86/rv34dsp.asm @@ -133,7 +133,7 @@ cglobal rv34_idct_dc_add, 3, 3 mova mm5, [pd_512] ; 0x200 %endmacro -; ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); +; ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); %macro COL_TRANSFORM 4 pshufw mm3, %2, 0xDD ; col. 1,3,1,3 pshufw %2, %2, 0x88 ; col. 0,2,0,2 diff --git a/libavcodec/x86/rv34dsp_init.c b/libavcodec/x86/rv34dsp_init.c index 6b6cf914ea..a93096791b 100644 --- a/libavcodec/x86/rv34dsp_init.c +++ b/libavcodec/x86/rv34dsp_init.c @@ -25,11 +25,11 @@ #include "libavcodec/dsputil.h" #include "libavcodec/rv34dsp.h" -void ff_rv34_idct_dc_mmxext(DCTELEM *block); -void ff_rv34_idct_dc_noround_mmxext(DCTELEM *block); +void ff_rv34_idct_dc_mmxext(int16_t *block); +void ff_rv34_idct_dc_noround_mmxext(int16_t *block); void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc); void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc); -void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); +void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp) { diff --git a/libavcodec/x86/simple_idct.c b/libavcodec/x86/simple_idct.c index c514d755ee..f9fd7dc3c9 100644 --- a/libavcodec/x86/simple_idct.c +++ b/libavcodec/x86/simple_idct.c @@ -1154,12 +1154,12 @@ void ff_simple_idct_mmx(int16_t *block) //FIXME merge add/put into the idct -void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block) { idct(block); ff_put_pixels_clamped_mmx(block, dest, line_size); } -void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block) +void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block) { idct(block); ff_add_pixels_clamped_mmx(block, dest, line_size); diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c index 6ce65e4e16..a7695357d9 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -493,7 +493,7 @@ DECLARE_FUNCTION(3, 2) DECLARE_FUNCTION(3, 3) static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, - DCTELEM *block) + int16_t *block) { int dc = block[0]; dc = (17 * dc + 4) >> 3; @@ -532,7 +532,7 @@ static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, } static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, - DCTELEM *block) + int16_t *block) { int dc = block[0]; dc = (17 * dc + 4) >> 3; @@ -594,7 +594,7 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, } static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, - DCTELEM *block) + int16_t *block) { int dc = block[0]; dc = ( 3 * dc + 1) >> 1; @@ -633,7 +633,7 @@ static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, } static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize, - DCTELEM *block) + int16_t *block) { int dc = block[0]; dc = (3 * dc + 1) >> 1; diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c index e425f503ac..1df570ec0b 100644 --- a/libavcodec/x86/vp3dsp_init.c +++ b/libavcodec/x86/vp3dsp_init.c @@ -25,17 +25,18 @@ #include "libavutil/x86/cpu.h" #include "libavutil/x86/asm.h" #include "libavcodec/avcodec.h" +#include "libavcodec/dsputil.h" #include "libavcodec/vp3dsp.h" #include "config.h" -void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block); -void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block); +void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); +void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); -void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block); -void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block); +void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, int16_t *block); +void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, int16_t *block); void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size, - DCTELEM *block); + int16_t *block); void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride, int *bounding_values); diff --git a/libavcodec/x86/vp8dsp.asm b/libavcodec/x86/vp8dsp.asm index 84805fdc66..c5fb4555d3 100644 --- a/libavcodec/x86/vp8dsp.asm +++ b/libavcodec/x86/vp8dsp.asm @@ -899,7 +899,7 @@ cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height REP_RET ;----------------------------------------------------------------------------- -; void vp8_idct_dc_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride); +; void vp8_idct_dc_add_<opt>(uint8_t *dst, int16_t block[16], int stride); ;----------------------------------------------------------------------------- %macro ADD_DC 4 @@ -977,7 +977,7 @@ cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride RET ;----------------------------------------------------------------------------- -; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride); +; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, int16_t block[4][16], int stride); ;----------------------------------------------------------------------------- %if ARCH_X86_32 @@ -1050,7 +1050,7 @@ cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride RET ;----------------------------------------------------------------------------- -; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride); +; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, int16_t block[4][16], int stride); ;----------------------------------------------------------------------------- INIT_MMX mmx @@ -1092,7 +1092,7 @@ cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride RET ;----------------------------------------------------------------------------- -; void vp8_idct_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride); +; void vp8_idct_add_<opt>(uint8_t *dst, int16_t block[16], int stride); ;----------------------------------------------------------------------------- ; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2) @@ -1172,7 +1172,7 @@ INIT_MMX sse VP8_IDCT_ADD ;----------------------------------------------------------------------------- -; void vp8_luma_dc_wht_mmxext(DCTELEM block[4][4][16], DCTELEM dc[16]) +; void vp8_luma_dc_wht_mmxext(int16_t block[4][4][16], int16_t dc[16]) ;----------------------------------------------------------------------------- %macro SCATTER_WHT 3 diff --git a/libavcodec/x86/vp8dsp_init.c b/libavcodec/x86/vp8dsp_init.c index 735619c32b..09e2d9109e 100644 --- a/libavcodec/x86/vp8dsp_init.c +++ b/libavcodec/x86/vp8dsp_init.c @@ -230,21 +230,21 @@ HVBILIN(ssse3, 8, 4, 8) HVBILIN(ssse3, 8, 8, 16) HVBILIN(ssse3, 8, 16, 16) -extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16], +extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16], ptrdiff_t stride); -extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16], +extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16], ptrdiff_t stride); -extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16], +extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); -extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16], +extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); -extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16], +extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16], ptrdiff_t stride); -extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]); -extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]); -extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16], +extern void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]); +extern void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]); +extern void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16], ptrdiff_t stride); -extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16], +extern void ff_vp8_idct_add_sse(uint8_t *dst, int16_t block[16], ptrdiff_t stride); #define DECLARE_LOOP_FILTER(NAME)\ diff --git a/libavfilter/libmpcodecs/vf_fspp.c b/libavfilter/libmpcodecs/vf_fspp.c index 6f806b21c7..6090c9aeab 100644 --- a/libavfilter/libmpcodecs/vf_fspp.c +++ b/libavfilter/libmpcodecs/vf_fspp.c @@ -164,10 +164,10 @@ static void mul_thrmat_c(struct vf_priv_s *p,int q) ((short*)p->threshold_mtx)[a]=q * ((short*)p->threshold_mtx_noq)[a];//ints faster in C } -static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt); -static void row_idct_c(DCTELEM* workspace, +static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt); +static void row_idct_c(int16_t* workspace, int16_t* output_adr, int output_stride, int cnt); -static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt); +static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int cnt); //this is rather ugly, but there is no need for function pointers #define store_slice_s store_slice_c @@ -393,10 +393,10 @@ static void mul_thrmat_mmx(struct vf_priv_s *p, int q) ); } -static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt); -static void row_idct_mmx(DCTELEM* workspace, +static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt); +static void row_idct_mmx(int16_t* workspace, int16_t* output_adr, int output_stride, int cnt); -static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt); +static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt); #define store_slice_s store_slice_mmx #define store_slice2_s store_slice2_mmx @@ -416,8 +416,8 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, const int step=6-p->log2_count; const int qps= 3 + is_luma; int32_t __attribute__((aligned(32))) block_align[4*8*BLOCKSZ+ 4*8*BLOCKSZ]; - DCTELEM *block= (DCTELEM *)block_align; - DCTELEM *block3=(DCTELEM *)(block_align+4*8*BLOCKSZ); + int16_t *block= (int16_t *)block_align; + int16_t *block3=(int16_t *)(block_align+4*8*BLOCKSZ); memset(block3, 0, 4*8*BLOCKSZ); @@ -460,8 +460,8 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, column_fidct_s((int16_t*)(&p->threshold_mtx[0]), block+x*8, block3+x*8, 8); //yes, this is a HOTSPOT } row_idct_s(block3+0*8, p->temp + (y&15)*stride+x0+2-(y&1), stride, 2*(BLOCKSZ-1)); - memmove(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(DCTELEM)); //cycling - memmove(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(DCTELEM)); + memmove(block, block+(BLOCKSZ-1)*64, 8*8*sizeof(int16_t)); //cycling + memmove(block3, block3+(BLOCKSZ-1)*64, 6*8*sizeof(int16_t)); } // es=width+8-x0; // 8, ... @@ -694,7 +694,7 @@ const vf_info_t ff_vf_info_fspp = { //#define MANGLE(a) #a -//typedef int16_t DCTELEM; //! only int16_t +//typedef int16_t int16_t; //! only int16_t #define DCTSIZE 8 #define DCTSIZE_S "8" @@ -745,15 +745,15 @@ static const int16_t FIX_1_082392200=FIX(1.082392200, 13); #if !HAVE_MMX -static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt) +static void column_fidct_c(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt) { int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int_simd16_t tmp10, tmp11, tmp12, tmp13; int_simd16_t z1,z2,z3,z4,z5, z10, z11, z12, z13; int_simd16_t d0, d1, d2, d3, d4, d5, d6, d7; - DCTELEM* dataptr; - DCTELEM* wsptr; + int16_t* dataptr; + int16_t* wsptr; int16_t *threshold; int ctr; @@ -870,7 +870,7 @@ static void column_fidct_c(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int #else /* HAVE_MMX */ -static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, int cnt) +static void column_fidct_mmx(int16_t* thr_adr, int16_t *data, int16_t *output, int cnt) { uint64_t __attribute__((aligned(8))) temps[4]; __asm__ volatile( @@ -1605,14 +1605,14 @@ static void column_fidct_mmx(int16_t* thr_adr, DCTELEM *data, DCTELEM *output, #if !HAVE_MMX -static void row_idct_c(DCTELEM* workspace, +static void row_idct_c(int16_t* workspace, int16_t* output_adr, int output_stride, int cnt) { int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int_simd16_t tmp10, tmp11, tmp12, tmp13; int_simd16_t z5, z10, z11, z12, z13; int16_t* outptr; - DCTELEM* wsptr; + int16_t* wsptr; cnt*=4; wsptr = workspace; @@ -1670,7 +1670,7 @@ static void row_idct_c(DCTELEM* workspace, #else /* HAVE_MMX */ -static void row_idct_mmx (DCTELEM* workspace, +static void row_idct_mmx (int16_t* workspace, int16_t* output_adr, int output_stride, int cnt) { uint64_t __attribute__((aligned(8))) temps[4]; @@ -1874,12 +1874,12 @@ static void row_idct_mmx (DCTELEM* workspace, #if !HAVE_MMX -static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt) +static void row_fdct_c(int16_t *data, const uint8_t *pixels, int line_size, int cnt) { int_simd16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; int_simd16_t tmp10, tmp11, tmp12, tmp13; int_simd16_t z1, z2, z3, z4, z5, z11, z13; - DCTELEM *dataptr; + int16_t *dataptr; cnt*=4; // Pass 1: process rows. @@ -1937,7 +1937,7 @@ static void row_fdct_c(DCTELEM *data, const uint8_t *pixels, int line_size, int #else /* HAVE_MMX */ -static void row_fdct_mmx(DCTELEM *data, const uint8_t *pixels, int line_size, int cnt) +static void row_fdct_mmx(int16_t *data, const uint8_t *pixels, int line_size, int cnt) { uint64_t __attribute__((aligned(8))) temps[4]; __asm__ volatile( diff --git a/libavfilter/libmpcodecs/vf_pp7.c b/libavfilter/libmpcodecs/vf_pp7.c index 7f0e39d6ff..14bd863525 100644 --- a/libavfilter/libmpcodecs/vf_pp7.c +++ b/libavfilter/libmpcodecs/vf_pp7.c @@ -44,7 +44,7 @@ #define XMIN(a,b) ((a) < (b) ? (a) : (b)) #define XMAX(a,b) ((a) > (b) ? (a) : (b)) -typedef short DCTELEM; +typedef short int16_t; //===========================================================================// static const uint8_t __attribute__((aligned(8))) dither[8][8]={ @@ -66,7 +66,7 @@ struct vf_priv_s { uint8_t *src; }; #if 0 -static inline void dct7_c(DCTELEM *dst, int s0, int s1, int s2, int s3, int step){ +static inline void dct7_c(int16_t *dst, int s0, int s1, int s2, int s3, int step){ int s, d; int dst2[64]; //#define S0 (1024/0.37796447300922719759) @@ -113,7 +113,7 @@ static inline void dct7_c(DCTELEM *dst, int s0, int s1, int s2, int s3, int step } #endif -static inline void dctA_c(DCTELEM *dst, uint8_t *src, int stride){ +static inline void dctA_c(int16_t *dst, uint8_t *src, int stride){ int i; for(i=0; i<4; i++){ @@ -135,7 +135,7 @@ static inline void dctA_c(DCTELEM *dst, uint8_t *src, int stride){ } } -static void dctB_c(DCTELEM *dst, DCTELEM *src){ +static void dctB_c(int16_t *dst, int16_t *src){ int i; for(i=0; i<4; i++){ @@ -158,7 +158,7 @@ static void dctB_c(DCTELEM *dst, DCTELEM *src){ } #if HAVE_MMX -static void dctB_mmx(DCTELEM *dst, DCTELEM *src){ +static void dctB_mmx(int16_t *dst, int16_t *src){ __asm__ volatile ( "movq (%0), %%mm0 \n\t" "movq 1*4*2(%0), %%mm1 \n\t" @@ -191,7 +191,7 @@ static void dctB_mmx(DCTELEM *dst, DCTELEM *src){ } #endif -static void (*dctB)(DCTELEM *dst, DCTELEM *src)= dctB_c; +static void (*dctB)(int16_t *dst, int16_t *src)= dctB_c; #define N0 4 #define N1 5 @@ -228,7 +228,7 @@ static void init_thres2(void){ } } -static int hardthresh_c(DCTELEM *src, int qp){ +static int hardthresh_c(int16_t *src, int qp){ int i; int a; @@ -244,7 +244,7 @@ static int hardthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int mediumthresh_c(DCTELEM *src, int qp){ +static int mediumthresh_c(int16_t *src, int qp){ int i; int a; @@ -265,7 +265,7 @@ static int mediumthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int softthresh_c(DCTELEM *src, int qp){ +static int softthresh_c(int16_t *src, int qp){ int i; int a; @@ -282,14 +282,14 @@ static int softthresh_c(DCTELEM *src, int qp){ return (a + (1<<11))>>12; } -static int (*requantize)(DCTELEM *src, int qp)= hardthresh_c; +static int (*requantize)(int16_t *src, int qp)= hardthresh_c; static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma){ int x, y; const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15)); uint8_t *p_src= p->src + 8*stride; - DCTELEM *block= (DCTELEM *)p->src; - DCTELEM *temp= (DCTELEM *)(p->src + 32); + int16_t *block= (int16_t *)p->src; + int16_t *temp= (int16_t *)(p->src + 32); if (!src || !dst) return; // HACK avoid crash for Y8 colourspace for(y=0; y<height; y++){ @@ -310,7 +310,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stri for(x=-8; x<0; x+=4){ const int index= x + y*stride + (8-3)*(1+stride) + 8; //FIXME silly offset uint8_t *src = p_src + index; - DCTELEM *tp= temp+4*x; + int16_t *tp= temp+4*x; dctA_c(tp+4*8, src, stride); } @@ -328,7 +328,7 @@ static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stri for(; x<end; x++){ const int index= x + y*stride + (8-3)*(1+stride) + 8; //FIXME silly offset uint8_t *src = p_src + index; - DCTELEM *tp= temp+4*x; + int16_t *tp= temp+4*x; int v; if((x&3)==0) diff --git a/libavfilter/libmpcodecs/vf_spp.c b/libavfilter/libmpcodecs/vf_spp.c index b53b57edc9..f821374e06 100644 --- a/libavfilter/libmpcodecs/vf_spp.c +++ b/libavfilter/libmpcodecs/vf_spp.c @@ -105,7 +105,7 @@ struct vf_priv_s { #define SHIFT 22 -static void hardthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){ +static void hardthresh_c(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){ int i; int bias= 0; //FIXME unsigned int threshold1, threshold2; @@ -113,7 +113,7 @@ static void hardthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm threshold1= qp*((1<<4) - bias) - 1; threshold2= (threshold1<<1); - memset(dst, 0, 64*sizeof(DCTELEM)); + memset(dst, 0, 64*sizeof(int16_t)); dst[0]= (src[0] + 4)>>3; for(i=1; i<64; i++){ @@ -125,7 +125,7 @@ static void hardthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm } } -static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){ +static void softthresh_c(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){ int i; int bias= 0; //FIXME unsigned int threshold1, threshold2; @@ -133,7 +133,7 @@ static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm threshold1= qp*((1<<4) - bias) - 1; threshold2= (threshold1<<1); - memset(dst, 0, 64*sizeof(DCTELEM)); + memset(dst, 0, 64*sizeof(int16_t)); dst[0]= (src[0] + 4)>>3; for(i=1; i<64; i++){ @@ -149,7 +149,7 @@ static void softthresh_c(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *perm } #if HAVE_MMX -static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){ +static void hardthresh_mmx(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){ int bias= 0; //FIXME unsigned int threshold1; @@ -217,7 +217,7 @@ static void hardthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe dst[0]= (src[0] + 4)>>3; } -static void softthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){ +static void softthresh_mmx(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation){ int bias= 0; //FIXME unsigned int threshold1; @@ -294,7 +294,7 @@ static void softthresh_mmx(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *pe } #endif -static inline void add_block(int16_t *dst, int stride, DCTELEM block[64]){ +static inline void add_block(int16_t *dst, int stride, int16_t block[64]){ int y; for(y=0; y<8; y++){ @@ -372,15 +372,15 @@ static void store_slice_mmx(uint8_t *dst, int16_t *src, int dst_stride, int src_ static void (*store_slice)(uint8_t *dst, int16_t *src, int dst_stride, int src_stride, int width, int height, int log2_scale)= store_slice_c; -static void (*requantize)(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation)= hardthresh_c; +static void (*requantize)(int16_t dst[64], int16_t src[64], int qp, uint8_t *permutation)= hardthresh_c; static void filter(struct vf_priv_s *p, uint8_t *dst, uint8_t *src, int dst_stride, int src_stride, int width, int height, uint8_t *qp_store, int qp_stride, int is_luma){ int x, y, i; const int count= 1<<p->log2_count; const int stride= is_luma ? p->temp_stride : ((width+16+15)&(~15)); uint64_t __attribute__((aligned(16))) block_align[32]; - DCTELEM *block = (DCTELEM *)block_align; - DCTELEM *block2= (DCTELEM *)(block_align+16); + int16_t *block = (int16_t *)block_align; + int16_t *block2= (int16_t *)(block_align+16); if (!src || !dst) return; // HACK avoid crash for Y8 colourspace for(y=0; y<height; y++){ diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index b81c3ee8f2..0d89b8153f 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -63,7 +63,7 @@ static int diff_planes(AVFilterContext *ctx, int x, y; int d, c = 0; int t = (w/16)*(h/16)*decimate->frac; - DCTELEM block[8*8]; + int16_t block[8*8]; /* compute difference for blocks of 8x8 bytes */ for (y = 0; y < h-7; y += 4) { diff --git a/tools/patcheck b/tools/patcheck index a1d4c06e80..83db4c0438 100755 --- a/tools/patcheck +++ b/tools/patcheck @@ -173,7 +173,7 @@ vertical align = /* and * align arrays fitting in smaller types variables written to twice with no interspaced read -memset(block, 0, 6*64*sizeof(DCTELEM)); -> clear_blocks +memset(block, 0, 6*64*sizeof(int16_t)); -> clear_blocks check existence of long_name in AVCodec check that the patch does not touch codec & (de)muxer layer at the same time ->split |