diff options
author | Diego Biurrun <diego@biurrun.de> | 2013-01-20 01:02:29 +0100 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2013-01-22 18:32:56 -0800 |
commit | 88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f (patch) | |
tree | 86f541af3a6bc6b60ec737d8011435e105a77cd9 | |
parent | 2e4bb99f4df7052b3e147ee898fcb4013a34d904 (diff) | |
download | ffmpeg-88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f.tar.gz |
Drop DCTELEM typedef
It does not help as an abstraction and adds dsputil dependencies.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
163 files changed, 835 insertions, 812 deletions
diff --git a/doc/optimization.txt b/doc/optimization.txt index c3e640c207..2b8c51b4c9 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 094e8518e4..fa5256c9ec 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -139,7 +139,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; @@ -154,7 +154,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; @@ -451,7 +451,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; @@ -496,7 +496,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; @@ -517,7 +517,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 ce7cecb741..4770fa7240 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 0dcacabb9d..6cd2dea4e5 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 *restrict block, +void get_pixels_mvi(int16_t *restrict block, const uint8_t *restrict pixels, int line_size); -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 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 ca857ac152..1f589aa0c0 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 bb9ab134e9..05839550f6 100644 --- a/libavcodec/alpha/motion_est_alpha.c +++ b/libavcodec/alpha/motion_est_alpha.c @@ -23,7 +23,7 @@ #include "dsputil_alpha.h" #include "asm.h" -void get_pixels_mvi(DCTELEM *restrict block, +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 *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 a1a8a27ac1..24e9a91a17 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 61bc5f2084..3fa545d89a 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 9feda140ff..1cfb47fab4 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 17017aa17d..222efdf8cc 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 fbe601408c..53b8934d00 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, +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 f27aee4fb1..2b2dd0ba44 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 b4277a514f..53d862e292 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 cce90c75ea..a7b9de81be 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 f6839dda0e..80d921eeab 100644 --- a/libavcodec/arm/mpegvideo_armv5te.c +++ b/libavcodec/arm/mpegvideo_armv5te.c @@ -24,7 +24,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 /** @@ -32,7 +32,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++) { @@ -50,7 +50,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; @@ -79,7 +79,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 07f5598d05..2fc6a03d2b 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 0342b0619a..60723467a0 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 b3e97d515d..a1cde8d80a 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 e9f3fd3f17..5a7950c17c 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 5ce17a4724..9cc60108e8 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 3440f93bc2..c353d05ea2 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 f36fa7f31f..adc114f7ab 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -97,7 +97,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; @@ -128,7 +128,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; @@ -164,7 +164,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; @@ -186,7 +186,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 f36f3ef3aa..2f48f73ff6 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -55,7 +55,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; @@ -88,7 +88,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; @@ -129,7 +129,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) { @@ -148,7 +148,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 0fee494cc7..e7140704a2 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 52860c6bb9..5d6018400c 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 f1a9b32d64..a7c586374f 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 *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 8ca490d040..c923d760e7 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. @@ -145,7 +145,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 b384840fba..0eeffc2016 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 8e88d88c5d..1ab803b8b0 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 45a3ab626c..fcf96f8fa4 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 *restrict block, const uint8_t *pixels, int line_size)): + (int16_t *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 bec25a0c35..962d3832e5 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 2e18f91090..05ec96a8ac 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 b81fda53d8..7b81d052f3 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -696,7 +696,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]; @@ -800,7 +800,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; @@ -946,7 +946,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 c110882377..0e80fa22e8 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -713,7 +713,7 @@ void ff_cavs_init_top_lines(AVSContext *h) { /* alloc space for co-located MVs and types */ h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); h->col_type_base = av_malloc(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 26f1e9c7af..401ec122ad 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 cef6b953a5..b841f48d13 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -516,8 +516,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; @@ -551,9 +551,9 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, int qp, uint8_t *dst, int stride) { int i, level_code, esc_code, level, run, mask; - 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 15020a8ce8..54c6159499 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 fff9c1cc90..333bd10cf2 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 3ce0270006..cd6480d381 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" @@ -49,24 +50,24 @@ #undef printf // 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 } format; int mm_support; @@ -166,10 +167,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) +static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng) { int i, j; @@ -197,7 +198,7 @@ static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng) } } -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; @@ -221,7 +222,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) { - 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 7cc17c4db3..cc8952b94d 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -44,19 +44,19 @@ 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); } 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) { @@ -180,7 +180,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, @@ -250,13 +250,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 8531fe0ea5..262f73bcfa 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -44,7 +44,7 @@ static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL #define LAMBDA_FRAC_BITS 10 -static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size) +static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size) { int i; for (i = 0; i < 4; i++) { @@ -61,7 +61,7 @@ static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t memcpy(block + 24, block - 32, sizeof(*block) * 8); } -static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size) +static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size) { int i; @@ -73,7 +73,7 @@ static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict bl } } -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; @@ -370,7 +370,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; @@ -393,7 +393,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; @@ -434,7 +434,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; @@ -443,7 +443,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; @@ -512,7 +512,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] = @@ -529,7 +529,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); @@ -578,7 +578,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, i, qscale, &overflow); diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h index c74b9a78ca..fed17bed51 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]; @@ -92,7 +92,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 caf1b071d7..82da8dd6c1 100644 --- a/libavcodec/dsputil.c +++ b/libavcodec/dsputil.c @@ -336,7 +336,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 *restrict block, const uint8_t *s1, +static void diff_pixels_c(int16_t *restrict block, const uint8_t *s1, const uint8_t *s2, int stride){ int i; @@ -357,7 +357,7 @@ static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1, } -static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, +static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, int line_size) { int i; @@ -378,7 +378,7 @@ static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, } } -static void put_signed_pixels_clamped_c(const DCTELEM *block, +static void put_signed_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, int line_size) { @@ -399,7 +399,7 @@ static void put_signed_pixels_clamped_c(const DCTELEM *block, } } -static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, +static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, int line_size) { int i; @@ -419,7 +419,7 @@ static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, } } -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++) @@ -1712,10 +1712,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 @@ -2030,7 +2030,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]); assert(h==8); @@ -2069,7 +2069,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; @@ -2094,7 +2094,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; assert(h==8); @@ -2110,8 +2110,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; assert(h==8); @@ -2119,7 +2119,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); @@ -2134,7 +2134,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; @@ -2210,7 +2210,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; @@ -2447,12 +2447,12 @@ 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); diff --git a/libavcodec/dsputil.h b/libavcodec/dsputil.h index 9b88058345..1e0366bf9e 100644 --- a/libavcodec/dsputil.h +++ b/libavcodec/dsputil.h @@ -36,41 +36,40 @@ //#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_dct(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) H264_IDCT(10) -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]; @@ -128,11 +127,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) */ @@ -197,14 +196,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. */ @@ -214,8 +213,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 @@ -344,24 +343,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. @@ -451,7 +450,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 bd5c48b1a8..28ff0e5f09 100644 --- a/libavcodec/dsputil_template.c +++ b/libavcodec/dsputil_template.c @@ -114,7 +114,7 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i } #define DCTELEM_FUNCS(dctcoef, suffix) \ -static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \ +static void FUNCC(get_pixels ## suffix)(int16_t *restrict _block, \ const uint8_t *_pixels, \ int line_size) \ { \ @@ -138,7 +138,7 @@ static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \ } \ \ static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ - DCTELEM *_block, \ + int16_t *_block, \ int line_size) \ { \ int i; \ @@ -161,7 +161,7 @@ static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ } \ \ static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \ - DCTELEM *_block, \ + int16_t *_block, \ int line_size) \ { \ int i; \ @@ -179,20 +179,20 @@ static void FUNCC(add_pixels4 ## suffix)(uint8_t *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 7067f0caf2..1ea04be9e8 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -406,7 +406,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; @@ -495,7 +495,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 c50fa5f05d..1c5d1998a9 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 bc1bb55eb9..142cd6bdbf 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -48,7 +48,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; @@ -57,7 +57,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; @@ -135,14 +135,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; diff --git a/libavcodec/eaidct.c b/libavcodec/eaidct.c index 9f2d5cc6be..c87e32d733 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 4c0b5ae16e..e78de04178 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 cf44ae98e3..b8073dce3a 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; @@ -96,7 +96,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( @@ -110,7 +110,7 @@ static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, i } } -static inline void decode_block_intra(MadContext *s, DCTELEM * block) +static inline void 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 d6a6e55ff1..777d23a7a1 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 f9141e2017..815ddc42c4 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 cd9823618b..59d5ff3534 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 cd8ca273ad..5cacfdd2a3 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 f3896f7a48..0c015201cc 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 55453c112d..500f7953aa 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -47,7 +47,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; @@ -358,7 +358,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 d6b4cfcd18..b3a4cb0cc4 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -34,7 +34,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){ @@ -143,7 +143,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; @@ -154,7 +154,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; @@ -255,7 +255,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 7f1966f8bf..03d45638b5 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 beb32c4f18..0b5ace3960 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 2e2b272714..913b06f50f 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1750,7 +1750,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) { @@ -1759,7 +1759,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) { @@ -1778,8 +1778,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; @@ -1895,7 +1895,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 cdfe1b6308..140740c411 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" @@ -386,9 +385,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 92c1c03740..1926ce6d14 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1561,7 +1561,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) @@ -1745,18 +1745,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); } @@ -1772,7 +1781,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; @@ -1782,7 +1796,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) { @@ -1794,7 +1808,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 ) { @@ -2354,7 +2374,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 0cc7214666..be1cdf1ea2 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; @@ -1134,7 +1134,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 < 2; 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 e27fd1330d..8b3e88cd6d 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 248c7d0e08..c6bcd9e214 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 554483c057..811dfa243e 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,7 +154,7 @@ 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 *_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*)_dst; @@ -167,7 +167,7 @@ void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){ } } -void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_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*)_dst; @@ -180,7 +180,7 @@ void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_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,7 +248,7 @@ 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 *_output, DCTELEM *_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]; @@ -283,7 +283,7 @@ void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *_output, DCTELEM *_input, int #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 a8b3dba28b..ad1739a3c5 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 8ae13b0df7..8e97d11104 100644 --- a/libavcodec/h264pred_template.c +++ b/libavcodec/h264pred_template.c @@ -1131,7 +1131,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; @@ -1150,7 +1150,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; @@ -1168,7 +1168,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; @@ -1191,7 +1191,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; @@ -1214,7 +1214,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; @@ -1224,7 +1224,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; @@ -1233,7 +1233,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++) @@ -1241,7 +1241,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++) @@ -1251,7 +1251,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; @@ -1261,7 +1261,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 cb26be21df..f062b246b4 100644 --- a/libavcodec/ituh263dec.c +++ b/libavcodec/ituh263dec.c @@ -438,7 +438,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; @@ -563,7 +563,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; /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly @@ -599,7 +599,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 f95b1cd9a7..07277bbeda 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -306,7 +306,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; @@ -455,7 +455,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 e33558f825..1da58312a6 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 */ diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index b5a9d571a3..2f74cdcd01 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 95695de34c..c1fc81956b 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 0b22bca5f3..9c1387f683 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -408,7 +408,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; @@ -456,7 +456,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) { @@ -474,7 +474,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) @@ -572,7 +572,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) @@ -880,7 +880,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; @@ -957,7 +957,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, int block_offset = mb_y * linesize * 8; uint8_t *ptr = data + block_offset; 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++) { const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb); diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index 89325ba7d7..d48877e650 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -88,8 +88,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 64e6f25fc6..9aeb68fdc6 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -369,7 +369,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; @@ -427,7 +427,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; for(i=0;i<5;i++) { diff --git a/libavcodec/mjpegenc.h b/libavcodec/mjpegenc.h index 12ff54055e..11dd0b20ee 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(PutBitContext *pbc); 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 7a9b54a789..1b9a48b3b1 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -80,7 +80,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; @@ -151,12 +151,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; @@ -231,7 +231,7 @@ end: return 0; } -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; @@ -303,7 +303,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; @@ -383,7 +383,7 @@ end: } 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; @@ -444,7 +444,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; @@ -522,7 +522,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, in return 0; } -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; @@ -721,7 +721,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]; @@ -734,7 +734,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 0f9faaf19c..2c8f935b2b 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 ceb31e0270..da344e5ad3 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -51,7 +51,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 @@ -432,7 +432,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) { @@ -656,7 +656,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); @@ -839,7 +839,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 64c0243785..ae3880fe3f 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 faa98668d9..cab58823c8 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -50,7 +50,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; @@ -841,7 +841,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; @@ -1065,7 +1065,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; @@ -1148,7 +1148,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 986cba62fa..9bb1f9a0bc 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 ce366102d1..6320fbc138 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); /* enable all paranoid tests for rounding, overflows, etc... */ @@ -394,7 +394,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, @@ -471,7 +471,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++) { @@ -2067,7 +2067,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); @@ -2075,7 +2075,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); @@ -2083,7 +2083,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); @@ -2136,7 +2136,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 is_mpeg12) { const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; @@ -2148,7 +2148,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++){ @@ -2367,7 +2367,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) { MPV_decode_mb_internal(s, block, 1); @@ -2506,7 +2506,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; @@ -2538,7 +2538,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; @@ -2567,7 +2567,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; @@ -2597,7 +2597,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; @@ -2630,7 +2630,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; @@ -2661,7 +2661,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; @@ -2698,7 +2698,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 359bebc74b..567319c27b 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -669,39 +669,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)[8][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)[8][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; @@ -764,7 +764,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); @@ -784,7 +784,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); @@ -799,7 +799,7 @@ void ff_er_add_slice(MpegEncContext *s, int startx, int starty, int endx, int en int ff_dct_common_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); @@ -874,7 +874,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); @@ -889,7 +889,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); @@ -906,7 +906,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); @@ -914,14 +914,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 f783dc7892..3d4db8ff5b 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -51,10 +51,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); /* enable all paranoid tests for rounding, overflows, etc... */ //#define PARANOID @@ -1625,7 +1625,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; @@ -1665,7 +1665,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; @@ -1729,7 +1729,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int mb_block_count) { int16_t weight[8][64]; - DCTELEM orig[8][64]; + int16_t orig[8][64]; const int mb_x = s->mb_x; const int mb_y = s->mb_y; int i; @@ -1979,7 +1979,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, get_visual_weight(weight[7], ptr_cr + (dct_offset >> 1), 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 */ @@ -2716,7 +2716,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}; @@ -2741,7 +2741,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); } } @@ -2751,7 +2751,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); } } } @@ -3327,7 +3327,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; @@ -3352,7 +3352,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; @@ -3459,7 +3459,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; } @@ -3591,7 +3591,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; @@ -3666,10 +3666,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; @@ -4039,7 +4039,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 159fe21b58..7101a3ea60 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 5e562d8478..aeb6f5e7e4 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -406,7 +406,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; @@ -492,7 +492,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; @@ -934,7 +934,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 8fe07f2630..0a8ecd9e23 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 4a362c3921..936c7a53dd 100644 --- a/libavcodec/msmpeg4enc.c +++ b/libavcodec/msmpeg4enc.c @@ -368,7 +368,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; @@ -569,7 +569,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 1007fbd2b7..4f7e12a7b2 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 *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 *restrict block, const uint8_t *pixels, i } } -static void diff_pixels_altivec(DCTELEM *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 *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 24dbb8c10e..b73778ed6b 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 73e2adb776..36d39d4698 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 df111e997c..9aa0ae7449 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 6c110dba47..b081989c68 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 24ad09f03b..6bf5f0e033 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/proresdec.c b/libavcodec/proresdec.c index 4b196f6d32..f4c6b6d951 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.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 59969047dd..cb08862ef4 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_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 ba22259fcb..5e35140b53 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); diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c index c4716d6c91..5a8cea8e50 100644 --- a/libavcodec/proresenc.c +++ b/libavcodec/proresenc.c @@ -22,6 +22,7 @@ #include "libavutil/opt.h" #include "avcodec.h" +#include "dsputil.h" #include "put_bits.h" #include "bytestream.h" #include "internal.h" @@ -167,7 +168,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; @@ -175,7 +176,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]; @@ -210,7 +211,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; @@ -314,7 +315,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; @@ -340,7 +341,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) @@ -376,7 +377,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) { @@ -478,7 +479,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; @@ -509,7 +510,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 360458540b..5ae47780ec 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 9fbfb34ddc..c544b0b6f3 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 3106bfb52c..111bbb0e50 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -216,7 +216,7 @@ static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table) /** * Get one coefficient value from the bistream 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){ @@ -236,7 +236,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]; @@ -254,13 +254,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]; @@ -282,7 +282,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; @@ -994,7 +994,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){ @@ -1007,13 +1007,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)); @@ -1179,7 +1179,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; @@ -1219,7 +1219,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 74c8670c7d..cab1b0a298 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 7e8ebbc68e..f7dc30bad4 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 9da6ffcf65..87f175f0e1 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 5812a87705..328c96c747 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 6e22158b0b..e25729085e 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 3c855e3825..367bc34012 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 4be86e25e0..d7f6e01039 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 43a898a381..1e0f4119e9 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 266e22f985..4b5a8d03eb 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -137,7 +137,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 @@ -172,7 +172,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]; @@ -210,7 +210,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 13011ae038..f3285f0428 100644 --- a/libavcodec/vc1.h +++ b/libavcodec/vc1.h @@ -385,7 +385,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 8e7b0eaa80..6248125b79 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -2538,7 +2538,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; @@ -2701,7 +2701,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; @@ -2913,7 +2913,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; @@ -3123,7 +3123,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) @@ -4505,7 +4505,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 81a74e3e4a..24ed900b2a 100644 --- a/libavcodec/vc1dsp.c +++ b/libavcodec/vc1dsp.c @@ -79,7 +79,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; @@ -105,7 +105,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; @@ -229,7 +229,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]; @@ -248,11 +248,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; @@ -319,7 +319,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]; @@ -338,11 +338,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; @@ -394,7 +394,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]; @@ -409,11 +409,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; @@ -465,7 +465,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]; @@ -480,11 +480,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 5f364b30f3..26b4a065fa 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 33cfc8c204..f46ac32a9a 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -138,7 +138,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; @@ -920,7 +920,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; @@ -1350,7 +1350,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; @@ -1459,7 +1459,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 0ce6b81d98..f6d2c2a3b3 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 d28c8478f0..a5e25ec7bb 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 431d1a9465..61325e4751 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 { @@ -124,12 +124,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 3b8f7d2a24..e6b0071ce6 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -760,7 +760,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]) { @@ -828,7 +828,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 4a85541f37..392d0b44c9 100644 --- a/libavcodec/vp8.h +++ b/libavcodec/vp8.h @@ -94,8 +94,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 2ab68bc075..4b7782fd9b 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 bce0062c51..6fe5aff474 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 595630f2ca..dea3b3b67d 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 82075670e0..9a1717a722 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 077928357e..4fb3e06f32 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 85a9db1d75..72dfe78b53 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 eaffcfc537..3368b3a971 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 4643835145..91c7a2990e 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -148,7 +148,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 43ee246221..f5470c95e4 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 9a282e8dfb..8866813a5b 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -225,10 +225,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 */ @@ -300,7 +300,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; @@ -317,10 +317,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; @@ -422,7 +422,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" \ @@ -442,7 +442,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" @@ -459,7 +459,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" diff --git a/libavcodec/x86/dsputil_mmx.h b/libavcodec/x86/dsputil_mmx.h index 49688dc665..86de479b62 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); diff --git a/libavcodec/x86/dsputilenc.asm b/libavcodec/x86/dsputilenc.asm index 7b8763cf59..7e4fd8152c 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 fa126d68fd..532b60956d 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); @@ -797,7 +797,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 30cecd9a09..de0de24428 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 454dd3f0e1..d207fd0a49 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 73d4990899..0acd61d13f 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 2cf8b47d62..3870ffddd5 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 79d5bf96a8..aea28bab96 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 3bc93f30e2..599db949a8 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; @@ -195,7 +195,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; @@ -264,7 +264,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; @@ -330,7 +330,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; @@ -396,7 +396,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; @@ -472,7 +472,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]; @@ -526,7 +526,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 a6e7ba45ee..4d3fb7445b 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 91e0800365..855f2094b7 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -327,7 +327,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 46c26bdc56..9df69b62ab 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) { 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 0e809337d3..966beaa538 100644 --- a/libavcodec/x86/simple_idct.c +++ b/libavcodec/x86/simple_idct.c @@ -1155,12 +1155,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 b02582f615..a64ec414be 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -494,7 +494,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; @@ -533,7 +533,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; @@ -595,7 +595,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; @@ -634,7 +634,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 95beeabfec..2668bcf5b9 100644 --- a/libavcodec/x86/vp3dsp_init.c +++ b/libavcodec/x86/vp3dsp_init.c @@ -22,17 +22,18 @@ #include "libavutil/cpu.h" #include "libavutil/x86/cpu.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 af8403e991..caf2cd679a 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 a9d3541807..38770c34b0 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/tools/patcheck b/tools/patcheck index d22cf3c5aa..514da9fe9b 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 |