It does not help as an abstraction and adds dsputil dependencies.
Unified · Split
| @@ -148,7 +148,7 @@ Alignment: · 147 unmodified lines | |||
| 148 | Some instructions on some architectures have strict alignment restrictions, | 148 | Some instructions on some architectures have strict alignment restrictions, |
| 149 | for example most SSE/SSE2 instructions on x86. | 149 | for example most SSE/SSE2 instructions on x86. |
| 150 | The minimum guaranteed alignment is written in the .h files, for example: | 150 | The minimum guaranteed alignment is written in the .h files, for example: |
| 151 | void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size); | 151 | void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size); |
| 152 | 152 | ||
| 153 | 153 | ||
| 154 | General Tips: | 154 | General Tips: |
| @@ -139,7 +139,7 @@ typedef struct FourXContext { · 138 unmodified lines | |||
| 139 | int mv[256]; | 139 | int mv[256]; |
| 140 | VLC pre_vlc; | 140 | VLC pre_vlc; |
| 141 | int last_dc; | 141 | int last_dc; |
| 142 | DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; | 142 | DECLARE_ALIGNED(16, int16_t, block)[6][64]; |
| 143 | void *bitstream_buffer; | 143 | void *bitstream_buffer; |
| 144 | unsigned int bitstream_buffer_size; | 144 | unsigned int bitstream_buffer_size; |
| 145 | int version; | 145 | int version; |
| @@ -154,7 +154,7 @@ typedef struct FourXContext { · 8 unmodified lines | |||
| 154 | 154 | ||
| 155 | #define MULTIPLY(var, const) (((var) * (const)) >> 16) | 155 | #define MULTIPLY(var, const) (((var) * (const)) >> 16) |
| 156 | 156 | ||
| 157 | static void idct(DCTELEM block[64]) | 157 | static void idct(int16_t block[64]) |
| 158 | { | 158 | { |
| 159 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 159 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 160 | int tmp10, tmp11, tmp12, tmp13; | 160 | int tmp10, tmp11, tmp12, tmp13; |
| @@ -451,7 +451,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length) · 290 unmodified lines | |||
| 451 | * decode block and dequantize. | 451 | * decode block and dequantize. |
| 452 | * Note this is almost identical to MJPEG. | 452 | * Note this is almost identical to MJPEG. |
| 453 | */ | 453 | */ |
| 454 | static int decode_i_block(FourXContext *f, DCTELEM *block) | 454 | static int decode_i_block(FourXContext *f, int16_t *block) |
| 455 | { | 455 | { |
| 456 | int code, i, j, level, val; | 456 | int code, i, j, level, val; |
| 457 | 457 | ||
| @@ -496,7 +496,7 @@ static int decode_i_block(FourXContext *f, DCTELEM *block) · 38 unmodified lines | |||
| 496 | 496 | ||
| 497 | static inline void idct_put(FourXContext *f, int x, int y) | 497 | static inline void idct_put(FourXContext *f, int x, int y) |
| 498 | { | 498 | { |
| 499 | DCTELEM (*block)[64] = f->block; | 499 | int16_t (*block)[64] = f->block; |
| 500 | int stride = f->current_picture->linesize[0] >> 1; | 500 | int stride = f->current_picture->linesize[0] >> 1; |
| 501 | int i; | 501 | int i; |
| 502 | uint16_t *dst = ((uint16_t*)f->current_picture->data[0]) + y * stride + x; | 502 | 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) · 14 unmodified lines | |||
| 517 | * cr = (-1b - 4g + 5r) / 14 */ | 517 | * cr = (-1b - 4g + 5r) / 14 */ |
| 518 | for (y = 0; y < 8; y++) { | 518 | for (y = 0; y < 8; y++) { |
| 519 | for (x = 0; x < 8; x++) { | 519 | for (x = 0; x < 8; x++) { |
| 520 | DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] + | 520 | int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] + |
| 521 | 2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize | 521 | 2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize |
| 522 | int cb = block[4][x + 8 * y]; | 522 | int cb = block[4][x + 8 * y]; |
| 523 | int cr = block[5][x + 8 * y]; | 523 | int cr = block[5][x + 8 * y]; |
| @@ -23,15 +23,15 @@ · 22 unmodified lines | |||
| 23 | #include "dsputil_alpha.h" | 23 | #include "dsputil_alpha.h" |
| 24 | #include "asm.h" | 24 | #include "asm.h" |
| 25 | 25 | ||
| 26 | void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 26 | void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, |
| 27 | int line_size); | 27 | int line_size); |
| 28 | void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 28 | void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, |
| 29 | int line_size); | 29 | int line_size); |
| 30 | 30 | ||
| 31 | #if 0 | 31 | #if 0 |
| 32 | /* These functions were the base for the optimized assembler routines, | 32 | /* These functions were the base for the optimized assembler routines, |
| 33 | and remain here for documentation purposes. */ | 33 | and remain here for documentation purposes. */ |
| 34 | static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, | 34 | static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, |
| 35 | int line_size) | 35 | int line_size) |
| 36 | { | 36 | { |
| 37 | int i = 8; | 37 | int i = 8; |
| @@ -55,7 +55,7 @@ static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, · 17 unmodified lines | |||
| 55 | } while (--i); | 55 | } while (--i); |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, | 58 | void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels, |
| 59 | int line_size) | 59 | int line_size) |
| 60 | { | 60 | { |
| 61 | int h = 8; | 61 | int h = 8; |
| @@ -100,9 +100,9 @@ void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels, · 38 unmodified lines | |||
| 100 | } | 100 | } |
| 101 | #endif | 101 | #endif |
| 102 | 102 | ||
| 103 | static void clear_blocks_axp(DCTELEM *blocks) { | 103 | static void clear_blocks_axp(int16_t *blocks) { |
| 104 | uint64_t *p = (uint64_t *) blocks; | 104 | uint64_t *p = (uint64_t *) blocks; |
| 105 | int n = sizeof(DCTELEM) * 6 * 64; | 105 | int n = sizeof(int16_t) * 6 * 64; |
| 106 | 106 | ||
| 107 | do { | 107 | do { |
| 108 | p[0] = 0; | 108 | p[0] = 0; |
| @@ -19,26 +19,26 @@ · 18 unmodified lines | |||
| 19 | #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H | 19 | #ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H |
| 20 | #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H | 20 | #define AVCODEC_ALPHA_DSPUTIL_ALPHA_H |
| 21 | 21 | ||
| 22 | #include "libavcodec/dsputil.h" | 22 | #include <stdint.h> |
| 23 | 23 | ||
| 24 | void ff_simple_idct_axp(DCTELEM *block); | 24 | void ff_simple_idct_axp(int16_t *block); |
| 25 | void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block); | 25 | void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block); |
| 26 | void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block); | 26 | void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block); |
| 27 | 27 | ||
| 28 | void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, | 28 | void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels, |
| 29 | int line_size, int h); | 29 | int line_size, int h); |
| 30 | void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | 30 | void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, |
| 31 | int line_size); | 31 | int line_size); |
| 32 | void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | 32 | void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, |
| 33 | int line_size); | 33 | int line_size); |
| 34 | extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 34 | extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, |
| 35 | int line_size); | 35 | int line_size); |
| 36 | extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels, | 36 | extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels, |
| 37 | int line_size); | 37 | int line_size); |
| 38 | 38 | ||
| 39 | void get_pixels_mvi(DCTELEM *restrict block, | 39 | void get_pixels_mvi(int16_t *restrict block, |
| 40 | const uint8_t *restrict pixels, int line_size); | 40 | const uint8_t *restrict pixels, int line_size); |
| 41 | void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, | 41 | void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, |
| 42 | int stride); | 42 | int stride); |
| 43 | int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); | 43 | int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); |
| 44 | int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); | 44 | int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h); |
| @@ -135,7 +135,7 @@ $aligned: · 134 unmodified lines | |||
| 135 | .end put_pixels_axp_asm | 135 | .end put_pixels_axp_asm |
| 136 | 136 | ||
| 137 | /************************************************************************ | 137 | /************************************************************************ |
| 138 | * void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | 138 | * void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, |
| 139 | * int line_size) | 139 | * int line_size) |
| 140 | */ | 140 | */ |
| 141 | .align 6 | 141 | .align 6 |
| @@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm: · 43 unmodified lines | |||
| 185 | .end put_pixels_clamped_mvi_asm | 185 | .end put_pixels_clamped_mvi_asm |
| 186 | 186 | ||
| 187 | /************************************************************************ | 187 | /************************************************************************ |
| 188 | * void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels, | 188 | * void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels, |
| 189 | * int line_size) | 189 | * int line_size) |
| 190 | */ | 190 | */ |
| 191 | .align 6 | 191 | .align 6 |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "dsputil_alpha.h" | 23 | #include "dsputil_alpha.h" |
| 24 | #include "asm.h" | 24 | #include "asm.h" |
| 25 | 25 | ||
| 26 | void get_pixels_mvi(DCTELEM *restrict block, | 26 | void get_pixels_mvi(int16_t *restrict block, |
| 27 | const uint8_t *restrict pixels, int line_size) | 27 | const uint8_t *restrict pixels, int line_size) |
| 28 | { | 28 | { |
| 29 | int h = 8; | 29 | int h = 8; |
| @@ -40,7 +40,7 @@ void get_pixels_mvi(DCTELEM *restrict block, · 10 unmodified lines | |||
| 40 | } while (--h); | 40 | } while (--h); |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, | 43 | void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2, |
| 44 | int stride) { | 44 | int stride) { |
| 45 | int h = 8; | 45 | int h = 8; |
| 46 | uint64_t mask = 0x4040; | 46 | uint64_t mask = 0x4040; |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "libavcodec/mpegvideo.h" | 23 | #include "libavcodec/mpegvideo.h" |
| 24 | #include "asm.h" | 24 | #include "asm.h" |
| 25 | 25 | ||
| 26 | static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs, | 26 | static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs, |
| 27 | uint64_t qscale, uint64_t qadd) | 27 | uint64_t qscale, uint64_t qadd) |
| 28 | { | 28 | { |
| 29 | uint64_t qmul = qscale << 1; | 29 | uint64_t qmul = qscale << 1; |
| @@ -69,12 +69,12 @@ static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs, · 39 unmodified lines | |||
| 69 | } | 69 | } |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block, | 72 | static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block, |
| 73 | int n, int qscale) | 73 | int n, int qscale) |
| 74 | { | 74 | { |
| 75 | int n_coeffs; | 75 | int n_coeffs; |
| 76 | uint64_t qadd; | 76 | uint64_t qadd; |
| 77 | DCTELEM block0 = block[0]; | 77 | int16_t block0 = block[0]; |
| 78 | 78 | ||
| 79 | if (!s->h263_aic) { | 79 | if (!s->h263_aic) { |
| 80 | if (n < 4) | 80 | if (n < 4) |
| @@ -96,7 +96,7 @@ static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block, · 15 unmodified lines | |||
| 96 | block[0] = block0; | 96 | block[0] = block0; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block, | 99 | static void dct_unquantize_h263_inter_axp(MpegEncContext *s, int16_t *block, |
| 100 | int n, int qscale) | 100 | int n, int qscale) |
| 101 | { | 101 | { |
| 102 | int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]]; | 102 | int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]]; |
| @@ -44,7 +44,7 @@ · 43 unmodified lines | |||
| 44 | #define COL_SHIFT 20 | 44 | #define COL_SHIFT 20 |
| 45 | 45 | ||
| 46 | /* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */ | 46 | /* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */ |
| 47 | static inline int idct_row(DCTELEM *row) | 47 | static inline int idct_row(int16_t *row) |
| 48 | { | 48 | { |
| 49 | int a0, a1, a2, a3, b0, b1, b2, b3, t; | 49 | int a0, a1, a2, a3, b0, b1, b2, b3, t; |
| 50 | uint64_t l, r, t2; | 50 | uint64_t l, r, t2; |
| @@ -152,7 +152,7 @@ static inline int idct_row(DCTELEM *row) · 101 unmodified lines | |||
| 152 | return 2; | 152 | return 2; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | static inline void idct_col(DCTELEM *col) | 155 | static inline void idct_col(int16_t *col) |
| 156 | { | 156 | { |
| 157 | int a0, a1, a2, a3, b0, b1, b2, b3; | 157 | int a0, a1, a2, a3, b0, b1, b2, b3; |
| 158 | 158 | ||
| @@ -229,7 +229,7 @@ static inline void idct_col(DCTELEM *col) · 70 unmodified lines | |||
| 229 | 229 | ||
| 230 | /* If all rows but the first one are zero after row transformation, | 230 | /* If all rows but the first one are zero after row transformation, |
| 231 | all rows will be identical after column transformation. */ | 231 | all rows will be identical after column transformation. */ |
| 232 | static inline void idct_col2(DCTELEM *col) | 232 | static inline void idct_col2(int16_t *col) |
| 233 | { | 233 | { |
| 234 | int i; | 234 | int i; |
| 235 | uint64_t l, r; | 235 | uint64_t l, r; |
| @@ -251,7 +251,7 @@ static inline void idct_col2(DCTELEM *col) · 15 unmodified lines | |||
| 251 | stq(l, col + 14 * 4); stq(r, col + 15 * 4); | 251 | stq(l, col + 14 * 4); stq(r, col + 15 * 4); |
| 252 | } | 252 | } |
| 253 | 253 | ||
| 254 | void ff_simple_idct_axp(DCTELEM *block) | 254 | void ff_simple_idct_axp(int16_t *block) |
| 255 | { | 255 | { |
| 256 | 256 | ||
| 257 | int i; | 257 | int i; |
| @@ -291,13 +291,13 @@ void ff_simple_idct_axp(DCTELEM *block) · 33 unmodified lines | |||
| 291 | } | 291 | } |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block) | 294 | void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block) |
| 295 | { | 295 | { |
| 296 | ff_simple_idct_axp(block); | 296 | ff_simple_idct_axp(block); |
| 297 | put_pixels_clamped_axp_p(block, dest, line_size); | 297 | put_pixels_clamped_axp_p(block, dest, line_size); |
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block) | 300 | void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block) |
| 301 | { | 301 | { |
| 302 | ff_simple_idct_axp(block); | 302 | ff_simple_idct_axp(block); |
| 303 | add_pixels_clamped_axp_p(block, dest, line_size); | 303 | add_pixels_clamped_axp_p(block, dest, line_size); |
| @@ -23,12 +23,12 @@ · 22 unmodified lines | |||
| 23 | #include "libavcodec/dsputil.h" | 23 | #include "libavcodec/dsputil.h" |
| 24 | #include "dsputil_arm.h" | 24 | #include "dsputil_arm.h" |
| 25 | 25 | ||
| 26 | void ff_j_rev_dct_arm(DCTELEM *data); | 26 | void ff_j_rev_dct_arm(int16_t *data); |
| 27 | void ff_simple_idct_arm(DCTELEM *data); | 27 | void ff_simple_idct_arm(int16_t *data); |
| 28 | 28 | ||
| 29 | /* XXX: local hack */ | 29 | /* XXX: local hack */ |
| 30 | static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | 30 | static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); |
| 31 | static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size); | 31 | static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size); |
| 32 | 32 | ||
| 33 | void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); | 33 | void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); |
| 34 | void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h); | 34 | 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) · 13 unmodified lines | |||
| 48 | CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8) | 48 | CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8) |
| 49 | CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8) | 49 | CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8) |
| 50 | 50 | ||
| 51 | void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest, | 51 | void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest, |
| 52 | int line_size); | 52 | int line_size); |
| 53 | 53 | ||
| 54 | /* XXX: those functions should be suppressed ASAP when all IDCTs are | 54 | /* XXX: those functions should be suppressed ASAP when all IDCTs are |
| 55 | converted */ | 55 | converted */ |
| 56 | static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block) | 56 | static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block) |
| 57 | { | 57 | { |
| 58 | ff_j_rev_dct_arm (block); | 58 | ff_j_rev_dct_arm (block); |
| 59 | ff_put_pixels_clamped(block, dest, line_size); | 59 | ff_put_pixels_clamped(block, dest, line_size); |
| 60 | } | 60 | } |
| 61 | static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) | 61 | static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block) |
| 62 | { | 62 | { |
| 63 | ff_j_rev_dct_arm (block); | 63 | ff_j_rev_dct_arm (block); |
| 64 | ff_add_pixels_clamped(block, dest, line_size); | 64 | ff_add_pixels_clamped(block, dest, line_size); |
| 65 | } | 65 | } |
| 66 | static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block) | 66 | static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block) |
| 67 | { | 67 | { |
| 68 | ff_simple_idct_arm (block); | 68 | ff_simple_idct_arm (block); |
| 69 | ff_put_pixels_clamped(block, dest, line_size); | 69 | ff_put_pixels_clamped(block, dest, line_size); |
| 70 | } | 70 | } |
| 71 | static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) | 71 | static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block) |
| 72 | { | 72 | { |
| 73 | ff_simple_idct_arm (block); | 73 | ff_simple_idct_arm (block); |
| 74 | ff_add_pixels_clamped(block, dest, line_size); | 74 | ff_add_pixels_clamped(block, dest, line_size); |
| @@ -21,9 +21,9 @@ · 20 unmodified lines | |||
| 21 | #include "libavcodec/dsputil.h" | 21 | #include "libavcodec/dsputil.h" |
| 22 | #include "dsputil_arm.h" | 22 | #include "dsputil_arm.h" |
| 23 | 23 | ||
| 24 | void ff_simple_idct_armv5te(DCTELEM *data); | 24 | void ff_simple_idct_armv5te(int16_t *data); |
| 25 | void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data); | 25 | void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data); |
| 26 | void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data); | 26 | void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data); |
| 27 | 27 | ||
| 28 | av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) | 28 | av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx) |
| 29 | { | 29 | { |
| @@ -24,9 +24,9 @@ · 23 unmodified lines | |||
| 24 | #include "libavcodec/dsputil.h" | 24 | #include "libavcodec/dsputil.h" |
| 25 | #include "dsputil_arm.h" | 25 | #include "dsputil_arm.h" |
| 26 | 26 | ||
| 27 | void ff_simple_idct_armv6(DCTELEM *data); | 27 | void ff_simple_idct_armv6(int16_t *data); |
| 28 | void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); | 28 | void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); |
| 29 | void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); | 29 | void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); |
| 30 | 30 | ||
| 31 | void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int); | 31 | void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int); |
| 32 | void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int); | 32 | 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); · 13 unmodified lines | |||
| 46 | 46 | ||
| 47 | void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int); | 47 | void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int); |
| 48 | 48 | ||
| 49 | void ff_add_pixels_clamped_armv6(const DCTELEM *block, | 49 | void ff_add_pixels_clamped_armv6(const int16_t *block, |
| 50 | uint8_t *restrict pixels, | 50 | uint8_t *restrict pixels, |
| 51 | int line_size); | 51 | int line_size); |
| 52 | 52 | ||
| 53 | void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride); | 53 | void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride); |
| 54 | void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1, | 54 | void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1, |
| 55 | const uint8_t *s2, int stride); | 55 | const uint8_t *s2, int stride); |
| 56 | 56 | ||
| 57 | int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, | 57 | int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2, |
| @@ -25,12 +25,12 @@ · 24 unmodified lines | |||
| 25 | #include "libavcodec/dsputil.h" | 25 | #include "libavcodec/dsputil.h" |
| 26 | #include "dsputil_arm.h" | 26 | #include "dsputil_arm.h" |
| 27 | 27 | ||
| 28 | void ff_simple_idct_neon(DCTELEM *data); | 28 | void ff_simple_idct_neon(int16_t *data); |
| 29 | void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data); | 29 | void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); |
| 30 | void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data); | 30 | void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); |
| 31 | 31 | ||
| 32 | void ff_clear_block_neon(DCTELEM *block); | 32 | void ff_clear_block_neon(int16_t *block); |
| 33 | void ff_clear_blocks_neon(DCTELEM *blocks); | 33 | void ff_clear_blocks_neon(int16_t *blocks); |
| 34 | 34 | ||
| 35 | void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int); | 35 | void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int); |
| 36 | void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int); | 36 | 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); · 25 unmodified lines | |||
| 62 | void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); | 62 | void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); |
| 63 | void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); | 63 | void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int); |
| 64 | 64 | ||
| 65 | void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); | 65 | void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int); |
| 66 | void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); | 66 | void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int); |
| 67 | void ff_put_signed_pixels_clamped_neon(const DCTELEM *, uint8_t *, int); | 67 | void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int); |
| 68 | 68 | ||
| 69 | void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int); | 69 | void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int); |
| 70 | void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int); | 70 | void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int); |
| @@ -50,22 +50,22 @@ void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride, · 49 unmodified lines | |||
| 50 | int height, int log2_den, int weightd, | 50 | int height, int log2_den, int weightd, |
| 51 | int weights, int offset); | 51 | int weights, int offset); |
| 52 | 52 | ||
| 53 | void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride); | 53 | void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride); |
| 54 | void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); | 54 | void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride); |
| 55 | void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset, | 55 | void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset, |
| 56 | DCTELEM *block, int stride, | 56 | int16_t *block, int stride, |
| 57 | const uint8_t nnzc[6*8]); | 57 | const uint8_t nnzc[6*8]); |
| 58 | void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset, | 58 | void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset, |
| 59 | DCTELEM *block, int stride, | 59 | int16_t *block, int stride, |
| 60 | const uint8_t nnzc[6*8]); | 60 | const uint8_t nnzc[6*8]); |
| 61 | void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset, | 61 | void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset, |
| 62 | DCTELEM *block, int stride, | 62 | int16_t *block, int stride, |
| 63 | const uint8_t nnzc[6*8]); | 63 | const uint8_t nnzc[6*8]); |
| 64 | 64 | ||
| 65 | void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride); | 65 | void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride); |
| 66 | void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride); | 66 | void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride); |
| 67 | void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset, | 67 | void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset, |
| 68 | DCTELEM *block, int stride, | 68 | int16_t *block, int stride, |
| 69 | const uint8_t nnzc[6*8]); | 69 | const uint8_t nnzc[6*8]); |
| 70 | 70 | ||
| 71 | static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) | 71 | static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc) |
| @@ -66,7 +66,7 @@ row_loop: · 65 unmodified lines | |||
| 66 | ldrsh r2, [lr, # 2] @ r2 = 'd2' | 66 | ldrsh r2, [lr, # 2] @ r2 = 'd2' |
| 67 | 67 | ||
| 68 | @ Optimization for row that have all items except the first set to 0 | 68 | @ Optimization for row that have all items except the first set to 0 |
| 69 | @ (this works as the DCTELEMS are always 4-byte aligned) | 69 | @ (this works as the int16_t are always 4-byte aligned) |
| 70 | ldr r5, [lr, # 0] | 70 | ldr r5, [lr, # 0] |
| 71 | ldr r6, [lr, # 4] | 71 | ldr r6, [lr, # 4] |
| 72 | ldr r3, [lr, # 8] | 72 | ldr r3, [lr, # 8] |
| @@ -34,9 +34,9 @@ CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END); · 33 unmodified lines | |||
| 34 | CHK_OFFS(MpegEncContext, h263_aic, H263_AIC); | 34 | CHK_OFFS(MpegEncContext, h263_aic, H263_AIC); |
| 35 | #endif | 35 | #endif |
| 36 | 36 | ||
| 37 | void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block, | 37 | void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block, |
| 38 | int n, int qscale); | 38 | int n, int qscale); |
| 39 | void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block, | 39 | void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block, |
| 40 | int n, int qscale); | 40 | int n, int qscale); |
| 41 | 41 | ||
| 42 | void ff_MPV_common_init_arm(MpegEncContext *s) | 42 | void ff_MPV_common_init_arm(MpegEncContext *s) |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include "libavcodec/mpegvideo.h" | 24 | #include "libavcodec/mpegvideo.h" |
| 25 | #include "mpegvideo_arm.h" | 25 | #include "mpegvideo_arm.h" |
| 26 | 26 | ||
| 27 | void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count); | 27 | void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count); |
| 28 | 28 | ||
| 29 | #ifdef ENABLE_ARM_TESTS | 29 | #ifdef ENABLE_ARM_TESTS |
| 30 | /** | 30 | /** |
| @@ -32,7 +32,7 @@ void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int coun · 1 unmodified line | |||
| 32 | * have optimized implementations for each architecture. Is also used as a reference | 32 | * have optimized implementations for each architecture. Is also used as a reference |
| 33 | * implementation in regression tests | 33 | * implementation in regression tests |
| 34 | */ | 34 | */ |
| 35 | static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count) | 35 | static inline void dct_unquantize_h263_helper_c(int16_t *block, int qmul, int qadd, int count) |
| 36 | { | 36 | { |
| 37 | int i, level; | 37 | int i, level; |
| 38 | for (i = 0; i < count; i++) { | 38 | for (i = 0; i < count; i++) { |
| @@ -50,7 +50,7 @@ static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qa · 11 unmodified lines | |||
| 50 | #endif | 50 | #endif |
| 51 | 51 | ||
| 52 | static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s, | 52 | static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s, |
| 53 | DCTELEM *block, int n, int qscale) | 53 | int16_t *block, int n, int qscale) |
| 54 | { | 54 | { |
| 55 | int level, qmul, qadd; | 55 | int level, qmul, qadd; |
| 56 | int nCoeffs; | 56 | int nCoeffs; |
| @@ -79,7 +79,7 @@ static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s, · 22 unmodified lines | |||
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s, | 81 | static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s, |
| 82 | DCTELEM *block, int n, int qscale) | 82 | int16_t *block, int n, int qscale) |
| 83 | { | 83 | { |
| 84 | int qmul, qadd; | 84 | int qmul, qadd; |
| 85 | int nCoeffs; | 85 | int nCoeffs; |
| @@ -24,11 +24,11 @@ · 23 unmodified lines | |||
| 24 | #include "libavcodec/rv34dsp.h" | 24 | #include "libavcodec/rv34dsp.h" |
| 25 | #include "libavutil/arm/cpu.h" | 25 | #include "libavutil/arm/cpu.h" |
| 26 | 26 | ||
| 27 | void ff_rv34_inv_transform_noround_neon(DCTELEM *block); | 27 | void ff_rv34_inv_transform_noround_neon(int16_t *block); |
| 28 | 28 | ||
| 29 | void ff_rv34_inv_transform_noround_dc_neon(DCTELEM *block); | 29 | void ff_rv34_inv_transform_noround_dc_neon(int16_t *block); |
| 30 | 30 | ||
| 31 | void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); | 31 | void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block); |
| 32 | void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc); | 32 | void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc); |
| 33 | 33 | ||
| 34 | void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp) | 34 | void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp) |
| @@ -67,7 +67,7 @@ · 66 unmodified lines | |||
| 67 | vsub.s32 q15, q14, q9 @ z0 - z3 | 67 | vsub.s32 q15, q14, q9 @ z0 - z3 |
| 68 | .endm | 68 | .endm |
| 69 | 69 | ||
| 70 | /* void rv34_idct_add_c(uint8_t *dst, int stride, DCTELEM *block) */ | 70 | /* void rv34_idct_add_c(uint8_t *dst, int stride, int16_t *block) */ |
| 71 | function ff_rv34_idct_add_neon, export=1 | 71 | function ff_rv34_idct_add_neon, export=1 |
| 72 | mov r3, r0 | 72 | mov r3, r0 |
| 73 | rv34_inv_transform r2 | 73 | rv34_inv_transform r2 |
| @@ -97,7 +97,7 @@ function ff_rv34_idct_add_neon, export=1 · 23 unmodified lines | |||
| 97 | bx lr | 97 | bx lr |
| 98 | endfunc | 98 | endfunc |
| 99 | 99 | ||
| 100 | /* void rv34_inv_transform_noround_neon(DCTELEM *block); */ | 100 | /* void rv34_inv_transform_noround_neon(int16_t *block); */ |
| 101 | function ff_rv34_inv_transform_noround_neon, export=1 | 101 | function ff_rv34_inv_transform_noround_neon, export=1 |
| 102 | rv34_inv_transform r0 | 102 | rv34_inv_transform r0 |
| 103 | vshl.s32 q11, q2, #1 | 103 | vshl.s32 q11, q2, #1 |
| @@ -142,7 +142,7 @@ function ff_rv34_idct_dc_add_neon, export=1 · 38 unmodified lines | |||
| 142 | bx lr | 142 | bx lr |
| 143 | endfunc | 143 | endfunc |
| 144 | 144 | ||
| 145 | /* void rv34_inv_transform_dc_noround_c(DCTELEM *block) */ | 145 | /* void rv34_inv_transform_dc_noround_c(int16_t *block) */ |
| 146 | function ff_rv34_inv_transform_noround_dc_neon, export=1 | 146 | function ff_rv34_inv_transform_noround_dc_neon, export=1 |
| 147 | vld1.16 {d28[]}, [r0,:16] @ block[0] | 147 | vld1.16 {d28[]}, [r0,:16] @ block[0] |
| 148 | vmov.i16 d4, #251 | 148 | vmov.i16 d4, #251 |
| @@ -375,7 +375,7 @@ endfunc · 374 unmodified lines | |||
| 375 | sub r0, r0, #(16*7) | 375 | sub r0, r0, #(16*7) |
| 376 | .endm | 376 | .endm |
| 377 | 377 | ||
| 378 | /* void ff_simple_idct_armv6(DCTELEM *data); */ | 378 | /* void ff_simple_idct_armv6(int16_t *data); */ |
| 379 | function ff_simple_idct_armv6, export=1 | 379 | function ff_simple_idct_armv6, export=1 |
| 380 | push {r4-r11, lr} | 380 | push {r4-r11, lr} |
| 381 | sub sp, sp, #128 | 381 | sub sp, sp, #128 |
| @@ -390,7 +390,7 @@ function ff_simple_idct_armv6, export=1 · 8 unmodified lines | |||
| 390 | pop {r4-r11, pc} | 390 | pop {r4-r11, pc} |
| 391 | endfunc | 391 | endfunc |
| 392 | 392 | ||
| 393 | /* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); */ | 393 | /* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */ |
| 394 | function ff_simple_idct_add_armv6, export=1 | 394 | function ff_simple_idct_add_armv6, export=1 |
| 395 | push {r0, r1, r4-r11, lr} | 395 | push {r0, r1, r4-r11, lr} |
| 396 | sub sp, sp, #128 | 396 | sub sp, sp, #128 |
| @@ -407,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1 · 10 unmodified lines | |||
| 407 | pop {r4-r11, pc} | 407 | pop {r4-r11, pc} |
| 408 | endfunc | 408 | endfunc |
| 409 | 409 | ||
| 410 | /* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); */ | 410 | /* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */ |
| 411 | function ff_simple_idct_put_armv6, export=1 | 411 | function ff_simple_idct_put_armv6, export=1 |
| 412 | push {r0, r1, r4-r11, lr} | 412 | push {r0, r1, r4-r11, lr} |
| 413 | sub sp, sp, #128 | 413 | sub sp, sp, #128 |
| @@ -261,7 +261,7 @@ endconst · 260 unmodified lines | |||
| 261 | pop {r4-r7, pc} | 261 | pop {r4-r7, pc} |
| 262 | .endm | 262 | .endm |
| 263 | 263 | ||
| 264 | /* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, DCTELEM *data); */ | 264 | /* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */ |
| 265 | function ff_simple_idct_put_neon, export=1 | 265 | function ff_simple_idct_put_neon, export=1 |
| 266 | idct_start r2 | 266 | idct_start r2 |
| 267 | 267 | ||
| @@ -316,7 +316,7 @@ function idct_col4_add8_neon · 48 unmodified lines | |||
| 316 | bx lr | 316 | bx lr |
| 317 | endfunc | 317 | endfunc |
| 318 | 318 | ||
| 319 | /* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, DCTELEM *data); */ | 319 | /* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */ |
| 320 | function ff_simple_idct_add_neon, export=1 | 320 | function ff_simple_idct_add_neon, export=1 |
| 321 | idct_start r2 | 321 | idct_start r2 |
| 322 | 322 | ||
| @@ -355,7 +355,7 @@ function idct_col4_st16_neon · 32 unmodified lines | |||
| 355 | bx lr | 355 | bx lr |
| 356 | endfunc | 356 | endfunc |
| 357 | 357 | ||
| 358 | /* void ff_simple_idct_neon(DCTELEM *data); */ | 358 | /* void ff_simple_idct_neon(int16_t *data); */ |
| 359 | function ff_simple_idct_neon, export=1 | 359 | function ff_simple_idct_neon, export=1 |
| 360 | idct_start r0 | 360 | idct_start r0 |
| 361 | 361 | ||
| @@ -24,9 +24,9 @@ · 23 unmodified lines | |||
| 24 | #include "libavcodec/dsputil.h" | 24 | #include "libavcodec/dsputil.h" |
| 25 | #include "libavcodec/vp3dsp.h" | 25 | #include "libavcodec/vp3dsp.h" |
| 26 | 26 | ||
| 27 | void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data); | 27 | void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data); |
| 28 | void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data); | 28 | void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data); |
| 29 | void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data); | 29 | void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data); |
| 30 | 30 | ||
| 31 | void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *); | 31 | void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *); |
| 32 | void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *); | 32 | void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *); |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | 23 | ||
| 24 | #if HAVE_ARMV6_EXTERNAL | 24 | #if HAVE_ARMV6_EXTERNAL |
| 25 | #define decode_block_coeffs_internal ff_decode_block_coeffs_armv6 | 25 | #define decode_block_coeffs_internal ff_decode_block_coeffs_armv6 |
| 26 | int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, DCTELEM block[16], | 26 | int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16], |
| 27 | uint8_t probs[8][3][NUM_DCT_TOKENS-1], | 27 | uint8_t probs[8][3][NUM_DCT_TOKENS-1], |
| 28 | int i, uint8_t *token_prob, int16_t qmul[2]); | 28 | int i, uint8_t *token_prob, int16_t qmul[2]); |
| 29 | #endif | 29 | #endif |
| @@ -56,7 +56,7 @@ · 55 unmodified lines | |||
| 56 | 56 | ||
| 57 | @ idct | 57 | @ idct |
| 58 | 58 | ||
| 59 | @ void vp8_luma_dc_wht(DCTELEM block[4][4][16], DCTELEM dc[16]) | 59 | @ void vp8_luma_dc_wht(int16_t block[4][4][16], int16_t dc[16]) |
| 60 | function ff_vp8_luma_dc_wht_armv6, export=1 | 60 | function ff_vp8_luma_dc_wht_armv6, export=1 |
| 61 | push {r4-r10, lr} | 61 | push {r4-r10, lr} |
| 62 | 62 | ||
| @@ -179,7 +179,7 @@ function ff_vp8_luma_dc_wht_armv6, export=1 · 116 unmodified lines | |||
| 179 | pop {r4-r10, pc} | 179 | pop {r4-r10, pc} |
| 180 | endfunc | 180 | endfunc |
| 181 | 181 | ||
| 182 | @ void vp8_luma_dc_wht_dc(DCTELEM block[4][4][16], DCTELEM dc[16]) | 182 | @ void vp8_luma_dc_wht_dc(int16_t block[4][4][16], int16_t dc[16]) |
| 183 | function ff_vp8_luma_dc_wht_dc_armv6, export=1 | 183 | function ff_vp8_luma_dc_wht_dc_armv6, export=1 |
| 184 | ldrsh r2, [r1] | 184 | ldrsh r2, [r1] |
| 185 | mov r3, #0 | 185 | mov r3, #0 |
| @@ -192,7 +192,7 @@ function ff_vp8_luma_dc_wht_dc_armv6, export=1 · 6 unmodified lines | |||
| 192 | bx lr | 192 | bx lr |
| 193 | endfunc | 193 | endfunc |
| 194 | 194 | ||
| 195 | @ void vp8_idct_add(uint8_t *dst, DCTELEM block[16], int stride) | 195 | @ void vp8_idct_add(uint8_t *dst, int16_t block[16], int stride) |
| 196 | function ff_vp8_idct_add_armv6, export=1 | 196 | function ff_vp8_idct_add_armv6, export=1 |
| 197 | push {r4-r12, lr} | 197 | push {r4-r12, lr} |
| 198 | sub sp, sp, #32 | 198 | sub sp, sp, #32 |
| @@ -314,7 +314,7 @@ function ff_vp8_idct_add_armv6, export=1 · 115 unmodified lines | |||
| 314 | pop {r4-r12, pc} | 314 | pop {r4-r12, pc} |
| 315 | endfunc | 315 | endfunc |
| 316 | 316 | ||
| 317 | @ void vp8_idct_dc_add(uint8_t *dst, DCTELEM block[16], int stride) | 317 | @ void vp8_idct_dc_add(uint8_t *dst, int16_t block[16], int stride) |
| 318 | function ff_vp8_idct_dc_add_armv6, export=1 | 318 | function ff_vp8_idct_dc_add_armv6, export=1 |
| 319 | push {r4-r6, lr} | 319 | push {r4-r6, lr} |
| 320 | add r6, r0, r2, lsl #1 | 320 | add r6, r0, r2, lsl #1 |
| @@ -355,7 +355,7 @@ function ff_vp8_idct_dc_add_armv6, export=1 · 34 unmodified lines | |||
| 355 | pop {r4-r6, pc} | 355 | pop {r4-r6, pc} |
| 356 | endfunc | 356 | endfunc |
| 357 | 357 | ||
| 358 | @ void vp8_idct_dc_add4uv(uint8_t *dst, DCTELEM block[4][16], int stride) | 358 | @ void vp8_idct_dc_add4uv(uint8_t *dst, int16_t block[4][16], int stride) |
| 359 | function ff_vp8_idct_dc_add4uv_armv6, export=1 | 359 | function ff_vp8_idct_dc_add4uv_armv6, export=1 |
| 360 | push {r4, lr} | 360 | push {r4, lr} |
| 361 | 361 | ||
| @@ -371,7 +371,7 @@ function ff_vp8_idct_dc_add4uv_armv6, export=1 · 9 unmodified lines | |||
| 371 | pop {r4, pc} | 371 | pop {r4, pc} |
| 372 | endfunc | 372 | endfunc |
| 373 | 373 | ||
| 374 | @ void vp8_idct_dc_add4y(uint8_t *dst, DCTELEM block[4][16], int stride) | 374 | @ void vp8_idct_dc_add4y(uint8_t *dst, int16_t block[4][16], int stride) |
| 375 | function ff_vp8_idct_dc_add4y_armv6, export=1 | 375 | function ff_vp8_idct_dc_add4y_armv6, export=1 |
| 376 | push {r4, lr} | 376 | push {r4, lr} |
| 377 | 377 | ||
| @@ -22,13 +22,13 @@ · 21 unmodified lines | |||
| 22 | #include "libavcodec/vp8dsp.h" | 22 | #include "libavcodec/vp8dsp.h" |
| 23 | #include "vp8dsp.h" | 23 | #include "vp8dsp.h" |
| 24 | 24 | ||
| 25 | void ff_vp8_luma_dc_wht_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]); | 25 | void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]); |
| 26 | void ff_vp8_luma_dc_wht_dc_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]); | 26 | void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]); |
| 27 | 27 | ||
| 28 | void ff_vp8_idct_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 28 | void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 29 | void ff_vp8_idct_dc_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 29 | void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 30 | void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); | 30 | void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); |
| 31 | void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); | 31 | void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); |
| 32 | 32 | ||
| 33 | VP8_LF(armv6); | 33 | VP8_LF(armv6); |
| 34 | 34 | ||
| @@ -22,12 +22,12 @@ · 21 unmodified lines | |||
| 22 | #include "libavcodec/vp8dsp.h" | 22 | #include "libavcodec/vp8dsp.h" |
| 23 | #include "vp8dsp.h" | 23 | #include "vp8dsp.h" |
| 24 | 24 | ||
| 25 | void ff_vp8_luma_dc_wht_neon(DCTELEM block[4][4][16], DCTELEM dc[16]); | 25 | void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]); |
| 26 | 26 | ||
| 27 | void ff_vp8_idct_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 27 | void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 28 | void ff_vp8_idct_dc_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 28 | void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 29 | void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); | 29 | void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); |
| 30 | void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride); | 30 | void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride); |
| 31 | 31 | ||
| 32 | VP8_LF(neon); | 32 | VP8_LF(neon); |
| 33 | 33 | ||
| @@ -48,7 +48,7 @@ typedef struct ASV1Context{ · 47 unmodified lines | |||
| 48 | int mb_height; | 48 | int mb_height; |
| 49 | int mb_width2; | 49 | int mb_width2; |
| 50 | int mb_height2; | 50 | int mb_height2; |
| 51 | DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; | 51 | DECLARE_ALIGNED(16, int16_t, block)[6][64]; |
| 52 | uint16_t intra_matrix[64]; | 52 | uint16_t intra_matrix[64]; |
| 53 | int q_intra_matrix[64]; | 53 | int q_intra_matrix[64]; |
| 54 | uint8_t *bitstream_buffer; | 54 | uint8_t *bitstream_buffer; |
| @@ -97,7 +97,7 @@ static inline int asv2_get_level(GetBitContext *gb) · 96 unmodified lines | |||
| 97 | return code - 31; | 97 | return code - 31; |
| 98 | } | 98 | } |
| 99 | 99 | ||
| 100 | static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]) | 100 | static inline int asv1_decode_block(ASV1Context *a, int16_t block[64]) |
| 101 | { | 101 | { |
| 102 | int i; | 102 | int i; |
| 103 | 103 | ||
| @@ -128,7 +128,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64]) · 24 unmodified lines | |||
| 128 | return 0; | 128 | return 0; |
| 129 | } | 129 | } |
| 130 | 130 | ||
| 131 | static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64]) | 131 | static inline int asv2_decode_block(ASV1Context *a, int16_t block[64]) |
| 132 | { | 132 | { |
| 133 | int i, count, ccp; | 133 | int i, count, ccp; |
| 134 | 134 | ||
| @@ -164,7 +164,7 @@ static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64]) · 29 unmodified lines | |||
| 164 | return 0; | 164 | return 0; |
| 165 | } | 165 | } |
| 166 | 166 | ||
| 167 | static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]) | 167 | static inline int decode_mb(ASV1Context *a, int16_t block[6][64]) |
| 168 | { | 168 | { |
| 169 | int i; | 169 | int i; |
| 170 | 170 | ||
| @@ -186,7 +186,7 @@ static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64]) · 15 unmodified lines | |||
| 186 | 186 | ||
| 187 | static inline void idct_put(ASV1Context *a, int mb_x, int mb_y) | 187 | static inline void idct_put(ASV1Context *a, int mb_x, int mb_y) |
| 188 | { | 188 | { |
| 189 | DCTELEM (*block)[64] = a->block; | 189 | int16_t (*block)[64] = a->block; |
| 190 | int linesize = a->picture.linesize[0]; | 190 | int linesize = a->picture.linesize[0]; |
| 191 | 191 | ||
| 192 | uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; | 192 | uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; |
| @@ -55,7 +55,7 @@ static inline void asv2_put_level(PutBitContext *pb, int level){ · 54 unmodified lines | |||
| 55 | } | 55 | } |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){ | 58 | static inline void asv1_encode_block(ASV1Context *a, int16_t block[64]){ |
| 59 | int i; | 59 | int i; |
| 60 | int nc_count=0; | 60 | int nc_count=0; |
| 61 | 61 | ||
| @@ -88,7 +88,7 @@ static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){ · 26 unmodified lines | |||
| 88 | put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]); | 88 | put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]); |
| 89 | } | 89 | } |
| 90 | 90 | ||
| 91 | static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){ | 91 | static inline void asv2_encode_block(ASV1Context *a, int16_t block[64]){ |
| 92 | int i; | 92 | int i; |
| 93 | int count=0; | 93 | int count=0; |
| 94 | 94 | ||
| @@ -129,7 +129,7 @@ static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){ · 34 unmodified lines | |||
| 129 | 129 | ||
| 130 | #define MAX_MB_SIZE (30*16*16*3/2/8) | 130 | #define MAX_MB_SIZE (30*16*16*3/2/8) |
| 131 | 131 | ||
| 132 | static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){ | 132 | static inline int encode_mb(ASV1Context *a, int16_t block[6][64]){ |
| 133 | int i; | 133 | int i; |
| 134 | 134 | ||
| 135 | if (a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < MAX_MB_SIZE) { | 135 | 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]){ · 12 unmodified lines | |||
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ | 150 | static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){ |
| 151 | DCTELEM (*block)[64]= a->block; | 151 | int16_t (*block)[64]= a->block; |
| 152 | int linesize= a->picture.linesize[0]; | 152 | int linesize= a->picture.linesize[0]; |
| 153 | int i; | 153 | int i; |
| 154 | 154 | ||
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | low level assembler interface wrapper | 21 | low level assembler interface wrapper |
| 22 | 22 | ||
| 23 | DEFUN(put_pixels_clamped,mL1, | 23 | DEFUN(put_pixels_clamped,mL1, |
| 24 | (DCTELEM *block, uint8_t *dest, int line_size)): | 24 | (int16_t *block, uint8_t *dest, int line_size)): |
| 25 | 25 | ||
| 26 | body | 26 | body |
| 27 | 27 | ||
| @@ -27,20 +27,20 @@ · 26 unmodified lines | |||
| 27 | 27 | ||
| 28 | int off; | 28 | int off; |
| 29 | 29 | ||
| 30 | static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block) | 30 | static void bfin_idct_add (uint8_t *dest, int line_size, int16_t *block) |
| 31 | { | 31 | { |
| 32 | ff_bfin_idct (block); | 32 | ff_bfin_idct (block); |
| 33 | ff_bfin_add_pixels_clamped (block, dest, line_size); | 33 | ff_bfin_add_pixels_clamped (block, dest, line_size); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block) | 36 | static void bfin_idct_put (uint8_t *dest, int line_size, int16_t *block) |
| 37 | { | 37 | { |
| 38 | ff_bfin_idct (block); | 38 | ff_bfin_idct (block); |
| 39 | ff_bfin_put_pixels_clamped (block, dest, line_size); | 39 | ff_bfin_put_pixels_clamped (block, dest, line_size); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | 42 | ||
| 43 | static void bfin_clear_blocks (DCTELEM *blocks) | 43 | static void bfin_clear_blocks (int16_t *blocks) |
| 44 | { | 44 | { |
| 45 | // This is just a simple memset. | 45 | // This is just a simple memset. |
| 46 | // | 46 | // |
| @@ -24,8 +24,9 @@ · 23 unmodified lines | |||
| 24 | #ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H | 24 | #ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H |
| 25 | #define AVCODEC_BFIN_DSPUTIL_BFIN_H | 25 | #define AVCODEC_BFIN_DSPUTIL_BFIN_H |
| 26 | 26 | ||
| 27 | #include <stdint.h> | ||
| 28 | |||
| 27 | #include "config.h" | 29 | #include "config.h" |
| 28 | #include "libavcodec/dsputil.h" | ||
| 29 | 30 | ||
| 30 | #if defined(__FDPIC__) && CONFIG_SRAM | 31 | #if defined(__FDPIC__) && CONFIG_SRAM |
| 31 | #define attribute_l1_text __attribute__ ((l1_text)) | 32 | #define attribute_l1_text __attribute__ ((l1_text)) |
| @@ -35,15 +36,15 @@ · 3 unmodified lines | |||
| 35 | #define attribute_l1_data_b | 36 | #define attribute_l1_data_b |
| 36 | #endif | 37 | #endif |
| 37 | 38 | ||
| 38 | void ff_bfin_idct (DCTELEM *block) attribute_l1_text; | 39 | void ff_bfin_idct (int16_t *block) attribute_l1_text; |
| 39 | void ff_bfin_fdct (DCTELEM *block) attribute_l1_text; | 40 | void ff_bfin_fdct (int16_t *block) attribute_l1_text; |
| 40 | void ff_bfin_vp3_idct (DCTELEM *block); | 41 | void ff_bfin_vp3_idct (int16_t *block); |
| 41 | void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block); | 42 | void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block); |
| 42 | void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block); | 43 | void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block); |
| 43 | void ff_bfin_add_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text; | 44 | void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text; |
| 44 | void ff_bfin_put_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text; | 45 | void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text; |
| 45 | void ff_bfin_diff_pixels (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text; | 46 | void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text; |
| 46 | void ff_bfin_get_pixels (DCTELEM *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text; | 47 | void ff_bfin_get_pixels (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text; |
| 47 | int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text; | 48 | int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text; |
| 48 | int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; | 49 | int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; |
| 49 | int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; | 50 | int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text; |
| @@ -20,7 +20,7 @@ · 19 unmodified lines | |||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ | 21 | */ |
| 22 | /* | 22 | /* |
| 23 | void ff_bfin_fdct (DCTELEM *buf); | 23 | void ff_bfin_fdct (int16_t *buf); |
| 24 | 24 | ||
| 25 | This implementation works only for 8x8 input. The range of input | 25 | This implementation works only for 8x8 input. The range of input |
| 26 | must be -256 to 255 i.e. 8bit input represented in a 16bit data | 26 | must be -256 to 255 i.e. 8bit input represented in a 16bit data |
| @@ -61,9 +61,9 @@ Notation · 34 unmodified lines | |||
| 61 | Other registers used: | 61 | Other registers used: |
| 62 | I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0. | 62 | I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0. |
| 63 | 63 | ||
| 64 | Input - r0 - pointer to start of DCTELEM *block | 64 | Input - r0 - pointer to start of int16_t *block |
| 65 | 65 | ||
| 66 | Output - The DCT output coefficients in the DCTELEM *block | 66 | Output - The DCT output coefficients in the int16_t *block |
| 67 | 67 | ||
| 68 | Register constraint: | 68 | Register constraint: |
| 69 | This code is called from jpeg_encode. | 69 | This code is called from jpeg_encode. |
| @@ -145,7 +145,7 @@ vtmp: .space 128 · 75 unmodified lines | |||
| 145 | 145 | ||
| 146 | .text | 146 | .text |
| 147 | DEFUN(fdct,mL1, | 147 | DEFUN(fdct,mL1, |
| 148 | (DCTELEM *block)): | 148 | (int16_t *block)): |
| 149 | [--SP] = (R7:4, P5:3); // Push the registers onto the stack. | 149 | [--SP] = (R7:4, P5:3); // Push the registers onto the stack. |
| 150 | 150 | ||
| 151 | b0 = r0; | 151 | b0 = r0; |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | /* | 22 | /* |
| 23 | This blackfin DSP code implements an 8x8 inverse type II DCT. | 23 | This blackfin DSP code implements an 8x8 inverse type II DCT. |
| 24 | 24 | ||
| 25 | Prototype : void ff_bfin_idct(DCTELEM *in) | 25 | Prototype : void ff_bfin_idct(int16_t *in) |
| 26 | 26 | ||
| 27 | Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. | 27 | Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. |
| 28 | 28 | ||
| @@ -90,7 +90,7 @@ vtmp: .space 256 · 61 unmodified lines | |||
| 90 | 90 | ||
| 91 | .text | 91 | .text |
| 92 | DEFUN(idct,mL1, | 92 | DEFUN(idct,mL1, |
| 93 | (DCTELEM *block)): | 93 | (int16_t *block)): |
| 94 | 94 | ||
| 95 | /********************** Function Prologue *********************************/ | 95 | /********************** Function Prologue *********************************/ |
| 96 | link 16; | 96 | link 16; |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | #include "dsputil_bfin.h" | 26 | #include "dsputil_bfin.h" |
| 27 | 27 | ||
| 28 | static int dct_quantize_bfin (MpegEncContext *s, | 28 | static int dct_quantize_bfin (MpegEncContext *s, |
| 29 | DCTELEM *block, int n, | 29 | int16_t *block, int n, |
| 30 | int qscale, int *overflow) | 30 | int qscale, int *overflow) |
| 31 | { | 31 | { |
| 32 | int last_non_zero, q, start_i; | 32 | int last_non_zero, q, start_i; |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | |||
| 21 | #include "config_bfin.h" | 21 | #include "config_bfin.h" |
| 22 | 22 | ||
| 23 | DEFUN(put_pixels_clamped,mL1, | 23 | DEFUN(put_pixels_clamped,mL1, |
| 24 | (DCTELEM *block, uint8_t *dest, int line_size)): | 24 | (int16_t *block, uint8_t *dest, int line_size)): |
| 25 | [--SP] = (R7:4); | 25 | [--SP] = (R7:4); |
| 26 | R4 = 0; | 26 | R4 = 0; |
| 27 | R5.l = 0x00ff; | 27 | R5.l = 0x00ff; |
| @@ -51,7 +51,7 @@ ppc$1: R2 = Max(R0, R4) (V) || [I1++M1] = R6; · 23 unmodified lines | |||
| 51 | DEFUN_END(put_pixels_clamped) | 51 | DEFUN_END(put_pixels_clamped) |
| 52 | 52 | ||
| 53 | DEFUN(add_pixels_clamped,mL1, | 53 | DEFUN(add_pixels_clamped,mL1, |
| 54 | (DCTELEM *block, uint8_t *dest, int line_size)): | 54 | (int16_t *block, uint8_t *dest, int line_size)): |
| 55 | [-- SP] = (R7:4); | 55 | [-- SP] = (R7:4); |
| 56 | R4 = 0; | 56 | R4 = 0; |
| 57 | I0 = 0; | 57 | I0 = 0; |
| @@ -442,7 +442,7 @@ LE$8OT: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5; · 384 unmodified lines | |||
| 442 | rts; | 442 | rts; |
| 443 | 443 | ||
| 444 | DEFUN(diff_pixels,mL1, | 444 | DEFUN(diff_pixels,mL1, |
| 445 | (DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)): | 445 | (int16_t *block, uint8_t *s1, uint8_t *s2, int stride)): |
| 446 | link 0; | 446 | link 0; |
| 447 | [--sp] = (r7:4); | 447 | [--sp] = (r7:4); |
| 448 | p0=8; | 448 | p0=8; |
| @@ -518,7 +518,7 @@ DEFUN_END(pix_sum) · 69 unmodified lines | |||
| 518 | 518 | ||
| 519 | 519 | ||
| 520 | DEFUN(get_pixels,mL1, | 520 | DEFUN(get_pixels,mL1, |
| 521 | (DCTELEM *restrict block, const uint8_t *pixels, int line_size)): | 521 | (int16_t *restrict block, const uint8_t *pixels, int line_size)): |
| 522 | [--sp] = (r7:4); | 522 | [--sp] = (r7:4); |
| 523 | i3=r0; // dest | 523 | i3=r0; // dest |
| 524 | i0=r1; // src0 | 524 | i0=r1; // src0 |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #include "dsputil_bfin.h" | 23 | #include "dsputil_bfin.h" |
| 24 | 24 | ||
| 25 | /* Intra iDCT offset 128 */ | 25 | /* Intra iDCT offset 128 */ |
| 26 | void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block) | 26 | void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block) |
| 27 | { | 27 | { |
| 28 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128; | 28 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128; |
| 29 | int i,j; | 29 | int i,j; |
| @@ -36,7 +36,7 @@ void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block) · 6 unmodified lines | |||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | /* Inter iDCT */ | 38 | /* Inter iDCT */ |
| 39 | void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block) | 39 | void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block) |
| 40 | { | 40 | { |
| 41 | ff_bfin_vp3_idct (block); | 41 | ff_bfin_vp3_idct (block); |
| 42 | ff_bfin_add_pixels_clamped (block, dest, line_size); | 42 | ff_bfin_add_pixels_clamped (block, dest, line_size); |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | /* | 22 | /* |
| 23 | This blackfin DSP code implements an 8x8 inverse type II DCT. | 23 | This blackfin DSP code implements an 8x8 inverse type II DCT. |
| 24 | 24 | ||
| 25 | Prototype : void ff_bfin_vp3_idct(DCTELEM *in) | 25 | Prototype : void ff_bfin_vp3_idct(int16_t *in) |
| 26 | 26 | ||
| 27 | Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. | 27 | Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0. |
| 28 | 28 | ||
| @@ -63,7 +63,7 @@ vtmp: .space 256 · 34 unmodified lines | |||
| 63 | 63 | ||
| 64 | .text | 64 | .text |
| 65 | DEFUN(vp3_idct,mL1, | 65 | DEFUN(vp3_idct,mL1, |
| 66 | (DCTELEM *block)): | 66 | (int16_t *block)): |
| 67 | 67 | ||
| 68 | /********************** Function Prologue *********************************/ | 68 | /********************** Function Prologue *********************************/ |
| 69 | link 16; | 69 | link 16; |
| @@ -696,7 +696,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t * · 695 unmodified lines | |||
| 696 | * @param masks_count number of masks to decode | 696 | * @param masks_count number of masks to decode |
| 697 | * @return 0 on success, negative value in other cases | 697 | * @return 0 on success, negative value in other cases |
| 698 | */ | 698 | */ |
| 699 | static int read_residue(GetBitContext *gb, DCTELEM block[64], int masks_count) | 699 | static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count) |
| 700 | { | 700 | { |
| 701 | int coef_list[128]; | 701 | int coef_list[128]; |
| 702 | int mode_list[128]; | 702 | int mode_list[128]; |
| @@ -800,7 +800,7 @@ static int binkb_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, · 97 unmodified lines | |||
| 800 | int v, col[2]; | 800 | int v, col[2]; |
| 801 | const uint8_t *scan; | 801 | const uint8_t *scan; |
| 802 | int xoff, yoff; | 802 | int xoff, yoff; |
| 803 | LOCAL_ALIGNED_16(DCTELEM, block, [64]); | 803 | LOCAL_ALIGNED_16(int16_t, block, [64]); |
| 804 | LOCAL_ALIGNED_16(int32_t, dctblock, [64]); | 804 | LOCAL_ALIGNED_16(int32_t, dctblock, [64]); |
| 805 | int coordmap[64]; | 805 | int coordmap[64]; |
| 806 | int ybias = is_key ? -15 : 0; | 806 | int ybias = is_key ? -15 : 0; |
| @@ -946,7 +946,7 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx, · 139 unmodified lines | |||
| 946 | int v, col[2]; | 946 | int v, col[2]; |
| 947 | const uint8_t *scan; | 947 | const uint8_t *scan; |
| 948 | int xoff, yoff; | 948 | int xoff, yoff; |
| 949 | LOCAL_ALIGNED_16(DCTELEM, block, [64]); | 949 | LOCAL_ALIGNED_16(int16_t, block, [64]); |
| 950 | LOCAL_ALIGNED_16(uint8_t, ublock, [64]); | 950 | LOCAL_ALIGNED_16(uint8_t, ublock, [64]); |
| 951 | LOCAL_ALIGNED_16(int32_t, dctblock, [64]); | 951 | LOCAL_ALIGNED_16(int32_t, dctblock, [64]); |
| 952 | int coordmap[64]; | 952 | int coordmap[64]; |
| @@ -713,7 +713,7 @@ void ff_cavs_init_top_lines(AVSContext *h) { · 712 unmodified lines | |||
| 713 | /* alloc space for co-located MVs and types */ | 713 | /* alloc space for co-located MVs and types */ |
| 714 | h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); | 714 | h->col_mv = av_malloc( h->mb_width*h->mb_height*4*sizeof(cavs_vector)); |
| 715 | h->col_type_base = av_malloc(h->mb_width*h->mb_height); | 715 | h->col_type_base = av_malloc(h->mb_width*h->mb_height); |
| 716 | h->block = av_mallocz(64*sizeof(DCTELEM)); | 716 | h->block = av_mallocz(64*sizeof(int16_t)); |
| 717 | } | 717 | } |
| 718 | 718 | ||
| 719 | av_cold int ff_cavs_init(AVCodecContext *avctx) { | 719 | av_cold int ff_cavs_init(AVCodecContext *avctx) { |
| @@ -234,7 +234,7 @@ typedef struct AVSContext { · 233 unmodified lines | |||
| 234 | uint8_t *edge_emu_buffer; | 234 | uint8_t *edge_emu_buffer; |
| 235 | 235 | ||
| 236 | int got_keyframe; | 236 | int got_keyframe; |
| 237 | DCTELEM *block; | 237 | int16_t *block; |
| 238 | } AVSContext; | 238 | } AVSContext; |
| 239 | 239 | ||
| 240 | extern const uint8_t ff_cavs_partition_flags[30]; | 240 | extern const uint8_t ff_cavs_partition_flags[30]; |
| @@ -516,8 +516,8 @@ static inline int get_ue_code(GetBitContext *gb, int order) · 515 unmodified lines | |||
| 516 | return get_ue_golomb(gb); | 516 | return get_ue_golomb(gb); |
| 517 | } | 517 | } |
| 518 | 518 | ||
| 519 | static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf, | 519 | static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf, |
| 520 | DCTELEM *dst, int mul, int shift, int coeff_num) | 520 | int16_t *dst, int mul, int shift, int coeff_num) |
| 521 | { | 521 | { |
| 522 | int round = 1 << (shift - 1); | 522 | int round = 1 << (shift - 1); |
| 523 | int pos = -1; | 523 | int pos = -1; |
| @@ -551,9 +551,9 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb, · 27 unmodified lines | |||
| 551 | int qp, uint8_t *dst, int stride) | 551 | int qp, uint8_t *dst, int stride) |
| 552 | { | 552 | { |
| 553 | int i, level_code, esc_code, level, run, mask; | 553 | int i, level_code, esc_code, level, run, mask; |
| 554 | DCTELEM level_buf[65]; | 554 | int16_t level_buf[65]; |
| 555 | uint8_t run_buf[65]; | 555 | uint8_t run_buf[65]; |
| 556 | DCTELEM *block = h->block; | 556 | int16_t *block = h->block; |
| 557 | 557 | ||
| 558 | for (i = 0;i < 65; i++) { | 558 | for (i = 0;i < 65; i++) { |
| 559 | level_code = get_ue_code(gb, r->golomb_order); | 559 | level_code = get_ue_code(gb, r->golomb_order); |
| @@ -183,9 +183,9 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc · 182 unmodified lines | |||
| 183 | * | 183 | * |
| 184 | ****************************************************************************/ | 184 | ****************************************************************************/ |
| 185 | 185 | ||
| 186 | static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) { | 186 | static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) { |
| 187 | int i; | 187 | int i; |
| 188 | DCTELEM (*src)[8] = (DCTELEM(*)[8])block; | 188 | int16_t (*src)[8] = (int16_t(*)[8])block; |
| 189 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; | 189 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; |
| 190 | 190 | ||
| 191 | src[0][0] += 8; | 191 | src[0][0] += 8; |
| @@ -32,7 +32,7 @@ typedef struct CAVSDSPContext { · 31 unmodified lines | |||
| 32 | void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); | 32 | void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); |
| 33 | void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); | 33 | void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); |
| 34 | void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); | 34 | void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2); |
| 35 | void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride); | 35 | void (*cavs_idct8_add)(uint8_t *dst, int16_t *block, int stride); |
| 36 | int idct_perm; | 36 | int idct_perm; |
| 37 | } CAVSDSPContext; | 37 | } CAVSDSPContext; |
| 38 | 38 | ||
| @@ -39,6 +39,7 @@ · 38 unmodified lines | |||
| 39 | #include "libavutil/lfg.h" | 39 | #include "libavutil/lfg.h" |
| 40 | #include "libavutil/time.h" | 40 | #include "libavutil/time.h" |
| 41 | 41 | ||
| 42 | #include "dsputil.h" | ||
| 42 | #include "simple_idct.h" | 43 | #include "simple_idct.h" |
| 43 | #include "aandcttab.h" | 44 | #include "aandcttab.h" |
| 44 | #include "faandct.h" | 45 | #include "faandct.h" |
| @@ -49,24 +50,24 @@ · 4 unmodified lines | |||
| 49 | #undef printf | 50 | #undef printf |
| 50 | 51 | ||
| 51 | // BFIN | 52 | // BFIN |
| 52 | void ff_bfin_idct(DCTELEM *block); | 53 | void ff_bfin_idct(int16_t *block); |
| 53 | void ff_bfin_fdct(DCTELEM *block); | 54 | void ff_bfin_fdct(int16_t *block); |
| 54 | 55 | ||
| 55 | // ALTIVEC | 56 | // ALTIVEC |
| 56 | void ff_fdct_altivec(DCTELEM *block); | 57 | void ff_fdct_altivec(int16_t *block); |
| 57 | 58 | ||
| 58 | // ARM | 59 | // ARM |
| 59 | void ff_j_rev_dct_arm(DCTELEM *data); | 60 | void ff_j_rev_dct_arm(int16_t *data); |
| 60 | void ff_simple_idct_arm(DCTELEM *data); | 61 | void ff_simple_idct_arm(int16_t *data); |
| 61 | void ff_simple_idct_armv5te(DCTELEM *data); | 62 | void ff_simple_idct_armv5te(int16_t *data); |
| 62 | void ff_simple_idct_armv6(DCTELEM *data); | 63 | void ff_simple_idct_armv6(int16_t *data); |
| 63 | void ff_simple_idct_neon(DCTELEM *data); | 64 | void ff_simple_idct_neon(int16_t *data); |
| 64 | 65 | ||
| 65 | void ff_simple_idct_axp(DCTELEM *data); | 66 | void ff_simple_idct_axp(int16_t *data); |
| 66 | 67 | ||
| 67 | struct algo { | 68 | struct algo { |
| 68 | const char *name; | 69 | const char *name; |
| 69 | void (*func)(DCTELEM *block); | 70 | void (*func)(int16_t *block); |
| 70 | enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM, | 71 | enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM, |
| 71 | SSE2_PERM, PARTTRANS_PERM } format; | 72 | SSE2_PERM, PARTTRANS_PERM } format; |
| 72 | int mm_support; | 73 | int mm_support; |
| @@ -166,10 +167,10 @@ static void idct_mmx_init(void) · 93 unmodified lines | |||
| 166 | } | 167 | } |
| 167 | } | 168 | } |
| 168 | 169 | ||
| 169 | DECLARE_ALIGNED(16, static DCTELEM, block)[64]; | 170 | DECLARE_ALIGNED(16, static int16_t, block)[64]; |
| 170 | DECLARE_ALIGNED(8, static DCTELEM, block1)[64]; | 171 | DECLARE_ALIGNED(8, static int16_t, block1)[64]; |
| 171 | 172 | ||
| 172 | static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng) | 173 | static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng) |
| 173 | { | 174 | { |
| 174 | int i, j; | 175 | int i, j; |
| 175 | 176 | ||
| @@ -197,7 +198,7 @@ static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng) · 21 unmodified lines | |||
| 197 | } | 198 | } |
| 198 | } | 199 | } |
| 199 | 200 | ||
| 200 | static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm) | 201 | static void permute(int16_t dst[64], const int16_t src[64], int perm) |
| 201 | { | 202 | { |
| 202 | int i; | 203 | int i; |
| 203 | 204 | ||
| @@ -221,7 +222,7 @@ static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm) · 17 unmodified lines | |||
| 221 | 222 | ||
| 222 | static int dct_error(const struct algo *dct, int test, int is_idct, int speed) | 223 | static int dct_error(const struct algo *dct, int test, int is_idct, int speed) |
| 223 | { | 224 | { |
| 224 | void (*ref)(DCTELEM *block) = is_idct ? ff_ref_idct : ff_ref_fdct; | 225 | void (*ref)(int16_t *block) = is_idct ? ff_ref_idct : ff_ref_fdct; |
| 225 | int it, i, scale; | 226 | int it, i, scale; |
| 226 | int err_inf, v; | 227 | int err_inf, v; |
| 227 | int64_t err2, ti, ti1, it1, err_sum = 0; | 228 | int64_t err2, ti, ti1, it1, err_sum = 0; |
| @@ -44,19 +44,19 @@ typedef struct DNXHDContext { · 43 unmodified lines | |||
| 44 | VLC ac_vlc, dc_vlc, run_vlc; | 44 | VLC ac_vlc, dc_vlc, run_vlc; |
| 45 | int last_dc[3]; | 45 | int last_dc[3]; |
| 46 | DSPContext dsp; | 46 | DSPContext dsp; |
| 47 | DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; | 47 | DECLARE_ALIGNED(16, int16_t, blocks)[8][64]; |
| 48 | ScanTable scantable; | 48 | ScanTable scantable; |
| 49 | const CIDEntry *cid_table; | 49 | const CIDEntry *cid_table; |
| 50 | int bit_depth; // 8, 10 or 0 if not initialized at all. | 50 | int bit_depth; // 8, 10 or 0 if not initialized at all. |
| 51 | void (*decode_dct_block)(struct DNXHDContext *ctx, DCTELEM *block, | 51 | void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block, |
| 52 | int n, int qscale); | 52 | int n, int qscale); |
| 53 | } DNXHDContext; | 53 | } DNXHDContext; |
| 54 | 54 | ||
| 55 | #define DNXHD_VLC_BITS 9 | 55 | #define DNXHD_VLC_BITS 9 |
| 56 | #define DNXHD_DC_VLC_BITS 7 | 56 | #define DNXHD_DC_VLC_BITS 7 |
| 57 | 57 | ||
| 58 | static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, int n, int qscale); | 58 | static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale); |
| 59 | static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, int n, int qscale); | 59 | static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale); |
| 60 | 60 | ||
| 61 | static av_cold int dnxhd_decode_init(AVCodecContext *avctx) | 61 | static av_cold int dnxhd_decode_init(AVCodecContext *avctx) |
| 62 | { | 62 | { |
| @@ -180,7 +180,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si · 117 unmodified lines | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, | 182 | static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, |
| 183 | DCTELEM *block, int n, | 183 | int16_t *block, int n, |
| 184 | int qscale, | 184 | int qscale, |
| 185 | int index_bits, | 185 | int index_bits, |
| 186 | int level_bias, | 186 | int level_bias, |
| @@ -250,13 +250,13 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx, · 63 unmodified lines | |||
| 250 | CLOSE_READER(bs, &ctx->gb); | 250 | CLOSE_READER(bs, &ctx->gb); |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, | 253 | static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, |
| 254 | int n, int qscale) | 254 | int n, int qscale) |
| 255 | { | 255 | { |
| 256 | dnxhd_decode_dct_block(ctx, block, n, qscale, 4, 32, 6); | 256 | dnxhd_decode_dct_block(ctx, block, n, qscale, 4, 32, 6); |
| 257 | } | 257 | } |
| 258 | 258 | ||
| 259 | static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, | 259 | static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, |
| 260 | int n, int qscale) | 260 | int n, int qscale) |
| 261 | { | 261 | { |
| 262 | dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4); | 262 | dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4); |
| @@ -44,7 +44,7 @@ static const AVClass class = { "dnxhd", av_default_item_name, options, LIBAVUTIL · 43 unmodified lines | |||
| 44 | 44 | ||
| 45 | #define LAMBDA_FRAC_BITS 10 | 45 | #define LAMBDA_FRAC_BITS 10 |
| 46 | 46 | ||
| 47 | static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size) | 47 | static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size) |
| 48 | { | 48 | { |
| 49 | int i; | 49 | int i; |
| 50 | for (i = 0; i < 4; i++) { | 50 | for (i = 0; i < 4; i++) { |
| @@ -61,7 +61,7 @@ static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t · 10 unmodified lines | |||
| 61 | memcpy(block + 24, block - 32, sizeof(*block) * 8); | 61 | memcpy(block + 24, block - 32, sizeof(*block) * 8); |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size) | 64 | static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *restrict block, const uint8_t *pixels, int line_size) |
| 65 | { | 65 | { |
| 66 | int i; | 66 | int i; |
| 67 | 67 | ||
| @@ -73,7 +73,7 @@ static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict bl · 5 unmodified lines | |||
| 73 | } | 73 | } |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block, | 76 | static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block, |
| 77 | int n, int qscale, int *overflow) | 77 | int n, int qscale, int *overflow) |
| 78 | { | 78 | { |
| 79 | const uint8_t *scantable= ctx->intra_scantable.scantable; | 79 | const uint8_t *scantable= ctx->intra_scantable.scantable; |
| @@ -370,7 +370,7 @@ static av_always_inline void dnxhd_encode_dc(DNXHDEncContext *ctx, int diff) · 290 unmodified lines | |||
| 370 | (ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1))); | 370 | (ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1))); |
| 371 | } | 371 | } |
| 372 | 372 | ||
| 373 | static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *block, int last_index, int n) | 373 | static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block, int last_index, int n) |
| 374 | { | 374 | { |
| 375 | int last_non_zero = 0; | 375 | int last_non_zero = 0; |
| 376 | int slevel, i, j; | 376 | int slevel, i, j; |
| @@ -393,7 +393,7 @@ static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *b · 16 unmodified lines | |||
| 393 | put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB | 393 | put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB |
| 394 | } | 394 | } |
| 395 | 395 | ||
| 396 | static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index) | 396 | static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n, int qscale, int last_index) |
| 397 | { | 397 | { |
| 398 | const uint8_t *weight_matrix; | 398 | const uint8_t *weight_matrix; |
| 399 | int level; | 399 | int level; |
| @@ -434,7 +434,7 @@ static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *b · 34 unmodified lines | |||
| 434 | } | 434 | } |
| 435 | } | 435 | } |
| 436 | 436 | ||
| 437 | static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block) | 437 | static av_always_inline int dnxhd_ssd_block(int16_t *qblock, int16_t *block) |
| 438 | { | 438 | { |
| 439 | int score = 0; | 439 | int score = 0; |
| 440 | int i; | 440 | int i; |
| @@ -443,7 +443,7 @@ static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block) · 2 unmodified lines | |||
| 443 | return score; | 443 | return score; |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *block, int last_index) | 446 | static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index) |
| 447 | { | 447 | { |
| 448 | int last_non_zero = 0; | 448 | int last_non_zero = 0; |
| 449 | int bits = 0; | 449 | int bits = 0; |
| @@ -512,7 +512,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i · 62 unmodified lines | |||
| 512 | DNXHDEncContext *ctx = avctx->priv_data; | 512 | DNXHDEncContext *ctx = avctx->priv_data; |
| 513 | int mb_y = jobnr, mb_x; | 513 | int mb_y = jobnr, mb_x; |
| 514 | int qscale = ctx->qscale; | 514 | int qscale = ctx->qscale; |
| 515 | LOCAL_ALIGNED_16(DCTELEM, block, [64]); | 515 | LOCAL_ALIGNED_16(int16_t, block, [64]); |
| 516 | ctx = ctx->thread[threadnr]; | 516 | ctx = ctx->thread[threadnr]; |
| 517 | 517 | ||
| 518 | ctx->m.last_dc[0] = | 518 | ctx->m.last_dc[0] = |
| @@ -529,7 +529,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i · 10 unmodified lines | |||
| 529 | dnxhd_get_blocks(ctx, mb_x, mb_y); | 529 | dnxhd_get_blocks(ctx, mb_x, mb_y); |
| 530 | 530 | ||
| 531 | for (i = 0; i < 8; i++) { | 531 | for (i = 0; i < 8; i++) { |
| 532 | DCTELEM *src_block = ctx->blocks[i]; | 532 | int16_t *src_block = ctx->blocks[i]; |
| 533 | int overflow, nbits, diff, last_index; | 533 | int overflow, nbits, diff, last_index; |
| 534 | int n = dnxhd_switch_matrix(ctx, i); | 534 | int n = dnxhd_switch_matrix(ctx, i); |
| 535 | 535 | ||
| @@ -578,7 +578,7 @@ static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int · 42 unmodified lines | |||
| 578 | dnxhd_get_blocks(ctx, mb_x, mb_y); | 578 | dnxhd_get_blocks(ctx, mb_x, mb_y); |
| 579 | 579 | ||
| 580 | for (i = 0; i < 8; i++) { | 580 | for (i = 0; i < 8; i++) { |
| 581 | DCTELEM *block = ctx->blocks[i]; | 581 | int16_t *block = ctx->blocks[i]; |
| 582 | int overflow, n = dnxhd_switch_matrix(ctx, i); | 582 | int overflow, n = dnxhd_switch_matrix(ctx, i); |
| 583 | int last_index = ctx->m.dct_quantize(&ctx->m, block, i, | 583 | int last_index = ctx->m.dct_quantize(&ctx->m, block, i, |
| 584 | qscale, &overflow); | 584 | qscale, &overflow); |
| @@ -64,7 +64,7 @@ typedef struct DNXHDEncContext { · 63 unmodified lines | |||
| 64 | int nitris_compat; | 64 | int nitris_compat; |
| 65 | unsigned min_padding; | 65 | unsigned min_padding; |
| 66 | 66 | ||
| 67 | DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64]; | 67 | DECLARE_ALIGNED(16, int16_t, blocks)[8][64]; |
| 68 | 68 | ||
| 69 | int (*qmatrix_c) [64]; | 69 | int (*qmatrix_c) [64]; |
| 70 | int (*qmatrix_l) [64]; | 70 | int (*qmatrix_l) [64]; |
| @@ -92,7 +92,7 @@ typedef struct DNXHDEncContext { · 21 unmodified lines | |||
| 92 | RCCMPEntry *mb_cmp; | 92 | RCCMPEntry *mb_cmp; |
| 93 | RCEntry (*mb_rc)[8160]; | 93 | RCEntry (*mb_rc)[8160]; |
| 94 | 94 | ||
| 95 | void (*get_pixels_8x4_sym)(DCTELEM * /*align 16*/, const uint8_t *, int); | 95 | void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int); |
| 96 | } DNXHDEncContext; | 96 | } DNXHDEncContext; |
| 97 | 97 | ||
| 98 | void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx); | 98 | void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx); |
| @@ -336,7 +336,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h) · 335 unmodified lines | |||
| 336 | return s; | 336 | return s; |
| 337 | } | 337 | } |
| 338 | 338 | ||
| 339 | static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1, | 339 | static void diff_pixels_c(int16_t *restrict block, const uint8_t *s1, |
| 340 | const uint8_t *s2, int stride){ | 340 | const uint8_t *s2, int stride){ |
| 341 | int i; | 341 | int i; |
| 342 | 342 | ||
| @@ -357,7 +357,7 @@ static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1, · 14 unmodified lines | |||
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | 359 | ||
| 360 | static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, | 360 | static void put_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, |
| 361 | int line_size) | 361 | int line_size) |
| 362 | { | 362 | { |
| 363 | int i; | 363 | int i; |
| @@ -378,7 +378,7 @@ static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, · 14 unmodified lines | |||
| 378 | } | 378 | } |
| 379 | } | 379 | } |
| 380 | 380 | ||
| 381 | static void put_signed_pixels_clamped_c(const DCTELEM *block, | 381 | static void put_signed_pixels_clamped_c(const int16_t *block, |
| 382 | uint8_t *restrict pixels, | 382 | uint8_t *restrict pixels, |
| 383 | int line_size) | 383 | int line_size) |
| 384 | { | 384 | { |
| @@ -399,7 +399,7 @@ static void put_signed_pixels_clamped_c(const DCTELEM *block, · 14 unmodified lines | |||
| 399 | } | 399 | } |
| 400 | } | 400 | } |
| 401 | 401 | ||
| 402 | static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, | 402 | static void add_pixels_clamped_c(const int16_t *block, uint8_t *restrict pixels, |
| 403 | int line_size) | 403 | int line_size) |
| 404 | { | 404 | { |
| 405 | int i; | 405 | int i; |
| @@ -419,7 +419,7 @@ static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels, · 13 unmodified lines | |||
| 419 | } | 419 | } |
| 420 | } | 420 | } |
| 421 | 421 | ||
| 422 | static int sum_abs_dctelem_c(DCTELEM *block) | 422 | static int sum_abs_dctelem_c(int16_t *block) |
| 423 | { | 423 | { |
| 424 | int sum=0, i; | 424 | int sum=0, i; |
| 425 | for(i=0; i<64; i++) | 425 | 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){ · 1286 unmodified lines | |||
| 1712 | * @param scantable the used scantable, this is only used to speed the permutation up, the block is not | 1712 | * @param scantable the used scantable, this is only used to speed the permutation up, the block is not |
| 1713 | * (inverse) permutated to scantable order! | 1713 | * (inverse) permutated to scantable order! |
| 1714 | */ | 1714 | */ |
| 1715 | void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last) | 1715 | void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last) |
| 1716 | { | 1716 | { |
| 1717 | int i; | 1717 | int i; |
| 1718 | DCTELEM temp[64]; | 1718 | int16_t temp[64]; |
| 1719 | 1719 | ||
| 1720 | if(last<=0) return; | 1720 | if(last<=0) return; |
| 1721 | //if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations | 1721 | //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_ · 308 unmodified lines | |||
| 2030 | 2030 | ||
| 2031 | static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2031 | static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2032 | MpegEncContext * const s= (MpegEncContext *)c; | 2032 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2033 | LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | 2033 | LOCAL_ALIGNED_16(int16_t, temp, [64]); |
| 2034 | 2034 | ||
| 2035 | assert(h==8); | 2035 | assert(h==8); |
| 2036 | 2036 | ||
| @@ -2069,7 +2069,7 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 · 32 unmodified lines | |||
| 2069 | 2069 | ||
| 2070 | static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2070 | static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2071 | MpegEncContext * const s= (MpegEncContext *)c; | 2071 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2072 | DCTELEM dct[8][8]; | 2072 | int16_t dct[8][8]; |
| 2073 | int i; | 2073 | int i; |
| 2074 | int sum=0; | 2074 | int sum=0; |
| 2075 | 2075 | ||
| @@ -2094,7 +2094,7 @@ static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s · 18 unmodified lines | |||
| 2094 | 2094 | ||
| 2095 | static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2095 | static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2096 | MpegEncContext * const s= (MpegEncContext *)c; | 2096 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2097 | LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | 2097 | LOCAL_ALIGNED_16(int16_t, temp, [64]); |
| 2098 | int sum=0, i; | 2098 | int sum=0, i; |
| 2099 | 2099 | ||
| 2100 | assert(h==8); | 2100 | assert(h==8); |
| @@ -2110,8 +2110,8 @@ static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2 · 9 unmodified lines | |||
| 2110 | 2110 | ||
| 2111 | static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2111 | static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2112 | MpegEncContext * const s= (MpegEncContext *)c; | 2112 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2113 | LOCAL_ALIGNED_16(DCTELEM, temp, [64*2]); | 2113 | LOCAL_ALIGNED_16(int16_t, temp, [64*2]); |
| 2114 | DCTELEM * const bak = temp+64; | 2114 | int16_t * const bak = temp+64; |
| 2115 | int sum=0, i; | 2115 | int sum=0, i; |
| 2116 | 2116 | ||
| 2117 | assert(h==8); | 2117 | assert(h==8); |
| @@ -2119,7 +2119,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s · 1 unmodified line | |||
| 2119 | 2119 | ||
| 2120 | s->dsp.diff_pixels(temp, src1, src2, stride); | 2120 | s->dsp.diff_pixels(temp, src1, src2, stride); |
| 2121 | 2121 | ||
| 2122 | memcpy(bak, temp, 64*sizeof(DCTELEM)); | 2122 | memcpy(bak, temp, 64*sizeof(int16_t)); |
| 2123 | 2123 | ||
| 2124 | s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i); | 2124 | s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i); |
| 2125 | s->dct_unquantize_inter(s, temp, 0, s->qscale); | 2125 | 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 · 8 unmodified lines | |||
| 2134 | static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2134 | static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2135 | MpegEncContext * const s= (MpegEncContext *)c; | 2135 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2136 | const uint8_t *scantable= s->intra_scantable.permutated; | 2136 | const uint8_t *scantable= s->intra_scantable.permutated; |
| 2137 | LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | 2137 | LOCAL_ALIGNED_16(int16_t, temp, [64]); |
| 2138 | LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]); | 2138 | LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]); |
| 2139 | LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]); | 2139 | LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]); |
| 2140 | int i, last, run, bits, level, distortion, start_i; | 2140 | 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 · 69 unmodified lines | |||
| 2210 | static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ | 2210 | static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){ |
| 2211 | MpegEncContext * const s= (MpegEncContext *)c; | 2211 | MpegEncContext * const s= (MpegEncContext *)c; |
| 2212 | const uint8_t *scantable= s->intra_scantable.permutated; | 2212 | const uint8_t *scantable= s->intra_scantable.permutated; |
| 2213 | LOCAL_ALIGNED_16(DCTELEM, temp, [64]); | 2213 | LOCAL_ALIGNED_16(int16_t, temp, [64]); |
| 2214 | int i, last, run, bits, level, start_i; | 2214 | int i, last, run, bits, level, start_i; |
| 2215 | const int esc_length= s->ac_esc_length; | 2215 | const int esc_length= s->ac_esc_length; |
| 2216 | uint8_t * length; | 2216 | uint8_t * length; |
| @@ -2447,12 +2447,12 @@ static void vector_clip_int32_c(int32_t *dst, const int32_t *src, int32_t min, · 230 unmodified lines | |||
| 2447 | } while (len > 0); | 2447 | } while (len > 0); |
| 2448 | } | 2448 | } |
| 2449 | 2449 | ||
| 2450 | static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block) | 2450 | static void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block) |
| 2451 | { | 2451 | { |
| 2452 | ff_j_rev_dct (block); | 2452 | ff_j_rev_dct (block); |
| 2453 | put_pixels_clamped_c(block, dest, line_size); | 2453 | put_pixels_clamped_c(block, dest, line_size); |
| 2454 | } | 2454 | } |
| 2455 | static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block) | 2455 | static void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block) |
| 2456 | { | 2456 | { |
| 2457 | ff_j_rev_dct (block); | 2457 | ff_j_rev_dct (block); |
| 2458 | add_pixels_clamped_c(block, dest, line_size); | 2458 | add_pixels_clamped_c(block, dest, line_size); |
| @@ -36,41 +36,40 @@ · 35 unmodified lines | |||
| 36 | 36 | ||
| 37 | //#define DEBUG | 37 | //#define DEBUG |
| 38 | /* dct code */ | 38 | /* dct code */ |
| 39 | typedef short DCTELEM; | ||
| 40 | 39 | ||
| 41 | void ff_fdct_ifast (DCTELEM *data); | 40 | void ff_fdct_ifast(int16_t *data); |
| 42 | void ff_fdct_ifast248 (DCTELEM *data); | 41 | void ff_fdct_ifast248(int16_t *data); |
| 43 | void ff_jpeg_fdct_islow_8(DCTELEM *data); | 42 | void ff_jpeg_fdct_islow_8(int16_t *data); |
| 44 | void ff_jpeg_fdct_islow_10(DCTELEM *data); | 43 | void ff_jpeg_fdct_islow_10(int16_t *data); |
| 45 | void ff_fdct248_islow_8(DCTELEM *data); | 44 | void ff_fdct248_islow_8(int16_t *data); |
| 46 | void ff_fdct248_islow_10(DCTELEM *data); | 45 | void ff_fdct248_islow_10(int16_t *data); |
| 47 | 46 | ||
| 48 | void ff_j_rev_dct (DCTELEM *data); | 47 | void ff_j_rev_dct(int16_t *data); |
| 49 | 48 | ||
| 50 | void ff_fdct_mmx(DCTELEM *block); | 49 | void ff_fdct_mmx(int16_t *block); |
| 51 | void ff_fdct_mmxext(DCTELEM *block); | 50 | void ff_fdct_mmxext(int16_t *block); |
| 52 | void ff_fdct_sse2(DCTELEM *block); | 51 | void ff_fdct_sse2(int16_t *block); |
| 53 | 52 | ||
| 54 | #define H264_IDCT(depth) \ | 53 | #define H264_IDCT(depth) \ |
| 55 | void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ | 54 | void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ |
| 56 | void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ | 55 | void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ |
| 57 | void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ | 56 | void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ |
| 58 | void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\ | 57 | void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\ |
| 59 | void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ | 58 | void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ |
| 60 | void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ | 59 | void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ |
| 61 | void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ | 60 | void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ |
| 62 | void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ | 61 | 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]);\ |
| 63 | void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\ | 62 | void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\ |
| 64 | void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(DCTELEM *output, DCTELEM *input, int qmul);\ | 63 | void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\ |
| 65 | void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);\ | 64 | void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\ |
| 66 | void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul); | 65 | void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul); |
| 67 | 66 | ||
| 68 | H264_IDCT( 8) | 67 | H264_IDCT( 8) |
| 69 | H264_IDCT( 9) | 68 | H264_IDCT( 9) |
| 70 | H264_IDCT(10) | 69 | H264_IDCT(10) |
| 71 | 70 | ||
| 72 | void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp); | 71 | void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp); |
| 73 | void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc); | 72 | void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc); |
| 74 | 73 | ||
| 75 | /* encoding scans */ | 74 | /* encoding scans */ |
| 76 | extern const uint8_t ff_alternate_horizontal_scan[64]; | 75 | extern const uint8_t ff_alternate_horizontal_scan[64]; |
| @@ -128,11 +127,11 @@ could be reached easily ... · 51 unmodified lines | |||
| 128 | */ | 127 | */ |
| 129 | 128 | ||
| 130 | /* | 129 | /* |
| 131 | void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size); | 130 | void get_pixels_c(int16_t *block, const uint8_t *pixels, int line_size); |
| 132 | void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride); | 131 | void diff_pixels_c(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); |
| 133 | void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size); | 132 | void put_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size); |
| 134 | void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size); | 133 | void add_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size); |
| 135 | void clear_blocks_c(DCTELEM *blocks); | 134 | void clear_blocks_c(int16_t *blocks); |
| 136 | */ | 135 | */ |
| 137 | 136 | ||
| 138 | /* add and put pixel (decoding) */ | 137 | /* add and put pixel (decoding) */ |
| @@ -197,14 +196,14 @@ typedef struct DSPContext { · 58 unmodified lines | |||
| 197 | int dct_bits; | 196 | int dct_bits; |
| 198 | 197 | ||
| 199 | /* pixel ops : interface with DCT */ | 198 | /* pixel ops : interface with DCT */ |
| 200 | void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size); | 199 | void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size); |
| 201 | void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride); | 200 | void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride); |
| 202 | void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); | 201 | void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); |
| 203 | void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); | 202 | void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); |
| 204 | void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); | 203 | void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size); |
| 205 | void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size); | 204 | void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size); |
| 206 | void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size); | 205 | void (*add_pixels4)(uint8_t *pixels, int16_t *block, int line_size); |
| 207 | int (*sum_abs_dctelem)(DCTELEM *block/*align 16*/); | 206 | int (*sum_abs_dctelem)(int16_t *block/*align 16*/); |
| 208 | /** | 207 | /** |
| 209 | * translational global motion compensation. | 208 | * translational global motion compensation. |
| 210 | */ | 209 | */ |
| @@ -214,8 +213,8 @@ typedef struct DSPContext { · 3 unmodified lines | |||
| 214 | */ | 213 | */ |
| 215 | void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, | 214 | void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy, |
| 216 | int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); | 215 | int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height); |
| 217 | void (*clear_block)(DCTELEM *block/*align 16*/); | 216 | void (*clear_block)(int16_t *block/*align 16*/); |
| 218 | void (*clear_blocks)(DCTELEM *blocks/*align 16*/); | 217 | void (*clear_blocks)(int16_t *blocks/*align 16*/); |
| 219 | int (*pix_sum)(uint8_t * pix, int line_size); | 218 | int (*pix_sum)(uint8_t * pix, int line_size); |
| 220 | int (*pix_norm1)(uint8_t * pix, int line_size); | 219 | int (*pix_norm1)(uint8_t * pix, int line_size); |
| 221 | // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4 | 220 | // 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4 |
| @@ -344,24 +343,24 @@ typedef struct DSPContext { · 122 unmodified lines | |||
| 344 | void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */); | 343 | void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */); |
| 345 | 344 | ||
| 346 | /* (I)DCT */ | 345 | /* (I)DCT */ |
| 347 | void (*fdct)(DCTELEM *block/* align 16*/); | 346 | void (*fdct)(int16_t *block/* align 16*/); |
| 348 | void (*fdct248)(DCTELEM *block/* align 16*/); | 347 | void (*fdct248)(int16_t *block/* align 16*/); |
| 349 | 348 | ||
| 350 | /* IDCT really*/ | 349 | /* IDCT really*/ |
| 351 | void (*idct)(DCTELEM *block/* align 16*/); | 350 | void (*idct)(int16_t *block/* align 16*/); |
| 352 | 351 | ||
| 353 | /** | 352 | /** |
| 354 | * block -> idct -> clip to unsigned 8 bit -> dest. | 353 | * block -> idct -> clip to unsigned 8 bit -> dest. |
| 355 | * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...) | 354 | * (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...) |
| 356 | * @param line_size size in bytes of a horizontal line of dest | 355 | * @param line_size size in bytes of a horizontal line of dest |
| 357 | */ | 356 | */ |
| 358 | void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); | 357 | void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); |
| 359 | 358 | ||
| 360 | /** | 359 | /** |
| 361 | * block -> idct -> add dest -> clip to unsigned 8 bit -> dest. | 360 | * block -> idct -> add dest -> clip to unsigned 8 bit -> dest. |
| 362 | * @param line_size size in bytes of a horizontal line of dest | 361 | * @param line_size size in bytes of a horizontal line of dest |
| 363 | */ | 362 | */ |
| 364 | void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/); | 363 | void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/); |
| 365 | 364 | ||
| 366 | /** | 365 | /** |
| 367 | * idct input permutation. | 366 | * idct input permutation. |
| @@ -451,7 +450,7 @@ int ff_check_alignment(void); · 83 unmodified lines | |||
| 451 | * permute block according to permuatation. | 450 | * permute block according to permuatation. |
| 452 | * @param last last non zero element in scantable order | 451 | * @param last last non zero element in scantable order |
| 453 | */ | 452 | */ |
| 454 | void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last); | 453 | void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last); |
| 455 | 454 | ||
| 456 | void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type); | 455 | void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type); |
| 457 | 456 | ||
| @@ -114,7 +114,7 @@ static void FUNCC(draw_edges)(uint8_t *_buf, int _wrap, int width, int height, i · 113 unmodified lines | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | #define DCTELEM_FUNCS(dctcoef, suffix) \ | 116 | #define DCTELEM_FUNCS(dctcoef, suffix) \ |
| 117 | static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \ | 117 | static void FUNCC(get_pixels ## suffix)(int16_t *restrict _block, \ |
| 118 | const uint8_t *_pixels, \ | 118 | const uint8_t *_pixels, \ |
| 119 | int line_size) \ | 119 | int line_size) \ |
| 120 | { \ | 120 | { \ |
| @@ -138,7 +138,7 @@ static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \ · 17 unmodified lines | |||
| 138 | } \ | 138 | } \ |
| 139 | \ | 139 | \ |
| 140 | static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ | 140 | static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ |
| 141 | DCTELEM *_block, \ | 141 | int16_t *_block, \ |
| 142 | int line_size) \ | 142 | int line_size) \ |
| 143 | { \ | 143 | { \ |
| 144 | int i; \ | 144 | int i; \ |
| @@ -161,7 +161,7 @@ static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \ · 16 unmodified lines | |||
| 161 | } \ | 161 | } \ |
| 162 | \ | 162 | \ |
| 163 | static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \ | 163 | static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \ |
| 164 | DCTELEM *_block, \ | 164 | int16_t *_block, \ |
| 165 | int line_size) \ | 165 | int line_size) \ |
| 166 | { \ | 166 | { \ |
| 167 | int i; \ | 167 | int i; \ |
| @@ -179,20 +179,20 @@ static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \ · 11 unmodified lines | |||
| 179 | } \ | 179 | } \ |
| 180 | } \ | 180 | } \ |
| 181 | \ | 181 | \ |
| 182 | static void FUNCC(clear_block ## suffix)(DCTELEM *block) \ | 182 | static void FUNCC(clear_block ## suffix)(int16_t *block) \ |
| 183 | { \ | 183 | { \ |
| 184 | memset(block, 0, sizeof(dctcoef)*64); \ | 184 | memset(block, 0, sizeof(dctcoef)*64); \ |
| 185 | } \ | 185 | } \ |
| 186 | \ | 186 | \ |
| 187 | /** \ | 187 | /** \ |
| 188 | * memset(blocks, 0, sizeof(DCTELEM)*6*64) \ | 188 | * memset(blocks, 0, sizeof(int16_t)*6*64) \ |
| 189 | */ \ | 189 | */ \ |
| 190 | static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks) \ | 190 | static void FUNCC(clear_blocks ## suffix)(int16_t *blocks) \ |
| 191 | { \ | 191 | { \ |
| 192 | memset(blocks, 0, sizeof(dctcoef)*6*64); \ | 192 | memset(blocks, 0, sizeof(dctcoef)*6*64); \ |
| 193 | } | 193 | } |
| 194 | 194 | ||
| 195 | DCTELEM_FUNCS(DCTELEM, _16) | 195 | DCTELEM_FUNCS(int16_t, _16) |
| 196 | #if BIT_DEPTH > 8 | 196 | #if BIT_DEPTH > 8 |
| 197 | DCTELEM_FUNCS(dctcoef, _32) | 197 | DCTELEM_FUNCS(dctcoef, _32) |
| 198 | #endif | 198 | #endif |
| @@ -406,7 +406,7 @@ typedef struct EncBlockInfo { · 405 unmodified lines | |||
| 406 | int cur_ac; | 406 | int cur_ac; |
| 407 | int cno; | 407 | int cno; |
| 408 | int dct_mode; | 408 | int dct_mode; |
| 409 | DCTELEM mb[64]; | 409 | int16_t mb[64]; |
| 410 | uint8_t next[64]; | 410 | uint8_t next[64]; |
| 411 | uint8_t sign[64]; | 411 | uint8_t sign[64]; |
| 412 | uint8_t partial_bit_count; | 412 | uint8_t partial_bit_count; |
| @@ -495,7 +495,7 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i · 82 unmodified lines | |||
| 495 | { | 495 | { |
| 496 | const int *weight; | 496 | const int *weight; |
| 497 | const uint8_t* zigzag_scan; | 497 | const uint8_t* zigzag_scan; |
| 498 | LOCAL_ALIGNED_16(DCTELEM, blk, [64]); | 498 | LOCAL_ALIGNED_16(int16_t, blk, [64]); |
| 499 | int i, area; | 499 | int i, area; |
| 500 | /* We offer two different methods for class number assignment: the | 500 | /* We offer two different methods for class number assignment: the |
| 501 | method suggested in SMPTE 314M Table 22, and an improved | 501 | method suggested in SMPTE 314M Table 22, and an improved |
| @@ -40,9 +40,9 @@ typedef struct DVVideoContext { · 39 unmodified lines | |||
| 40 | 40 | ||
| 41 | uint8_t dv_zigzag[2][64]; | 41 | uint8_t dv_zigzag[2][64]; |
| 42 | 42 | ||
| 43 | void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size); | 43 | void (*get_pixels)(int16_t *block, const uint8_t *pixels, int line_size); |
| 44 | void (*fdct[2])(DCTELEM *block); | 44 | void (*fdct[2])(int16_t *block); |
| 45 | void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block); | 45 | void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block); |
| 46 | me_cmp_func ildct_cmp; | 46 | me_cmp_func ildct_cmp; |
| 47 | } DVVideoContext; | 47 | } DVVideoContext; |
| 48 | 48 | ||
| @@ -48,7 +48,7 @@ typedef struct BlockInfo { · 47 unmodified lines | |||
| 48 | const uint32_t *factor_table; | 48 | const uint32_t *factor_table; |
| 49 | const uint8_t *scan_table; | 49 | const uint8_t *scan_table; |
| 50 | uint8_t pos; /* position in block */ | 50 | uint8_t pos; /* position in block */ |
| 51 | void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); | 51 | void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); |
| 52 | uint8_t partial_bit_count; | 52 | uint8_t partial_bit_count; |
| 53 | uint32_t partial_bit_buffer; | 53 | uint32_t partial_bit_buffer; |
| 54 | int shift_offset; | 54 | int shift_offset; |
| @@ -57,7 +57,7 @@ typedef struct BlockInfo { · 2 unmodified lines | |||
| 57 | static const int dv_iweight_bits = 14; | 57 | static const int dv_iweight_bits = 14; |
| 58 | 58 | ||
| 59 | /* decode AC coefficients */ | 59 | /* decode AC coefficients */ |
| 60 | static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block) | 60 | static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block) |
| 61 | { | 61 | { |
| 62 | int last_index = gb->size_in_bits; | 62 | int last_index = gb->size_in_bits; |
| 63 | const uint8_t *scan_table = mb->scan_table; | 63 | const uint8_t *scan_table = mb->scan_table; |
| @@ -135,14 +135,14 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) · 71 unmodified lines | |||
| 135 | int quant, dc, dct_mode, class1, j; | 135 | int quant, dc, dct_mode, class1, j; |
| 136 | int mb_index, mb_x, mb_y, last_index; | 136 | int mb_index, mb_x, mb_y, last_index; |
| 137 | int y_stride, linesize; | 137 | int y_stride, linesize; |
| 138 | DCTELEM *block, *block1; | 138 | int16_t *block, *block1; |
| 139 | int c_offset; | 139 | int c_offset; |
| 140 | uint8_t *y_ptr; | 140 | uint8_t *y_ptr; |
| 141 | const uint8_t *buf_ptr; | 141 | const uint8_t *buf_ptr; |
| 142 | PutBitContext pb, vs_pb; | 142 | PutBitContext pb, vs_pb; |
| 143 | GetBitContext gb; | 143 | GetBitContext gb; |
| 144 | BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; | 144 | BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1; |
| 145 | LOCAL_ALIGNED_16(DCTELEM, sblock, [5*DV_MAX_BPM], [64]); | 145 | LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]); |
| 146 | LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ | 146 | LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ |
| 147 | LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ | 147 | LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */ |
| 148 | const int log2_blocksize = 3; | 148 | const int log2_blocksize = 3; |
| @@ -64,7 +64,7 @@ · 63 unmodified lines | |||
| 64 | #define MUNGE_8BIT(x) av_clip_uint8((x)>>4) | 64 | #define MUNGE_8BIT(x) av_clip_uint8((x)>>4) |
| 65 | #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) | 65 | #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) |
| 66 | 66 | ||
| 67 | static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) { | 67 | static inline void ea_idct_col(int16_t *dest, const int16_t *src) { |
| 68 | if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) { | 68 | if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) { |
| 69 | dest[0] = | 69 | dest[0] = |
| 70 | dest[8] = | 70 | dest[8] = |
| @@ -78,9 +78,9 @@ static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) { · 7 unmodified lines | |||
| 78 | IDCT_COL(dest, src); | 78 | IDCT_COL(dest, src); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) { | 81 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) { |
| 82 | int i; | 82 | int i; |
| 83 | DCTELEM temp[64]; | 83 | int16_t temp[64]; |
| 84 | block[0] += 4; | 84 | block[0] += 4; |
| 85 | for (i=0; i<8; i++) | 85 | for (i=0; i<8; i++) |
| 86 | ea_idct_col(&temp[i], &block[i]); | 86 | ea_idct_col(&temp[i], &block[i]); |
| @@ -20,8 +20,7 @@ · 19 unmodified lines | |||
| 20 | #define AVCODEC_EAIDCT_H | 20 | #define AVCODEC_EAIDCT_H |
| 21 | 21 | ||
| 22 | #include <stdint.h> | 22 | #include <stdint.h> |
| 23 | #include "dsputil.h" | ||
| 24 | 23 | ||
| 25 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block); | 24 | void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block); |
| 26 | 25 | ||
| 27 | #endif /* AVCODEC_EAIDCT_H */ | 26 | #endif /* AVCODEC_EAIDCT_H */ |
| @@ -51,7 +51,7 @@ typedef struct MadContext { · 50 unmodified lines | |||
| 51 | GetBitContext gb; | 51 | GetBitContext gb; |
| 52 | void *bitstream_buf; | 52 | void *bitstream_buf; |
| 53 | unsigned int bitstream_buf_size; | 53 | unsigned int bitstream_buf_size; |
| 54 | DECLARE_ALIGNED(16, DCTELEM, block)[64]; | 54 | DECLARE_ALIGNED(16, int16_t, block)[64]; |
| 55 | ScanTable scantable; | 55 | ScanTable scantable; |
| 56 | uint16_t quant_matrix[64]; | 56 | uint16_t quant_matrix[64]; |
| 57 | int mb_x; | 57 | int mb_x; |
| @@ -96,7 +96,7 @@ static inline void comp_block(MadContext *t, int mb_x, int mb_y, · 38 unmodified lines | |||
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, int j) | 99 | static inline void idct_put(MadContext *t, int16_t *block, int mb_x, int mb_y, int j) |
| 100 | { | 100 | { |
| 101 | if (j < 4) { | 101 | if (j < 4) { |
| 102 | ff_ea_idct_put_c( | 102 | 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 · 7 unmodified lines | |||
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | 112 | ||
| 113 | static inline void decode_block_intra(MadContext *s, DCTELEM * block) | 113 | static inline void decode_block_intra(MadContext *s, int16_t * block) |
| 114 | { | 114 | { |
| 115 | int level, i, j, run; | 115 | int level, i, j, run; |
| 116 | RLTable *rl = &ff_rl_mpeg1; | 116 | RLTable *rl = &ff_rl_mpeg1; |
| @@ -43,7 +43,7 @@ typedef struct TgqContext { · 42 unmodified lines | |||
| 43 | int width,height; | 43 | int width,height; |
| 44 | ScanTable scantable; | 44 | ScanTable scantable; |
| 45 | int qtable[64]; | 45 | int qtable[64]; |
| 46 | DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; | 46 | DECLARE_ALIGNED(16, int16_t, block)[6][64]; |
| 47 | GetByteContext gb; | 47 | GetByteContext gb; |
| 48 | } TgqContext; | 48 | } TgqContext; |
| 49 | 49 | ||
| @@ -58,7 +58,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){ · 8 unmodified lines | |||
| 58 | return 0; | 58 | return 0; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb){ | 61 | static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb){ |
| 62 | uint8_t *perm = s->scantable.permutated; | 62 | uint8_t *perm = s->scantable.permutated; |
| 63 | int i,j,value; | 63 | int i,j,value; |
| 64 | block[0] = get_sbits(gb,8) * s->qtable[0]; | 64 | 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 · 38 unmodified lines | |||
| 103 | block[0] += 128<<4; | 103 | block[0] += 128<<4; |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | static void tgq_idct_put_mb(TgqContext *s, DCTELEM (*block)[64], int mb_x, int mb_y){ | 106 | static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], int mb_x, int mb_y){ |
| 107 | int linesize= s->frame.linesize[0]; | 107 | int linesize= s->frame.linesize[0]; |
| 108 | uint8_t *dest_y = s->frame.data[0] + (mb_y * 16* linesize ) + mb_x * 16; | 108 | uint8_t *dest_y = s->frame.data[0] + (mb_y * 16* linesize ) + mb_x * 16; |
| 109 | uint8_t *dest_cb = s->frame.data[1] + (mb_y * 8 * s->frame.linesize[1]) + mb_x * 8; | 109 | uint8_t *dest_cb = s->frame.data[1] + (mb_y * 8 * s->frame.linesize[1]) + mb_x * 8; |
| @@ -40,7 +40,7 @@ typedef struct TqiContext { · 39 unmodified lines | |||
| 40 | AVFrame frame; | 40 | AVFrame frame; |
| 41 | void *bitstream_buf; | 41 | void *bitstream_buf; |
| 42 | unsigned int bitstream_buf_size; | 42 | unsigned int bitstream_buf_size; |
| 43 | DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; | 43 | DECLARE_ALIGNED(16, int16_t, block)[6][64]; |
| 44 | } TqiContext; | 44 | } TqiContext; |
| 45 | 45 | ||
| 46 | static av_cold int tqi_decode_init(AVCodecContext *avctx) | 46 | static av_cold int tqi_decode_init(AVCodecContext *avctx) |
| @@ -58,7 +58,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx) · 11 unmodified lines | |||
| 58 | return 0; | 58 | return 0; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64]) | 61 | static int tqi_decode_mb(MpegEncContext *s, int16_t (*block)[64]) |
| 62 | { | 62 | { |
| 63 | int n; | 63 | int n; |
| 64 | s->dsp.clear_blocks(block[0]); | 64 | s->dsp.clear_blocks(block[0]); |
| @@ -69,7 +69,7 @@ static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64]) · 4 unmodified lines | |||
| 69 | return 0; | 69 | return 0; |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64]) | 72 | static inline void tqi_idct_put(TqiContext *t, int16_t (*block)[64]) |
| 73 | { | 73 | { |
| 74 | MpegEncContext *s = &t->s; | 74 | MpegEncContext *s = &t->s; |
| 75 | int linesize= t->frame.linesize[0]; | 75 | int linesize= t->frame.linesize[0]; |
| @@ -64,7 +64,7 @@ B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7, · 63 unmodified lines | |||
| 64 | B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7, | 64 | B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7, |
| 65 | }; | 65 | }; |
| 66 | 66 | ||
| 67 | static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) | 67 | static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data) |
| 68 | { | 68 | { |
| 69 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 69 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 70 | FLOAT tmp10, tmp11, tmp12, tmp13; | 70 | FLOAT tmp10, tmp11, tmp12, tmp13; |
| @@ -119,7 +119,7 @@ static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data) · 48 unmodified lines | |||
| 119 | } | 119 | } |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | void ff_faandct(DCTELEM * data) | 122 | void ff_faandct(int16_t *data) |
| 123 | { | 123 | { |
| 124 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 124 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 125 | FLOAT tmp10, tmp11, tmp12, tmp13; | 125 | FLOAT tmp10, tmp11, tmp12, tmp13; |
| @@ -179,7 +179,7 @@ void ff_faandct(DCTELEM * data) · 53 unmodified lines | |||
| 179 | } | 179 | } |
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | void ff_faandct248(DCTELEM * data) | 182 | void ff_faandct248(int16_t *data) |
| 183 | { | 183 | { |
| 184 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 184 | FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 185 | FLOAT tmp10, tmp11, tmp12, tmp13; | 185 | FLOAT tmp10, tmp11, tmp12, tmp13; |
| @@ -29,9 +29,9 @@ · 28 unmodified lines | |||
| 29 | #ifndef AVCODEC_FAANDCT_H | 29 | #ifndef AVCODEC_FAANDCT_H |
| 30 | #define AVCODEC_FAANDCT_H | 30 | #define AVCODEC_FAANDCT_H |
| 31 | 31 | ||
| 32 | #include "dsputil.h" | 32 | #include <stdint.h> |
| 33 | 33 | ||
| 34 | void ff_faandct(DCTELEM * data); | 34 | void ff_faandct(int16_t *data); |
| 35 | void ff_faandct248(DCTELEM * data); | 35 | void ff_faandct248(int16_t *data); |
| 36 | 36 | ||
| 37 | #endif /* AVCODEC_FAANDCT_H */ | 37 | #endif /* AVCODEC_FAANDCT_H */ |
| @@ -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, · 46 unmodified lines | |||
| 47 | B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, | 47 | B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ | 50 | static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ |
| 51 | int i; | 51 | int i; |
| 52 | FLOAT av_unused tmp0; | 52 | FLOAT av_unused tmp0; |
| 53 | FLOAT s04, d04, s17, d17, s26, d26, s53, d53; | 53 | 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 · 75 unmodified lines | |||
| 129 | } | 129 | } |
| 130 | } | 130 | } |
| 131 | 131 | ||
| 132 | void ff_faanidct(DCTELEM block[64]){ | 132 | void ff_faanidct(int16_t block[64]){ |
| 133 | FLOAT temp[64]; | 133 | FLOAT temp[64]; |
| 134 | int i; | 134 | int i; |
| 135 | 135 | ||
| @@ -142,7 +142,7 @@ void ff_faanidct(DCTELEM block[64]){ · 6 unmodified lines | |||
| 142 | p8idct(block, temp, NULL, 0, 8, 1, 1); | 142 | p8idct(block, temp, NULL, 0, 8, 1, 1); |
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){ | 145 | void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){ |
| 146 | FLOAT temp[64]; | 146 | FLOAT temp[64]; |
| 147 | int i; | 147 | int i; |
| 148 | 148 | ||
| @@ -155,7 +155,7 @@ void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){ · 6 unmodified lines | |||
| 155 | p8idct(NULL , temp, dest, line_size, 8, 1, 2); | 155 | p8idct(NULL , temp, dest, line_size, 8, 1, 2); |
| 156 | } | 156 | } |
| 157 | 157 | ||
| 158 | void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]){ | 158 | void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){ |
| 159 | FLOAT temp[64]; | 159 | FLOAT temp[64]; |
| 160 | int i; | 160 | int i; |
| 161 | 161 | ||
| @@ -23,10 +23,9 @@ · 22 unmodified lines | |||
| 23 | #define AVCODEC_FAANIDCT_H | 23 | #define AVCODEC_FAANIDCT_H |
| 24 | 24 | ||
| 25 | #include <stdint.h> | 25 | #include <stdint.h> |
| 26 | #include "dsputil.h" | ||
| 27 | 26 | ||
| 28 | void ff_faanidct(DCTELEM block[64]); | 27 | void ff_faanidct(int16_t block[64]); |
| 29 | void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]); | 28 | void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]); |
| 30 | void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]); | 29 | void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]); |
| 31 | 30 | ||
| 32 | #endif /* AVCODEC_FAANIDCT_H */ | 31 | #endif /* AVCODEC_FAANIDCT_H */ |
| @@ -47,7 +47,7 @@ static VLC h261_mtype_vlc; · 46 unmodified lines | |||
| 47 | static VLC h261_mv_vlc; | 47 | static VLC h261_mv_vlc; |
| 48 | static VLC h261_cbp_vlc; | 48 | static VLC h261_cbp_vlc; |
| 49 | 49 | ||
| 50 | static int h261_decode_block(H261Context * h, DCTELEM * block, int n, int coded); | 50 | static int h261_decode_block(H261Context * h, int16_t * block, int n, int coded); |
| 51 | 51 | ||
| 52 | static av_cold void h261_decode_init_vlc(H261Context *h){ | 52 | static av_cold void h261_decode_init_vlc(H261Context *h){ |
| 53 | static int done = 0; | 53 | static int done = 0; |
| @@ -358,7 +358,7 @@ intra: · 304 unmodified lines | |||
| 358 | * Decode a macroblock. | 358 | * Decode a macroblock. |
| 359 | * @return <0 if an error occurred | 359 | * @return <0 if an error occurred |
| 360 | */ | 360 | */ |
| 361 | static int h261_decode_block(H261Context * h, DCTELEM * block, | 361 | static int h261_decode_block(H261Context * h, int16_t * block, |
| 362 | int n, int coded) | 362 | int n, int coded) |
| 363 | { | 363 | { |
| 364 | MpegEncContext * const s = &h->s; | 364 | MpegEncContext * const s = &h->s; |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | |||
| 34 | 34 | ||
| 35 | extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; | 35 | extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3]; |
| 36 | 36 | ||
| 37 | static void h261_encode_block(H261Context * h, DCTELEM * block, | 37 | static void h261_encode_block(H261Context * h, int16_t * block, |
| 38 | int n); | 38 | int n); |
| 39 | 39 | ||
| 40 | int ff_h261_get_picture_format(int width, int height){ | 40 | int ff_h261_get_picture_format(int width, int height){ |
| @@ -143,7 +143,7 @@ static void h261_encode_motion(H261Context * h, int val){ · 102 unmodified lines | |||
| 143 | } | 143 | } |
| 144 | 144 | ||
| 145 | static inline int get_cbp(MpegEncContext * s, | 145 | static inline int get_cbp(MpegEncContext * s, |
| 146 | DCTELEM block[6][64]) | 146 | int16_t block[6][64]) |
| 147 | { | 147 | { |
| 148 | int i, cbp; | 148 | int i, cbp; |
| 149 | cbp= 0; | 149 | cbp= 0; |
| @@ -154,7 +154,7 @@ static inline int get_cbp(MpegEncContext * s, · 4 unmodified lines | |||
| 154 | return cbp; | 154 | return cbp; |
| 155 | } | 155 | } |
| 156 | void ff_h261_encode_mb(MpegEncContext * s, | 156 | void ff_h261_encode_mb(MpegEncContext * s, |
| 157 | DCTELEM block[6][64], | 157 | int16_t block[6][64], |
| 158 | int motion_x, int motion_y) | 158 | int motion_x, int motion_y) |
| 159 | { | 159 | { |
| 160 | H261Context * h = (H261Context *)s; | 160 | H261Context * h = (H261Context *)s; |
| @@ -255,7 +255,7 @@ void ff_h261_encode_init(MpegEncContext *s){ · 94 unmodified lines | |||
| 255 | * @param block the 8x8 block | 255 | * @param block the 8x8 block |
| 256 | * @param n block index (0-3 are luma, 4-5 are chroma) | 256 | * @param n block index (0-3 are luma, 4-5 are chroma) |
| 257 | */ | 257 | */ |
| 258 | static void h261_encode_block(H261Context * h, DCTELEM * block, int n){ | 258 | static void h261_encode_block(H261Context * h, int16_t * block, int n){ |
| 259 | MpegEncContext * const s = &h->s; | 259 | MpegEncContext * const s = &h->s; |
| 260 | int level, run, i, j, last_index, last_non_zero, sign, slevel, code; | 260 | int level, run, i, j, last_index, last_non_zero, sign, slevel, code; |
| 261 | RLTable *rl; | 261 | RLTable *rl; |
| @@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 225 unmodified lines | |||
| 226 | } | 226 | } |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n) | 229 | void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n) |
| 230 | { | 230 | { |
| 231 | int x, y, wrap, a, c, pred_dc, scale, i; | 231 | int x, y, wrap, a, c, pred_dc, scale, i; |
| 232 | int16_t *dc_val, *ac_val, *ac_val1; | 232 | int16_t *dc_val, *ac_val, *ac_val1; |
| @@ -73,7 +73,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, · 72 unmodified lines | |||
| 73 | AVPacket *avpkt); | 73 | AVPacket *avpkt); |
| 74 | int ff_h263_decode_end(AVCodecContext *avctx); | 74 | int ff_h263_decode_end(AVCodecContext *avctx); |
| 75 | void ff_h263_encode_mb(MpegEncContext *s, | 75 | void ff_h263_encode_mb(MpegEncContext *s, |
| 76 | DCTELEM block[6][64], | 76 | int16_t block[6][64], |
| 77 | int motion_x, int motion_y); | 77 | int motion_x, int motion_y); |
| 78 | void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number); | 78 | void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number); |
| 79 | void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); | 79 | void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line); |
| @@ -89,7 +89,7 @@ int ff_h263_decode_mba(MpegEncContext *s); · 9 unmodified lines | |||
| 89 | void ff_h263_encode_mba(MpegEncContext *s); | 89 | void ff_h263_encode_mba(MpegEncContext *s); |
| 90 | void ff_init_qscale_tab(MpegEncContext *s); | 90 | void ff_init_qscale_tab(MpegEncContext *s); |
| 91 | int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); | 91 | int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr); |
| 92 | void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n); | 92 | void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n); |
| 93 | 93 | ||
| 94 | 94 | ||
| 95 | /** | 95 | /** |
| @@ -99,7 +99,7 @@ void ff_h263_show_pict_info(MpegEncContext *s); · 3 unmodified lines | |||
| 99 | 99 | ||
| 100 | int ff_intel_h263_decode_picture_header(MpegEncContext *s); | 100 | int ff_intel_h263_decode_picture_header(MpegEncContext *s); |
| 101 | int ff_h263_decode_mb(MpegEncContext *s, | 101 | int ff_h263_decode_mb(MpegEncContext *s, |
| 102 | DCTELEM block[6][64]); | 102 | int16_t block[6][64]); |
| 103 | 103 | ||
| 104 | /** | 104 | /** |
| 105 | * Return the value of the 3bit "source format" syntax element. | 105 | * 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 · 38 unmodified lines | |||
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | static inline int get_p_cbp(MpegEncContext * s, | 146 | static inline int get_p_cbp(MpegEncContext * s, |
| 147 | DCTELEM block[6][64], | 147 | int16_t block[6][64], |
| 148 | int motion_x, int motion_y){ | 148 | int motion_x, int motion_y){ |
| 149 | int cbp, i; | 149 | int cbp, i; |
| 150 | 150 | ||
| @@ -1750,7 +1750,7 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y, · 1749 unmodified lines | |||
| 1750 | } | 1750 | } |
| 1751 | } | 1751 | } |
| 1752 | 1752 | ||
| 1753 | static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth, | 1753 | static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth, |
| 1754 | int index) | 1754 | int index) |
| 1755 | { | 1755 | { |
| 1756 | if (high_bit_depth) { | 1756 | if (high_bit_depth) { |
| @@ -1759,7 +1759,7 @@ static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth, · 2 unmodified lines | |||
| 1759 | return AV_RN16A(mb + index); | 1759 | return AV_RN16A(mb + index); |
| 1760 | } | 1760 | } |
| 1761 | 1761 | ||
| 1762 | static av_always_inline void dctcoef_set(DCTELEM *mb, int high_bit_depth, | 1762 | static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth, |
| 1763 | int index, int value) | 1763 | int index, int value) |
| 1764 | { | 1764 | { |
| 1765 | if (high_bit_depth) { | 1765 | if (high_bit_depth) { |
| @@ -1778,8 +1778,8 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h, · 12 unmodified lines | |||
| 1778 | uint8_t *dest_y, int p) | 1778 | uint8_t *dest_y, int p) |
| 1779 | { | 1779 | { |
| 1780 | MpegEncContext *const s = &h->s; | 1780 | MpegEncContext *const s = &h->s; |
| 1781 | void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); | 1781 | void (*idct_add)(uint8_t *dst, int16_t *block, int stride); |
| 1782 | void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride); | 1782 | void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride); |
| 1783 | int i; | 1783 | int i; |
| 1784 | int qscale = p == 0 ? s->qscale : h->chroma_qp[p - 1]; | 1784 | int qscale = p == 0 ? s->qscale : h->chroma_qp[p - 1]; |
| 1785 | block_offset += 16 * p; | 1785 | block_offset += 16 * p; |
| @@ -1895,7 +1895,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type, · 109 unmodified lines | |||
| 1895 | uint8_t *dest_y, int p) | 1895 | uint8_t *dest_y, int p) |
| 1896 | { | 1896 | { |
| 1897 | MpegEncContext *const s = &h->s; | 1897 | MpegEncContext *const s = &h->s; |
| 1898 | void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); | 1898 | void (*idct_add)(uint8_t *dst, int16_t *block, int stride); |
| 1899 | int i; | 1899 | int i; |
| 1900 | block_offset += 16 * p; | 1900 | block_offset += 16 * p; |
| 1901 | if (!IS_INTRA4x4(mb_type)) { | 1901 | if (!IS_INTRA4x4(mb_type)) { |
| @@ -29,7 +29,6 @@ · 28 unmodified lines | |||
| 29 | #define AVCODEC_H264_H | 29 | #define AVCODEC_H264_H |
| 30 | 30 | ||
| 31 | #include "libavutil/intreadwrite.h" | 31 | #include "libavutil/intreadwrite.h" |
| 32 | #include "dsputil.h" | ||
| 33 | #include "cabac.h" | 32 | #include "cabac.h" |
| 34 | #include "mpegvideo.h" | 33 | #include "mpegvideo.h" |
| 35 | #include "h264dsp.h" | 34 | #include "h264dsp.h" |
| @@ -386,9 +385,9 @@ typedef struct H264Context { · 350 unmodified lines | |||
| 386 | GetBitContext *intra_gb_ptr; | 385 | GetBitContext *intra_gb_ptr; |
| 387 | GetBitContext *inter_gb_ptr; | 386 | GetBitContext *inter_gb_ptr; |
| 388 | 387 | ||
| 389 | 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. | 388 | 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. |
| 390 | DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[3][16 * 2]; | 389 | DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2]; |
| 391 | 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 | 390 | 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 |
| 392 | 391 | ||
| 393 | /** | 392 | /** |
| 394 | * Cabac | 393 | * Cabac |
| @@ -1561,7 +1561,7 @@ static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, · 1560 unmodified lines | |||
| 1561 | } | 1561 | } |
| 1562 | 1562 | ||
| 1563 | static av_always_inline void | 1563 | static av_always_inline void |
| 1564 | decode_cabac_residual_internal(H264Context *h, DCTELEM *block, | 1564 | decode_cabac_residual_internal(H264Context *h, int16_t *block, |
| 1565 | int cat, int n, const uint8_t *scantable, | 1565 | int cat, int n, const uint8_t *scantable, |
| 1566 | const uint32_t *qmul, int max_coeff, | 1566 | const uint32_t *qmul, int max_coeff, |
| 1567 | int is_dc, int chroma422) | 1567 | int is_dc, int chroma422) |
| @@ -1745,18 +1745,27 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block, · 177 unmodified lines | |||
| 1745 | 1745 | ||
| 1746 | } | 1746 | } |
| 1747 | 1747 | ||
| 1748 | static void decode_cabac_residual_dc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { | 1748 | static void decode_cabac_residual_dc_internal(H264Context *h, int16_t *block, |
| 1749 | int cat, int n, | ||
| 1750 | const uint8_t *scantable, | ||
| 1751 | int max_coeff) | ||
| 1752 | { | ||
| 1749 | decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0); | 1753 | decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0); |
| 1750 | } | 1754 | } |
| 1751 | 1755 | ||
| 1752 | static void decode_cabac_residual_dc_internal_422(H264Context *h, DCTELEM *block, | 1756 | static void decode_cabac_residual_dc_internal_422(H264Context *h, int16_t *block, |
| 1753 | int cat, int n, const uint8_t *scantable, | 1757 | int cat, int n, const uint8_t *scantable, |
| 1754 | int max_coeff) | 1758 | int max_coeff) |
| 1755 | { | 1759 | { |
| 1756 | decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1); | 1760 | decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1); |
| 1757 | } | 1761 | } |
| 1758 | 1762 | ||
| 1759 | 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 ) { | 1763 | static void decode_cabac_residual_nondc_internal(H264Context *h, int16_t *block, |
| 1764 | int cat, int n, | ||
| 1765 | const uint8_t *scantable, | ||
| 1766 | const uint32_t *qmul, | ||
| 1767 | int max_coeff) | ||
| 1768 | { | ||
| 1760 | decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0); | 1769 | decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0); |
| 1761 | } | 1770 | } |
| 1762 | 1771 | ||
| @@ -1772,7 +1781,12 @@ static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block · 9 unmodified lines | |||
| 1772 | * because it allows improved constant propagation into get_cabac_cbf_ctx, | 1781 | * because it allows improved constant propagation into get_cabac_cbf_ctx, |
| 1773 | * as well as because most blocks have zero CBFs. */ | 1782 | * as well as because most blocks have zero CBFs. */ |
| 1774 | 1783 | ||
| 1775 | static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) { | 1784 | static av_always_inline void decode_cabac_residual_dc(H264Context *h, |
| 1785 | int16_t *block, | ||
| 1786 | int cat, int n, | ||
| 1787 | const uint8_t *scantable, | ||
| 1788 | int max_coeff) | ||
| 1789 | { | ||
| 1776 | /* read coded block flag */ | 1790 | /* read coded block flag */ |
| 1777 | if( get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 1 ) ] ) == 0 ) { | 1791 | if( get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 1 ) ] ) == 0 ) { |
| 1778 | h->non_zero_count_cache[scan8[n]] = 0; | 1792 | h->non_zero_count_cache[scan8[n]] = 0; |
| @@ -1782,7 +1796,7 @@ static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM * · 3 unmodified lines | |||
| 1782 | } | 1796 | } |
| 1783 | 1797 | ||
| 1784 | static av_always_inline void | 1798 | static av_always_inline void |
| 1785 | decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block, | 1799 | decode_cabac_residual_dc_422(H264Context *h, int16_t *block, |
| 1786 | int cat, int n, const uint8_t *scantable, | 1800 | int cat, int n, const uint8_t *scantable, |
| 1787 | int max_coeff) | 1801 | int max_coeff) |
| 1788 | { | 1802 | { |
| @@ -1794,7 +1808,13 @@ decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block, · 5 unmodified lines | |||
| 1794 | decode_cabac_residual_dc_internal_422(h, block, cat, n, scantable, max_coeff); | 1808 | decode_cabac_residual_dc_internal_422(h, block, cat, n, scantable, max_coeff); |
| 1795 | } | 1809 | } |
| 1796 | 1810 | ||
| 1797 | 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 ) { | 1811 | static av_always_inline void decode_cabac_residual_nondc(H264Context *h, |
| 1812 | int16_t *block, | ||
| 1813 | int cat, int n, | ||
| 1814 | const uint8_t *scantable, | ||
| 1815 | const uint32_t *qmul, | ||
| 1816 | int max_coeff) | ||
| 1817 | { | ||
| 1798 | /* read coded block flag */ | 1818 | /* read coded block flag */ |
| 1799 | if( (cat != 5 || CHROMA444) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) { | 1819 | if( (cat != 5 || CHROMA444) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) { |
| 1800 | if( max_coeff == 64 ) { | 1820 | if( max_coeff == 64 ) { |
| @@ -2354,7 +2374,7 @@ decode_intra_mb: · 553 unmodified lines | |||
| 2354 | if( cbp&0x20 ) { | 2374 | if( cbp&0x20 ) { |
| 2355 | int c, i, i8x8; | 2375 | int c, i, i8x8; |
| 2356 | for( c = 0; c < 2; c++ ) { | 2376 | for( c = 0; c < 2; c++ ) { |
| 2357 | DCTELEM *mb = h->mb + (16*(16 + 16*c) << pixel_shift); | 2377 | int16_t *mb = h->mb + (16*(16 + 16*c) << pixel_shift); |
| 2358 | qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]]; | 2378 | qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]]; |
| 2359 | for (i8x8 = 0; i8x8 < 2; i8x8++) { | 2379 | for (i8x8 = 0; i8x8 < 2; i8x8++) { |
| 2360 | for (i = 0; i < 4; i++) { | 2380 | for (i = 0; i < 4; i++) { |
| @@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){ · 441 unmodified lines | |||
| 442 | * @param max_coeff number of coefficients in the block | 442 | * @param max_coeff number of coefficients in the block |
| 443 | * @return <0 if an error occurred | 443 | * @return <0 if an error occurred |
| 444 | */ | 444 | */ |
| 445 | static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ | 445 | static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){ |
| 446 | MpegEncContext * const s = &h->s; | 446 | MpegEncContext * const s = &h->s; |
| 447 | 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}; | 447 | 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}; |
| 448 | int level[16]; | 448 | int level[16]; |
| @@ -662,7 +662,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, GetBitContext * · 213 unmodified lines | |||
| 662 | for(i8x8=0; i8x8<4; i8x8++){ | 662 | for(i8x8=0; i8x8<4; i8x8++){ |
| 663 | if(cbp & (1<<i8x8)){ | 663 | if(cbp & (1<<i8x8)){ |
| 664 | if(IS_8x8DCT(mb_type)){ | 664 | if(IS_8x8DCT(mb_type)){ |
| 665 | DCTELEM *buf = &h->mb[64*i8x8+256*p << pixel_shift]; | 665 | int16_t *buf = &h->mb[64*i8x8+256*p << pixel_shift]; |
| 666 | uint8_t *nnz; | 666 | uint8_t *nnz; |
| 667 | for(i4x4=0; i4x4<4; i4x4++){ | 667 | for(i4x4=0; i4x4<4; i4x4++){ |
| 668 | const int index= i4x4 + 4*i8x8 + p*16; | 668 | const int index= i4x4 + 4*i8x8 + p*16; |
| @@ -1134,7 +1134,7 @@ decode_intra_mb: · 465 unmodified lines | |||
| 1134 | if(cbp&0x20){ | 1134 | if(cbp&0x20){ |
| 1135 | for(chroma_idx=0; chroma_idx<2; chroma_idx++){ | 1135 | for(chroma_idx=0; chroma_idx<2; chroma_idx++){ |
| 1136 | const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]]; | 1136 | const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]]; |
| 1137 | DCTELEM *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift); | 1137 | int16_t *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift); |
| 1138 | for (i8x8 = 0; i8x8 < 2; i8x8++) { | 1138 | for (i8x8 = 0; i8x8 < 2; i8x8++) { |
| 1139 | for (i4x4 = 0; i4x4 < 4; i4x4++) { | 1139 | for (i4x4 = 0; i4x4 < 4; i4x4++) { |
| 1140 | const int index = 16 + 16*chroma_idx + 8*i8x8 + i4x4; | 1140 | const int index = 16 + 16*chroma_idx + 8*i8x8 + i4x4; |
| @@ -52,7 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h) · 51 unmodified lines | |||
| 52 | const int transform_bypass = !SIMPLE && (s->qscale == 0 && h->sps.transform_bypass); | 52 | const int transform_bypass = !SIMPLE && (s->qscale == 0 && h->sps.transform_bypass); |
| 53 | /* is_h264 should always be true if SVQ3 is disabled. */ | 53 | /* is_h264 should always be true if SVQ3 is disabled. */ |
| 54 | const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || s->codec_id == AV_CODEC_ID_H264; | 54 | const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || s->codec_id == AV_CODEC_ID_H264; |
| 55 | void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride); | 55 | void (*idct_add)(uint8_t *dst, int16_t *block, int stride); |
| 56 | const int block_h = 16 >> s->chroma_y_shift; | 56 | const int block_h = 16 >> s->chroma_y_shift; |
| 57 | const int chroma422 = CHROMA422; | 57 | const int chroma422 = CHROMA422; |
| 58 | 58 | ||
| @@ -29,8 +29,6 @@ · 28 unmodified lines | |||
| 29 | 29 | ||
| 30 | #include <stdint.h> | 30 | #include <stdint.h> |
| 31 | 31 | ||
| 32 | #include "dsputil.h" | ||
| 33 | |||
| 34 | typedef void (*h264_weight_func)(uint8_t *block, int stride, int height, | 32 | typedef void (*h264_weight_func)(uint8_t *block, int stride, int height, |
| 35 | int log2_denom, int weight, int offset); | 33 | int log2_denom, int weight, int offset); |
| 36 | typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, | 34 | typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src, |
| @@ -80,29 +78,29 @@ typedef struct H264DSPContext { · 43 unmodified lines | |||
| 80 | 78 | ||
| 81 | /* IDCT */ | 79 | /* IDCT */ |
| 82 | void (*h264_idct_add)(uint8_t *dst /*align 4*/, | 80 | void (*h264_idct_add)(uint8_t *dst /*align 4*/, |
| 83 | DCTELEM *block /*align 16*/, int stride); | 81 | int16_t *block /*align 16*/, int stride); |
| 84 | void (*h264_idct8_add)(uint8_t *dst /*align 8*/, | 82 | void (*h264_idct8_add)(uint8_t *dst /*align 8*/, |
| 85 | DCTELEM *block /*align 16*/, int stride); | 83 | int16_t *block /*align 16*/, int stride); |
| 86 | void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/, | 84 | void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/, |
| 87 | DCTELEM *block /*align 16*/, int stride); | 85 | int16_t *block /*align 16*/, int stride); |
| 88 | void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/, | 86 | void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/, |
| 89 | DCTELEM *block /*align 16*/, int stride); | 87 | int16_t *block /*align 16*/, int stride); |
| 90 | 88 | ||
| 91 | void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset, | 89 | void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset, |
| 92 | DCTELEM *block /*align 16*/, int stride, | 90 | int16_t *block /*align 16*/, int stride, |
| 93 | const uint8_t nnzc[15 * 8]); | 91 | const uint8_t nnzc[15 * 8]); |
| 94 | void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset, | 92 | void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset, |
| 95 | DCTELEM *block /*align 16*/, int stride, | 93 | int16_t *block /*align 16*/, int stride, |
| 96 | const uint8_t nnzc[15 * 8]); | 94 | const uint8_t nnzc[15 * 8]); |
| 97 | void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset, | 95 | void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset, |
| 98 | DCTELEM *block /*align 16*/, int stride, | 96 | int16_t *block /*align 16*/, int stride, |
| 99 | const uint8_t nnzc[15 * 8]); | 97 | const uint8_t nnzc[15 * 8]); |
| 100 | void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset, | 98 | void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset, |
| 101 | DCTELEM *block /*align 16*/, | 99 | int16_t *block /*align 16*/, |
| 102 | int stride, const uint8_t nnzc[15 * 8]); | 100 | int stride, const uint8_t nnzc[15 * 8]); |
| 103 | void (*h264_luma_dc_dequant_idct)(DCTELEM *output, | 101 | void (*h264_luma_dc_dequant_idct)(int16_t *output, |
| 104 | DCTELEM *input /*align 16*/, int qmul); | 102 | int16_t *input /*align 16*/, int qmul); |
| 105 | void (*h264_chroma_dc_dequant_idct)(DCTELEM *block, int qmul); | 103 | void (*h264_chroma_dc_dequant_idct)(int16_t *block, int qmul); |
| 106 | } H264DSPContext; | 104 | } H264DSPContext; |
| 107 | 105 | ||
| 108 | void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, | 106 | void ff_h264dsp_init(H264DSPContext *c, const int bit_depth, |
| @@ -47,7 +47,7 @@ static const uint8_t scan8[16*3]={ · 46 unmodified lines | |||
| 47 | }; | 47 | }; |
| 48 | #endif | 48 | #endif |
| 49 | 49 | ||
| 50 | void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride) | 50 | void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride) |
| 51 | { | 51 | { |
| 52 | int i; | 52 | int i; |
| 53 | pixel *dst = (pixel*)_dst; | 53 | pixel *dst = (pixel*)_dst; |
| @@ -81,7 +81,7 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride) · 27 unmodified lines | |||
| 81 | } | 81 | } |
| 82 | } | 82 | } |
| 83 | 83 | ||
| 84 | void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ | 84 | void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){ |
| 85 | int i; | 85 | int i; |
| 86 | pixel *dst = (pixel*)_dst; | 86 | pixel *dst = (pixel*)_dst; |
| 87 | dctcoef *block = (dctcoef*)_block; | 87 | dctcoef *block = (dctcoef*)_block; |
| @@ -154,7 +154,7 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){ · 66 unmodified lines | |||
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | // assumes all AC coefs are 0 | 156 | // assumes all AC coefs are 0 |
| 157 | void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){ | 157 | void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, int16_t *block, int stride){ |
| 158 | int i, j; | 158 | int i, j; |
| 159 | int dc = (((dctcoef*)block)[0] + 32) >> 6; | 159 | int dc = (((dctcoef*)block)[0] + 32) >> 6; |
| 160 | pixel *dst = (pixel*)_dst; | 160 | pixel *dst = (pixel*)_dst; |
| @@ -167,7 +167,7 @@ void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){ · 6 unmodified lines | |||
| 167 | } | 167 | } |
| 168 | } | 168 | } |
| 169 | 169 | ||
| 170 | void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){ | 170 | void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *block, int stride){ |
| 171 | int i, j; | 171 | int i, j; |
| 172 | int dc = (((dctcoef*)block)[0] + 32) >> 6; | 172 | int dc = (((dctcoef*)block)[0] + 32) >> 6; |
| 173 | pixel *dst = (pixel*)_dst; | 173 | pixel *dst = (pixel*)_dst; |
| @@ -180,7 +180,7 @@ void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){ · 6 unmodified lines | |||
| 180 | } | 180 | } |
| 181 | } | 181 | } |
| 182 | 182 | ||
| 183 | void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 183 | void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ |
| 184 | int i; | 184 | int i; |
| 185 | for(i=0; i<16; i++){ | 185 | for(i=0; i<16; i++){ |
| 186 | int nnz = nnzc[ scan8[i] ]; | 186 | int nnz = nnzc[ scan8[i] ]; |
| @@ -191,7 +191,7 @@ void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *b · 4 unmodified lines | |||
| 191 | } | 191 | } |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 194 | void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ |
| 195 | int i; | 195 | int i; |
| 196 | for(i=0; i<16; i++){ | 196 | for(i=0; i<16; i++){ |
| 197 | if(nnzc[ scan8[i] ]) FUNCC(ff_h264_idct_add )(dst + block_offset[i], block + i*16*sizeof(pixel), stride); | 197 | 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 · 1 unmodified line | |||
| 199 | } | 199 | } |
| 200 | } | 200 | } |
| 201 | 201 | ||
| 202 | void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 202 | void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ |
| 203 | int i; | 203 | int i; |
| 204 | for(i=0; i<16; i+=4){ | 204 | for(i=0; i<16; i+=4){ |
| 205 | int nnz = nnzc[ scan8[i] ]; | 205 | int nnz = nnzc[ scan8[i] ]; |
| @@ -210,7 +210,7 @@ void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *b · 4 unmodified lines | |||
| 210 | } | 210 | } |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 213 | void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){ |
| 214 | int i, j; | 214 | int i, j; |
| 215 | for(j=1; j<3; j++){ | 215 | for(j=1; j<3; j++){ |
| 216 | for(i=j*16; i<j*16+4; i++){ | 216 | 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 * · 5 unmodified lines | |||
| 222 | } | 222 | } |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 225 | 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]){ |
| 226 | int i, j; | 226 | int i, j; |
| 227 | 227 | ||
| 228 | for(j=1; j<3; j++){ | 228 | 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 · 19 unmodified lines | |||
| 248 | * IDCT transforms the 16 dc values and dequantizes them. | 248 | * IDCT transforms the 16 dc values and dequantizes them. |
| 249 | * @param qmul quantization parameter | 249 | * @param qmul quantization parameter |
| 250 | */ | 250 | */ |
| 251 | void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *_output, DCTELEM *_input, int qmul){ | 251 | void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){ |
| 252 | #define stride 16 | 252 | #define stride 16 |
| 253 | int i; | 253 | int i; |
| 254 | int temp[16]; | 254 | int temp[16]; |
| @@ -283,7 +283,7 @@ void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *_output, DCTELEM *_input, int · 28 unmodified lines | |||
| 283 | #undef stride | 283 | #undef stride |
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){ | 286 | void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){ |
| 287 | const int stride= 16*2; | 287 | const int stride= 16*2; |
| 288 | const int xStride= 16; | 288 | const int xStride= 16; |
| 289 | int i; | 289 | int i; |
| @@ -310,7 +310,7 @@ void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){ · 20 unmodified lines | |||
| 310 | } | 310 | } |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | void FUNCC(ff_h264_chroma_dc_dequant_idct)(DCTELEM *_block, int qmul){ | 313 | void FUNCC(ff_h264_chroma_dc_dequant_idct)(int16_t *_block, int qmul){ |
| 314 | const int stride= 16*2; | 314 | const int stride= 16*2; |
| 315 | const int xStride= 16; | 315 | const int xStride= 16; |
| 316 | int a,b,c,d,e; | 316 | int a,b,c,d,e; |
| @@ -28,8 +28,8 @@ · 27 unmodified lines | |||
| 28 | #ifndef AVCODEC_H264PRED_H | 28 | #ifndef AVCODEC_H264PRED_H |
| 29 | #define AVCODEC_H264PRED_H | 29 | #define AVCODEC_H264PRED_H |
| 30 | 30 | ||
| 31 | #include "libavutil/common.h" | 31 | #include <stddef.h> |
| 32 | #include "dsputil.h" | 32 | #include <stdint.h> |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * Prediction types | 35 | * Prediction types |
| @@ -98,15 +98,15 @@ typedef struct H264PredContext { · 62 unmodified lines | |||
| 98 | void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride); | 98 | void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride); |
| 99 | 99 | ||
| 100 | void(*pred4x4_add[2])(uint8_t *pix /*align 4*/, | 100 | void(*pred4x4_add[2])(uint8_t *pix /*align 4*/, |
| 101 | const DCTELEM *block /*align 16*/, ptrdiff_t stride); | 101 | const int16_t *block /*align 16*/, ptrdiff_t stride); |
| 102 | void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/, | 102 | void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/, |
| 103 | const DCTELEM *block /*align 16*/, ptrdiff_t stride); | 103 | const int16_t *block /*align 16*/, ptrdiff_t stride); |
| 104 | void(*pred8x8_add[3])(uint8_t *pix /*align 8*/, | 104 | void(*pred8x8_add[3])(uint8_t *pix /*align 8*/, |
| 105 | const int *block_offset, | 105 | const int *block_offset, |
| 106 | const DCTELEM *block /*align 16*/, ptrdiff_t stride); | 106 | const int16_t *block /*align 16*/, ptrdiff_t stride); |
| 107 | void(*pred16x16_add[3])(uint8_t *pix /*align 16*/, | 107 | void(*pred16x16_add[3])(uint8_t *pix /*align 16*/, |
| 108 | const int *block_offset, | 108 | const int *block_offset, |
| 109 | const DCTELEM *block /*align 16*/, ptrdiff_t stride); | 109 | const int16_t *block /*align 16*/, ptrdiff_t stride); |
| 110 | } H264PredContext; | 110 | } H264PredContext; |
| 111 | 111 | ||
| 112 | void ff_h264_pred_init(H264PredContext *h, int codec_id, | 112 | void ff_h264_pred_init(H264PredContext *h, int codec_id, |
| @@ -1131,7 +1131,7 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, · 1130 unmodified lines | |||
| 1131 | #undef PL | 1131 | #undef PL |
| 1132 | #undef SRC | 1132 | #undef SRC |
| 1133 | 1133 | ||
| 1134 | static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, | 1134 | static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block, |
| 1135 | ptrdiff_t stride) | 1135 | ptrdiff_t stride) |
| 1136 | { | 1136 | { |
| 1137 | int i; | 1137 | int i; |
| @@ -1150,7 +1150,7 @@ static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block, · 12 unmodified lines | |||
| 1150 | } | 1150 | } |
| 1151 | } | 1151 | } |
| 1152 | 1152 | ||
| 1153 | static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, | 1153 | static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block, |
| 1154 | ptrdiff_t stride) | 1154 | ptrdiff_t stride) |
| 1155 | { | 1155 | { |
| 1156 | int i; | 1156 | int i; |
| @@ -1168,7 +1168,7 @@ static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, · 11 unmodified lines | |||
| 1168 | } | 1168 | } |
| 1169 | } | 1169 | } |
| 1170 | 1170 | ||
| 1171 | static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, | 1171 | static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const int16_t *_block, |
| 1172 | ptrdiff_t stride) | 1172 | ptrdiff_t stride) |
| 1173 | { | 1173 | { |
| 1174 | int i; | 1174 | int i; |
| @@ -1191,7 +1191,7 @@ static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block, · 16 unmodified lines | |||
| 1191 | } | 1191 | } |
| 1192 | } | 1192 | } |
| 1193 | 1193 | ||
| 1194 | static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, | 1194 | static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block, |
| 1195 | ptrdiff_t stride) | 1195 | ptrdiff_t stride) |
| 1196 | { | 1196 | { |
| 1197 | int i; | 1197 | int i; |
| @@ -1214,7 +1214,7 @@ static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block, · 16 unmodified lines | |||
| 1214 | } | 1214 | } |
| 1215 | 1215 | ||
| 1216 | static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, | 1216 | static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, |
| 1217 | const DCTELEM *block, | 1217 | const int16_t *block, |
| 1218 | ptrdiff_t stride) | 1218 | ptrdiff_t stride) |
| 1219 | { | 1219 | { |
| 1220 | int i; | 1220 | int i; |
| @@ -1224,7 +1224,7 @@ static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset, · 3 unmodified lines | |||
| 1224 | 1224 | ||
| 1225 | static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, | 1225 | static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, |
| 1226 | const int *block_offset, | 1226 | const int *block_offset, |
| 1227 | const DCTELEM *block, | 1227 | const int16_t *block, |
| 1228 | ptrdiff_t stride) | 1228 | ptrdiff_t stride) |
| 1229 | { | 1229 | { |
| 1230 | int i; | 1230 | int i; |
| @@ -1233,7 +1233,7 @@ static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix, · 2 unmodified lines | |||
| 1233 | } | 1233 | } |
| 1234 | 1234 | ||
| 1235 | static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, | 1235 | static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, |
| 1236 | const DCTELEM *block, ptrdiff_t stride) | 1236 | const int16_t *block, ptrdiff_t stride) |
| 1237 | { | 1237 | { |
| 1238 | int i; | 1238 | int i; |
| 1239 | for(i=0; i<4; i++) | 1239 | for(i=0; i<4; i++) |
| @@ -1241,7 +1241,7 @@ static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset, · 1 unmodified line | |||
| 1241 | } | 1241 | } |
| 1242 | 1242 | ||
| 1243 | static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, | 1243 | static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, |
| 1244 | const DCTELEM *block, ptrdiff_t stride) | 1244 | const int16_t *block, ptrdiff_t stride) |
| 1245 | { | 1245 | { |
| 1246 | int i; | 1246 | int i; |
| 1247 | for(i=0; i<4; i++) | 1247 | for(i=0; i<4; i++) |
| @@ -1251,7 +1251,7 @@ static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset, · 3 unmodified lines | |||
| 1251 | } | 1251 | } |
| 1252 | 1252 | ||
| 1253 | static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, | 1253 | static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, |
| 1254 | const DCTELEM *block, | 1254 | const int16_t *block, |
| 1255 | ptrdiff_t stride) | 1255 | ptrdiff_t stride) |
| 1256 | { | 1256 | { |
| 1257 | int i; | 1257 | int i; |
| @@ -1261,7 +1261,7 @@ static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset, · 3 unmodified lines | |||
| 1261 | 1261 | ||
| 1262 | static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, | 1262 | static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix, |
| 1263 | const int *block_offset, | 1263 | const int *block_offset, |
| 1264 | const DCTELEM *block, ptrdiff_t stride) | 1264 | const int16_t *block, ptrdiff_t stride) |
| 1265 | { | 1265 | { |
| 1266 | int i; | 1266 | int i; |
| 1267 | for(i=0; i<4; i++) | 1267 | for(i=0; i<4; i++) |
| @@ -438,7 +438,7 @@ static void h263_decode_dquant(MpegEncContext *s){ · 437 unmodified lines | |||
| 438 | ff_set_qscale(s, s->qscale); | 438 | ff_set_qscale(s, s->qscale); |
| 439 | } | 439 | } |
| 440 | 440 | ||
| 441 | static int h263_decode_block(MpegEncContext * s, DCTELEM * block, | 441 | static int h263_decode_block(MpegEncContext * s, int16_t * block, |
| 442 | int n, int coded) | 442 | int n, int coded) |
| 443 | { | 443 | { |
| 444 | int code, level, i, j, last, run; | 444 | int code, level, i, j, last, run; |
| @@ -563,7 +563,7 @@ not_coded: · 118 unmodified lines | |||
| 563 | 563 | ||
| 564 | static int h263_skip_b_part(MpegEncContext *s, int cbp) | 564 | static int h263_skip_b_part(MpegEncContext *s, int cbp) |
| 565 | { | 565 | { |
| 566 | LOCAL_ALIGNED_16(DCTELEM, dblock, [64]); | 566 | LOCAL_ALIGNED_16(int16_t, dblock, [64]); |
| 567 | int i, mbi; | 567 | int i, mbi; |
| 568 | 568 | ||
| 569 | /* we have to set s->mb_intra to zero to decode B-part of PB-frame correctly | 569 | /* 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) · 29 unmodified lines | |||
| 599 | } | 599 | } |
| 600 | 600 | ||
| 601 | int ff_h263_decode_mb(MpegEncContext *s, | 601 | int ff_h263_decode_mb(MpegEncContext *s, |
| 602 | DCTELEM block[6][64]) | 602 | int16_t block[6][64]) |
| 603 | { | 603 | { |
| 604 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; | 604 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; |
| 605 | int16_t *mot_val; | 605 | int16_t *mot_val; |
| @@ -306,7 +306,7 @@ static const int dquant_code[5]= {1,0,9,2,3}; · 305 unmodified lines | |||
| 306 | * @param block the 8x8 block | 306 | * @param block the 8x8 block |
| 307 | * @param n block index (0-3 are luma, 4-5 are chroma) | 307 | * @param n block index (0-3 are luma, 4-5 are chroma) |
| 308 | */ | 308 | */ |
| 309 | static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n) | 309 | static void h263_encode_block(MpegEncContext * s, int16_t * block, int n) |
| 310 | { | 310 | { |
| 311 | int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code; | 311 | int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code; |
| 312 | RLTable *rl; | 312 | RLTable *rl; |
| @@ -455,7 +455,7 @@ static void h263p_encode_umotion(MpegEncContext * s, int val) · 142 unmodified lines | |||
| 455 | } | 455 | } |
| 456 | 456 | ||
| 457 | void ff_h263_encode_mb(MpegEncContext * s, | 457 | void ff_h263_encode_mb(MpegEncContext * s, |
| 458 | DCTELEM block[6][64], | 458 | int16_t block[6][64], |
| 459 | int motion_x, int motion_y) | 459 | int motion_x, int motion_y) |
| 460 | { | 460 | { |
| 461 | int cbpc, cbpy, i, cbp, pred_x, pred_y; | 461 | int cbpc, cbpy, i, cbp, pred_x, pred_y; |
| @@ -136,17 +136,17 @@ · 135 unmodified lines | |||
| 136 | #endif | 136 | #endif |
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | /* Multiply a DCTELEM variable by an int32_t constant, and immediately | 139 | /* Multiply a int16_t variable by an int32_t constant, and immediately |
| 140 | * descale to yield a DCTELEM result. | 140 | * descale to yield a int16_t result. |
| 141 | */ | 141 | */ |
| 142 | 142 | ||
| 143 | #define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS)) | 143 | #define MULTIPLY(var,const) ((int16_t) DESCALE((var) * (const), CONST_BITS)) |
| 144 | 144 | ||
| 145 | static av_always_inline void row_fdct(DCTELEM * data){ | 145 | static av_always_inline void row_fdct(int16_t * data){ |
| 146 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 146 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 147 | int tmp10, tmp11, tmp12, tmp13; | 147 | int tmp10, tmp11, tmp12, tmp13; |
| 148 | int z1, z2, z3, z4, z5, z11, z13; | 148 | int z1, z2, z3, z4, z5, z11, z13; |
| 149 | DCTELEM *dataptr; | 149 | int16_t *dataptr; |
| 150 | int ctr; | 150 | int ctr; |
| 151 | 151 | ||
| 152 | /* Pass 1: process rows. */ | 152 | /* Pass 1: process rows. */ |
| @@ -205,12 +205,12 @@ static av_always_inline void row_fdct(DCTELEM * data){ · 52 unmodified lines | |||
| 205 | */ | 205 | */ |
| 206 | 206 | ||
| 207 | GLOBAL(void) | 207 | GLOBAL(void) |
| 208 | ff_fdct_ifast (DCTELEM * data) | 208 | ff_fdct_ifast (int16_t * data) |
| 209 | { | 209 | { |
| 210 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 210 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 211 | int tmp10, tmp11, tmp12, tmp13; | 211 | int tmp10, tmp11, tmp12, tmp13; |
| 212 | int z1, z2, z3, z4, z5, z11, z13; | 212 | int z1, z2, z3, z4, z5, z11, z13; |
| 213 | DCTELEM *dataptr; | 213 | int16_t *dataptr; |
| 214 | int ctr; | 214 | int ctr; |
| 215 | 215 | ||
| 216 | row_fdct(data); | 216 | row_fdct(data); |
| @@ -271,12 +271,12 @@ ff_fdct_ifast (DCTELEM * data) · 54 unmodified lines | |||
| 271 | */ | 271 | */ |
| 272 | 272 | ||
| 273 | GLOBAL(void) | 273 | GLOBAL(void) |
| 274 | ff_fdct_ifast248 (DCTELEM * data) | 274 | ff_fdct_ifast248 (int16_t * data) |
| 275 | { | 275 | { |
| 276 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 276 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 277 | int tmp10, tmp11, tmp12, tmp13; | 277 | int tmp10, tmp11, tmp12, tmp13; |
| 278 | int z1; | 278 | int z1; |
| 279 | DCTELEM *dataptr; | 279 | int16_t *dataptr; |
| 280 | int ctr; | 280 | int ctr; |
| 281 | 281 | ||
| 282 | row_fdct(data); | 282 | row_fdct(data); |
| @@ -184,12 +184,12 @@ · 183 unmodified lines | |||
| 184 | #endif | 184 | #endif |
| 185 | 185 | ||
| 186 | 186 | ||
| 187 | static av_always_inline void FUNC(row_fdct)(DCTELEM *data) | 187 | static av_always_inline void FUNC(row_fdct)(int16_t *data) |
| 188 | { | 188 | { |
| 189 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 189 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 190 | int tmp10, tmp11, tmp12, tmp13; | 190 | int tmp10, tmp11, tmp12, tmp13; |
| 191 | int z1, z2, z3, z4, z5; | 191 | int z1, z2, z3, z4, z5; |
| 192 | DCTELEM *dataptr; | 192 | int16_t *dataptr; |
| 193 | int ctr; | 193 | int ctr; |
| 194 | 194 | ||
| 195 | /* Pass 1: process rows. */ | 195 | /* Pass 1: process rows. */ |
| @@ -216,13 +216,13 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data) · 20 unmodified lines | |||
| 216 | tmp11 = tmp1 + tmp2; | 216 | tmp11 = tmp1 + tmp2; |
| 217 | tmp12 = tmp1 - tmp2; | 217 | tmp12 = tmp1 - tmp2; |
| 218 | 218 | ||
| 219 | dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS); | 219 | dataptr[0] = (int16_t) ((tmp10 + tmp11) << PASS1_BITS); |
| 220 | dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS); | 220 | dataptr[4] = (int16_t) ((tmp10 - tmp11) << PASS1_BITS); |
| 221 | 221 | ||
| 222 | z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); | 222 | z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100); |
| 223 | dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), | 223 | dataptr[2] = (int16_t) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865), |
| 224 | CONST_BITS-PASS1_BITS); | 224 | CONST_BITS-PASS1_BITS); |
| 225 | dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), | 225 | dataptr[6] = (int16_t) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065), |
| 226 | CONST_BITS-PASS1_BITS); | 226 | CONST_BITS-PASS1_BITS); |
| 227 | 227 | ||
| 228 | /* Odd part per figure 8 --- note paper omits factor of sqrt(2). | 228 | /* 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) · 19 unmodified lines | |||
| 248 | z3 += z5; | 248 | z3 += z5; |
| 249 | z4 += z5; | 249 | z4 += z5; |
| 250 | 250 | ||
| 251 | dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); | 251 | dataptr[7] = (int16_t) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS); |
| 252 | dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); | 252 | dataptr[5] = (int16_t) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS); |
| 253 | dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); | 253 | dataptr[3] = (int16_t) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS); |
| 254 | dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); | 254 | dataptr[1] = (int16_t) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS); |
| 255 | 255 | ||
| 256 | dataptr += DCTSIZE; /* advance pointer to next row */ | 256 | dataptr += DCTSIZE; /* advance pointer to next row */ |
| 257 | } | 257 | } |
| @@ -262,12 +262,12 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data) · 4 unmodified lines | |||
| 262 | */ | 262 | */ |
| 263 | 263 | ||
| 264 | GLOBAL(void) | 264 | GLOBAL(void) |
| 265 | FUNC(ff_jpeg_fdct_islow)(DCTELEM *data) | 265 | FUNC(ff_jpeg_fdct_islow)(int16_t *data) |
| 266 | { | 266 | { |
| 267 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 267 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 268 | int tmp10, tmp11, tmp12, tmp13; | 268 | int tmp10, tmp11, tmp12, tmp13; |
| 269 | int z1, z2, z3, z4, z5; | 269 | int z1, z2, z3, z4, z5; |
| 270 | DCTELEM *dataptr; | 270 | int16_t *dataptr; |
| 271 | int ctr; | 271 | int ctr; |
| 272 | 272 | ||
| 273 | FUNC(row_fdct)(data); | 273 | FUNC(row_fdct)(data); |
| @@ -344,12 +344,12 @@ FUNC(ff_jpeg_fdct_islow)(DCTELEM *data) · 70 unmodified lines | |||
| 344 | * you do even part two times. | 344 | * you do even part two times. |
| 345 | */ | 345 | */ |
| 346 | GLOBAL(void) | 346 | GLOBAL(void) |
| 347 | FUNC(ff_fdct248_islow)(DCTELEM *data) | 347 | FUNC(ff_fdct248_islow)(int16_t *data) |
| 348 | { | 348 | { |
| 349 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; | 349 | int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; |
| 350 | int tmp10, tmp11, tmp12, tmp13; | 350 | int tmp10, tmp11, tmp12, tmp13; |
| 351 | int z1; | 351 | int z1; |
| 352 | DCTELEM *dataptr; | 352 | int16_t *dataptr; |
| 353 | int ctr; | 353 | int ctr; |
| 354 | 354 | ||
| 355 | FUNC(row_fdct)(data); | 355 | FUNC(row_fdct)(data); |
| @@ -74,7 +74,7 @@ · 73 unmodified lines | |||
| 74 | 74 | ||
| 75 | #define RIGHT_SHIFT(x, n) ((x) >> (n)) | 75 | #define RIGHT_SHIFT(x, n) ((x) >> (n)) |
| 76 | 76 | ||
| 77 | typedef DCTELEM DCTBLOCK[DCTSIZE2]; | 77 | typedef int16_t DCTBLOCK[DCTSIZE2]; |
| 78 | 78 | ||
| 79 | #define CONST_BITS 13 | 79 | #define CONST_BITS 13 |
| 80 | 80 | ||
| @@ -213,7 +213,7 @@ void ff_j_rev_dct(DCTBLOCK data) · 132 unmodified lines | |||
| 213 | int32_t tmp10, tmp11, tmp12, tmp13; | 213 | int32_t tmp10, tmp11, tmp12, tmp13; |
| 214 | int32_t z1, z2, z3, z4, z5; | 214 | int32_t z1, z2, z3, z4, z5; |
| 215 | int32_t d0, d1, d2, d3, d4, d5, d6, d7; | 215 | int32_t d0, d1, d2, d3, d4, d5, d6, d7; |
| 216 | register DCTELEM *dataptr; | 216 | register int16_t *dataptr; |
| 217 | int rowctr; | 217 | int rowctr; |
| 218 | 218 | ||
| 219 | /* Pass 1: process rows. */ | 219 | /* Pass 1: process rows. */ |
| @@ -249,7 +249,7 @@ void ff_j_rev_dct(DCTBLOCK data) · 29 unmodified lines | |||
| 249 | /* AC terms all zero */ | 249 | /* AC terms all zero */ |
| 250 | if (d0) { | 250 | if (d0) { |
| 251 | /* Compute a 32 bit value to assign. */ | 251 | /* Compute a 32 bit value to assign. */ |
| 252 | DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS); | 252 | int16_t dcval = (int16_t) (d0 << PASS1_BITS); |
| 253 | register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); | 253 | register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000); |
| 254 | 254 | ||
| 255 | idataptr[0] = v; | 255 | idataptr[0] = v; |
| @@ -574,14 +574,14 @@ void ff_j_rev_dct(DCTBLOCK data) · 318 unmodified lines | |||
| 574 | } | 574 | } |
| 575 | /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ | 575 | /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ |
| 576 | 576 | ||
| 577 | dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); | 577 | dataptr[0] = (int16_t) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS); |
| 578 | dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); | 578 | dataptr[7] = (int16_t) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS); |
| 579 | dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); | 579 | dataptr[1] = (int16_t) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS); |
| 580 | dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); | 580 | dataptr[6] = (int16_t) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS); |
| 581 | dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); | 581 | dataptr[2] = (int16_t) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS); |
| 582 | dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); | 582 | dataptr[5] = (int16_t) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS); |
| 583 | dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); | 583 | dataptr[3] = (int16_t) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS); |
| 584 | dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); | 584 | dataptr[4] = (int16_t) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS); |
| 585 | 585 | ||
| 586 | dataptr += DCTSIZE; /* advance pointer to next row */ | 586 | dataptr += DCTSIZE; /* advance pointer to next row */ |
| 587 | } | 587 | } |
| @@ -920,21 +920,21 @@ void ff_j_rev_dct(DCTBLOCK data) · 332 unmodified lines | |||
| 920 | 920 | ||
| 921 | /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ | 921 | /* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */ |
| 922 | 922 | ||
| 923 | dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3, | 923 | dataptr[DCTSIZE*0] = (int16_t) DESCALE(tmp10 + tmp3, |
| 924 | CONST_BITS+PASS1_BITS+3); | 924 | CONST_BITS+PASS1_BITS+3); |
| 925 | dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3, | 925 | dataptr[DCTSIZE*7] = (int16_t) DESCALE(tmp10 - tmp3, |
| 926 | CONST_BITS+PASS1_BITS+3); | 926 | CONST_BITS+PASS1_BITS+3); |
| 927 | dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2, | 927 | dataptr[DCTSIZE*1] = (int16_t) DESCALE(tmp11 + tmp2, |
| 928 | CONST_BITS+PASS1_BITS+3); | 928 | CONST_BITS+PASS1_BITS+3); |
| 929 | dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2, | 929 | dataptr[DCTSIZE*6] = (int16_t) DESCALE(tmp11 - tmp2, |
| 930 | CONST_BITS+PASS1_BITS+3); | 930 | CONST_BITS+PASS1_BITS+3); |
| 931 | dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1, | 931 | dataptr[DCTSIZE*2] = (int16_t) DESCALE(tmp12 + tmp1, |
| 932 | CONST_BITS+PASS1_BITS+3); | 932 | CONST_BITS+PASS1_BITS+3); |
| 933 | dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1, | 933 | dataptr[DCTSIZE*5] = (int16_t) DESCALE(tmp12 - tmp1, |
| 934 | CONST_BITS+PASS1_BITS+3); | 934 | CONST_BITS+PASS1_BITS+3); |
| 935 | dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0, | 935 | dataptr[DCTSIZE*3] = (int16_t) DESCALE(tmp13 + tmp0, |
| 936 | CONST_BITS+PASS1_BITS+3); | 936 | CONST_BITS+PASS1_BITS+3); |
| 937 | dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0, | 937 | dataptr[DCTSIZE*4] = (int16_t) DESCALE(tmp13 - tmp0, |
| 938 | CONST_BITS+PASS1_BITS+3); | 938 | CONST_BITS+PASS1_BITS+3); |
| 939 | 939 | ||
| 940 | dataptr++; /* advance pointer to next column */ | 940 | dataptr++; /* advance pointer to next column */ |
| @@ -45,14 +45,14 @@ typedef struct MDECContext{ · 44 unmodified lines | |||
| 45 | int mb_width; | 45 | int mb_width; |
| 46 | int mb_height; | 46 | int mb_height; |
| 47 | int mb_x, mb_y; | 47 | int mb_x, mb_y; |
| 48 | DECLARE_ALIGNED(16, DCTELEM, block)[6][64]; | 48 | DECLARE_ALIGNED(16, int16_t, block)[6][64]; |
| 49 | uint8_t *bitstream_buffer; | 49 | uint8_t *bitstream_buffer; |
| 50 | unsigned int bitstream_buffer_size; | 50 | unsigned int bitstream_buffer_size; |
| 51 | int block_last_index[6]; | 51 | int block_last_index[6]; |
| 52 | } MDECContext; | 52 | } MDECContext; |
| 53 | 53 | ||
| 54 | //very similar to MPEG-1 | 54 | //very similar to MPEG-1 |
| 55 | static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n) | 55 | static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n) |
| 56 | { | 56 | { |
| 57 | int level, diff, i, j, run; | 57 | int level, diff, i, j, run; |
| 58 | int component; | 58 | int component; |
| @@ -119,7 +119,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n) · 60 unmodified lines | |||
| 119 | return 0; | 119 | return 0; |
| 120 | } | 120 | } |
| 121 | 121 | ||
| 122 | static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){ | 122 | static inline int decode_mb(MDECContext *a, int16_t block[6][64]){ |
| 123 | int i; | 123 | int i; |
| 124 | const int block_index[6]= {5,4,0,1,2,3}; | 124 | const int block_index[6]= {5,4,0,1,2,3}; |
| 125 | 125 | ||
| @@ -134,7 +134,7 @@ static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){ · 8 unmodified lines | |||
| 134 | } | 134 | } |
| 135 | 135 | ||
| 136 | static inline void idct_put(MDECContext *a, int mb_x, int mb_y){ | 136 | static inline void idct_put(MDECContext *a, int mb_x, int mb_y){ |
| 137 | DCTELEM (*block)[64]= a->block; | 137 | int16_t (*block)[64]= a->block; |
| 138 | int linesize= a->picture.linesize[0]; | 138 | int linesize= a->picture.linesize[0]; |
| 139 | 139 | ||
| 140 | uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; | 140 | uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16; |
| @@ -47,7 +47,7 @@ typedef struct { · 46 unmodified lines | |||
| 47 | AVFrame buf_ptrs [16]; | 47 | AVFrame buf_ptrs [16]; |
| 48 | AVPicture flipped_ptrs[16]; | 48 | AVPicture flipped_ptrs[16]; |
| 49 | 49 | ||
| 50 | DECLARE_ALIGNED(16, DCTELEM, dct_block)[64]; | 50 | DECLARE_ALIGNED(16, int16_t, dct_block)[64]; |
| 51 | 51 | ||
| 52 | GetBitContext gb; | 52 | GetBitContext gb; |
| 53 | ScanTable scantable; | 53 | ScanTable scantable; |
| @@ -183,7 +183,7 @@ static const int8_t vlcdec_lookup[9][64] = { · 129 unmodified lines | |||
| 183 | 183 | ||
| 184 | static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale) | 184 | static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale) |
| 185 | { | 185 | { |
| 186 | DCTELEM *block = ctx->dct_block; | 186 | int16_t *block = ctx->dct_block; |
| 187 | unsigned int pos; | 187 | unsigned int pos; |
| 188 | 188 | ||
| 189 | ctx->dsp.clear_block(block); | 189 | ctx->dsp.clear_block(block); |
| @@ -408,7 +408,7 @@ static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index) · 407 unmodified lines | |||
| 408 | } | 408 | } |
| 409 | 409 | ||
| 410 | /* decode block and dequantize */ | 410 | /* decode block and dequantize */ |
| 411 | static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component, | 411 | static int decode_block(MJpegDecodeContext *s, int16_t *block, int component, |
| 412 | int dc_index, int ac_index, int16_t *quant_matrix) | 412 | int dc_index, int ac_index, int16_t *quant_matrix) |
| 413 | { | 413 | { |
| 414 | int code, i, j, level, val; | 414 | int code, i, j, level, val; |
| @@ -456,7 +456,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component, · 41 unmodified lines | |||
| 456 | return 0; | 456 | return 0; |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block, | 459 | static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block, |
| 460 | int component, int dc_index, | 460 | int component, int dc_index, |
| 461 | int16_t *quant_matrix, int Al) | 461 | int16_t *quant_matrix, int Al) |
| 462 | { | 462 | { |
| @@ -474,7 +474,7 @@ static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block, · 11 unmodified lines | |||
| 474 | } | 474 | } |
| 475 | 475 | ||
| 476 | /* decode block and dequantize - progressive JPEG version */ | 476 | /* decode block and dequantize - progressive JPEG version */ |
| 477 | static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, | 477 | static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block, |
| 478 | uint8_t *last_nnz, int ac_index, | 478 | uint8_t *last_nnz, int ac_index, |
| 479 | int16_t *quant_matrix, | 479 | int16_t *quant_matrix, |
| 480 | int ss, int se, int Al, int *EOBRUN) | 480 | int ss, int se, int Al, int *EOBRUN) |
| @@ -572,7 +572,7 @@ for (; ; i++) { \ · 91 unmodified lines | |||
| 572 | } | 572 | } |
| 573 | 573 | ||
| 574 | /* decode block and dequantize - progressive JPEG refinement pass */ | 574 | /* decode block and dequantize - progressive JPEG refinement pass */ |
| 575 | static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block, | 575 | static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block, |
| 576 | uint8_t *last_nnz, | 576 | uint8_t *last_nnz, |
| 577 | int ac_index, int16_t *quant_matrix, | 577 | int ac_index, int16_t *quant_matrix, |
| 578 | int ss, int se, int Al, int *EOBRUN) | 578 | int ss, int se, int Al, int *EOBRUN) |
| @@ -880,7 +880,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah, · 301 unmodified lines | |||
| 880 | } else { | 880 | } else { |
| 881 | int block_idx = s->block_stride[c] * (v * mb_y + y) + | 881 | int block_idx = s->block_stride[c] * (v * mb_y + y) + |
| 882 | (h * mb_x + x); | 882 | (h * mb_x + x); |
| 883 | DCTELEM *block = s->blocks[c][block_idx]; | 883 | int16_t *block = s->blocks[c][block_idx]; |
| 884 | if (Ah) | 884 | if (Ah) |
| 885 | block[0] += get_bits1(&s->gb) * | 885 | block[0] += get_bits1(&s->gb) * |
| 886 | s->quant_matrixes[s->quant_index[c]][0] << Al; | 886 | s->quant_matrixes[s->quant_index[c]][0] << Al; |
| @@ -957,7 +957,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss, · 70 unmodified lines | |||
| 957 | int block_offset = mb_y * linesize * 8; | 957 | int block_offset = mb_y * linesize * 8; |
| 958 | uint8_t *ptr = data + block_offset; | 958 | uint8_t *ptr = data + block_offset; |
| 959 | int block_idx = mb_y * s->block_stride[c]; | 959 | int block_idx = mb_y * s->block_stride[c]; |
| 960 | DCTELEM (*block)[64] = &s->blocks[c][block_idx]; | 960 | int16_t (*block)[64] = &s->blocks[c][block_idx]; |
| 961 | uint8_t *last_nnz = &s->last_nnz[c][block_idx]; | 961 | uint8_t *last_nnz = &s->last_nnz[c][block_idx]; |
| 962 | for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) { | 962 | for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) { |
| 963 | const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb); | 963 | const int copy_mb = mb_bitmask && !get_bits1(&mb_bitmask_gb); |
| @@ -88,8 +88,8 @@ typedef struct MJpegDecodeContext { · 87 unmodified lines | |||
| 88 | int got_picture; ///< we found a SOF and picture is valid, too. | 88 | int got_picture; ///< we found a SOF and picture is valid, too. |
| 89 | int linesize[MAX_COMPONENTS]; ///< linesize << interlaced | 89 | int linesize[MAX_COMPONENTS]; ///< linesize << interlaced |
| 90 | int8_t *qscale_table; | 90 | int8_t *qscale_table; |
| 91 | DECLARE_ALIGNED(16, DCTELEM, block)[64]; | 91 | DECLARE_ALIGNED(16, int16_t, block)[64]; |
| 92 | DCTELEM (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) | 92 | int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode) |
| 93 | uint8_t *last_nnz[MAX_COMPONENTS]; | 93 | uint8_t *last_nnz[MAX_COMPONENTS]; |
| 94 | uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode) | 94 | uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode) |
| 95 | ScanTable scantable; | 95 | ScanTable scantable; |
| @@ -369,7 +369,7 @@ void ff_mjpeg_encode_dc(MpegEncContext *s, int val, · 368 unmodified lines | |||
| 369 | } | 369 | } |
| 370 | } | 370 | } |
| 371 | 371 | ||
| 372 | static void encode_block(MpegEncContext *s, DCTELEM *block, int n) | 372 | static void encode_block(MpegEncContext *s, int16_t *block, int n) |
| 373 | { | 373 | { |
| 374 | int mant, nbits, code, i, j; | 374 | int mant, nbits, code, i, j; |
| 375 | int component, dc, run, last_index, val; | 375 | int component, dc, run, last_index, val; |
| @@ -427,7 +427,7 @@ static void encode_block(MpegEncContext *s, DCTELEM *block, int n) · 51 unmodified lines | |||
| 427 | put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]); | 427 | put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]); |
| 428 | } | 428 | } |
| 429 | 429 | ||
| 430 | void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]) | 430 | void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]) |
| 431 | { | 431 | { |
| 432 | int i; | 432 | int i; |
| 433 | for(i=0;i<5;i++) { | 433 | for(i=0;i<5;i++) { |
| @@ -33,7 +33,8 @@ · 32 unmodified lines | |||
| 33 | #ifndef AVCODEC_MJPEGENC_H | 33 | #ifndef AVCODEC_MJPEGENC_H |
| 34 | #define AVCODEC_MJPEGENC_H | 34 | #define AVCODEC_MJPEGENC_H |
| 35 | 35 | ||
| 36 | #include "dsputil.h" | 36 | #include <stdint.h> |
| 37 | |||
| 37 | #include "mpegvideo.h" | 38 | #include "mpegvideo.h" |
| 38 | 39 | ||
| 39 | typedef struct MJpegContext { | 40 | typedef struct MJpegContext { |
| @@ -55,6 +56,6 @@ void ff_mjpeg_encode_picture_trailer(MpegEncContext *s); · 15 unmodified lines | |||
| 55 | void ff_mjpeg_encode_stuffing(PutBitContext *pbc); | 56 | void ff_mjpeg_encode_stuffing(PutBitContext *pbc); |
| 56 | void ff_mjpeg_encode_dc(MpegEncContext *s, int val, | 57 | void ff_mjpeg_encode_dc(MpegEncContext *s, int val, |
| 57 | uint8_t *huff_size, uint16_t *huff_code); | 58 | uint8_t *huff_size, uint16_t *huff_code); |
| 58 | void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]); | 59 | void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]); |
| 59 | 60 | ||
| 60 | #endif /* AVCODEC_MJPEGENC_H */ | 61 | #endif /* AVCODEC_MJPEGENC_H */ |
| @@ -80,7 +80,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred) · 79 unmodified lines | |||
| 80 | return sign_extend(val, 5 + shift); | 80 | return sign_extend(val, 5 + shift); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) | 83 | static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n) |
| 84 | { | 84 | { |
| 85 | int level, dc, diff, i, j, run; | 85 | int level, dc, diff, i, j, run; |
| 86 | int component; | 86 | int component; |
| @@ -151,12 +151,12 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, in · 64 unmodified lines | |||
| 151 | return 0; | 151 | return 0; |
| 152 | } | 152 | } |
| 153 | 153 | ||
| 154 | int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) | 154 | int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n) |
| 155 | { | 155 | { |
| 156 | return mpeg1_decode_block_intra(s, block, n); | 156 | return mpeg1_decode_block_intra(s, block, n); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | static inline int mpeg1_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n) | 159 | static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n) |
| 160 | { | 160 | { |
| 161 | int level, i, j, run; | 161 | int level, i, j, run; |
| 162 | RLTable *rl = &ff_rl_mpeg1; | 162 | RLTable *rl = &ff_rl_mpeg1; |
| @@ -231,7 +231,7 @@ end: · 68 unmodified lines | |||
| 231 | return 0; | 231 | return 0; |
| 232 | } | 232 | } |
| 233 | 233 | ||
| 234 | static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n) | 234 | static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *block, int n) |
| 235 | { | 235 | { |
| 236 | int level, i, j, run; | 236 | int level, i, j, run; |
| 237 | RLTable *rl = &ff_rl_mpeg1; | 237 | RLTable *rl = &ff_rl_mpeg1; |
| @@ -303,7 +303,7 @@ end: · 65 unmodified lines | |||
| 303 | } | 303 | } |
| 304 | 304 | ||
| 305 | 305 | ||
| 306 | static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n) | 306 | static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n) |
| 307 | { | 307 | { |
| 308 | int level, i, j, run; | 308 | int level, i, j, run; |
| 309 | RLTable *rl = &ff_rl_mpeg1; | 309 | RLTable *rl = &ff_rl_mpeg1; |
| @@ -383,7 +383,7 @@ end: · 73 unmodified lines | |||
| 383 | } | 383 | } |
| 384 | 384 | ||
| 385 | static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, | 385 | static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s, |
| 386 | DCTELEM *block, int n) | 386 | int16_t *block, int n) |
| 387 | { | 387 | { |
| 388 | int level, i, j, run; | 388 | int level, i, j, run; |
| 389 | RLTable *rl = &ff_rl_mpeg1; | 389 | RLTable *rl = &ff_rl_mpeg1; |
| @@ -444,7 +444,7 @@ end: · 54 unmodified lines | |||
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | 446 | ||
| 447 | static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) | 447 | static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, int n) |
| 448 | { | 448 | { |
| 449 | int level, dc, diff, i, j, run; | 449 | int level, dc, diff, i, j, run; |
| 450 | int component; | 450 | int component; |
| @@ -522,7 +522,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, in · 71 unmodified lines | |||
| 522 | return 0; | 522 | return 0; |
| 523 | } | 523 | } |
| 524 | 524 | ||
| 525 | static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n) | 525 | static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *block, int n) |
| 526 | { | 526 | { |
| 527 | int level, dc, diff, j, run; | 527 | int level, dc, diff, j, run; |
| 528 | int component; | 528 | int component; |
| @@ -721,7 +721,7 @@ static inline int get_qscale(MpegEncContext *s) · 192 unmodified lines | |||
| 721 | 721 | ||
| 722 | static void exchange_uv(MpegEncContext *s) | 722 | static void exchange_uv(MpegEncContext *s) |
| 723 | { | 723 | { |
| 724 | DCTELEM (*tmp)[64]; | 724 | int16_t (*tmp)[64]; |
| 725 | 725 | ||
| 726 | tmp = s->pblocks[4]; | 726 | tmp = s->pblocks[4]; |
| 727 | s->pblocks[4] = s->pblocks[5]; | 727 | s->pblocks[4] = s->pblocks[5]; |
| @@ -734,7 +734,7 @@ static void exchange_uv(MpegEncContext *s) · 6 unmodified lines | |||
| 734 | #define MT_16X8 2 | 734 | #define MT_16X8 2 |
| 735 | #define MT_DMV 3 | 735 | #define MT_DMV 3 |
| 736 | 736 | ||
| 737 | static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64]) | 737 | static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) |
| 738 | { | 738 | { |
| 739 | int i, j, k, cbp, val, mb_type, motion_type; | 739 | int i, j, k, cbp, val, mb_type, motion_type; |
| 740 | const int mb_block_count = 4 + (1 << s->chroma_format); | 740 | const int mb_block_count = 4 + (1 << s->chroma_format); |
| @@ -71,6 +71,6 @@ static inline int decode_dc(GetBitContext *gb, int component) · 70 unmodified lines | |||
| 71 | return diff; | 71 | return diff; |
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n); | 74 | extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n); |
| 75 | 75 | ||
| 76 | #endif /* AVCODEC_MPEG12_H */ | 76 | #endif /* AVCODEC_MPEG12_H */ |
| @@ -51,7 +51,7 @@ static const uint8_t svcd_scan_offset_placeholder[14] = { · 50 unmodified lines | |||
| 51 | }; | 51 | }; |
| 52 | 52 | ||
| 53 | static void mpeg1_encode_block(MpegEncContext *s, | 53 | static void mpeg1_encode_block(MpegEncContext *s, |
| 54 | DCTELEM *block, | 54 | int16_t *block, |
| 55 | int component); | 55 | int component); |
| 56 | static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added | 56 | static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added |
| 57 | 57 | ||
| @@ -432,7 +432,7 @@ static inline void put_mb_modes(MpegEncContext *s, int n, int bits, · 374 unmodified lines | |||
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, | 434 | static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, |
| 435 | DCTELEM block[6][64], | 435 | int16_t block[6][64], |
| 436 | int motion_x, int motion_y, | 436 | int motion_x, int motion_y, |
| 437 | int mb_block_count) | 437 | int mb_block_count) |
| 438 | { | 438 | { |
| @@ -656,7 +656,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s, · 217 unmodified lines | |||
| 656 | } | 656 | } |
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y) | 659 | void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y) |
| 660 | { | 660 | { |
| 661 | if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); | 661 | if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6); |
| 662 | else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8); | 662 | 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) · 176 unmodified lines | |||
| 839 | } | 839 | } |
| 840 | 840 | ||
| 841 | static void mpeg1_encode_block(MpegEncContext *s, | 841 | static void mpeg1_encode_block(MpegEncContext *s, |
| 842 | DCTELEM *block, | 842 | int16_t *block, |
| 843 | int n) | 843 | int n) |
| 844 | { | 844 | { |
| 845 | int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; | 845 | int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign; |
| @@ -83,9 +83,9 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; · 82 unmodified lines | |||
| 83 | extern const uint8_t ff_mpeg4_dc_threshold[8]; | 83 | extern const uint8_t ff_mpeg4_dc_threshold[8]; |
| 84 | 84 | ||
| 85 | void ff_mpeg4_encode_mb(MpegEncContext *s, | 85 | void ff_mpeg4_encode_mb(MpegEncContext *s, |
| 86 | DCTELEM block[6][64], | 86 | int16_t block[6][64], |
| 87 | int motion_x, int motion_y); | 87 | int motion_x, int motion_y); |
| 88 | void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, | 88 | void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n, |
| 89 | int dir); | 89 | int dir); |
| 90 | void ff_set_mpeg4_time(MpegEncContext * s); | 90 | void ff_set_mpeg4_time(MpegEncContext * s); |
| 91 | void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); | 91 | void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number); |
| @@ -50,7 +50,7 @@ static const int mb_type_b_map[4]= { · 49 unmodified lines | |||
| 50 | * @param n block index (0-3 are luma, 4-5 are chroma) | 50 | * @param n block index (0-3 are luma, 4-5 are chroma) |
| 51 | * @param dir the ac prediction direction | 51 | * @param dir the ac prediction direction |
| 52 | */ | 52 | */ |
| 53 | void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n, | 53 | void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n, |
| 54 | int dir) | 54 | int dir) |
| 55 | { | 55 | { |
| 56 | int i; | 56 | int i; |
| @@ -841,7 +841,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s) · 784 unmodified lines | |||
| 841 | * Decode a block. | 841 | * Decode a block. |
| 842 | * @return <0 if an error occurred | 842 | * @return <0 if an error occurred |
| 843 | */ | 843 | */ |
| 844 | static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, | 844 | static inline int mpeg4_decode_block(MpegEncContext * s, int16_t * block, |
| 845 | int n, int coded, int intra, int rvlc) | 845 | int n, int coded, int intra, int rvlc) |
| 846 | { | 846 | { |
| 847 | int level, i, last, run; | 847 | int level, i, last, run; |
| @@ -1065,7 +1065,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block, · 217 unmodified lines | |||
| 1065 | * decode partition C of one MB. | 1065 | * decode partition C of one MB. |
| 1066 | * @return <0 if an error occurred | 1066 | * @return <0 if an error occurred |
| 1067 | */ | 1067 | */ |
| 1068 | static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64]) | 1068 | static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64]) |
| 1069 | { | 1069 | { |
| 1070 | int cbp, mb_type; | 1070 | int cbp, mb_type; |
| 1071 | const int xy= s->mb_x + s->mb_y*s->mb_stride; | 1071 | 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]) · 76 unmodified lines | |||
| 1148 | } | 1148 | } |
| 1149 | 1149 | ||
| 1150 | static int mpeg4_decode_mb(MpegEncContext *s, | 1150 | static int mpeg4_decode_mb(MpegEncContext *s, |
| 1151 | DCTELEM block[6][64]) | 1151 | int16_t block[6][64]) |
| 1152 | { | 1152 | { |
| 1153 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; | 1153 | int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant; |
| 1154 | int16_t *mot_val; | 1154 | int16_t *mot_val; |
| @@ -59,7 +59,7 @@ max run: 29/41 · 58 unmodified lines | |||
| 59 | * Return the number of bits that encoding the 8x8 block in block would need. | 59 | * Return the number of bits that encoding the 8x8 block in block would need. |
| 60 | * @param[in] block_last_index last index in scantable order that refers to a non zero element in block. | 60 | * @param[in] block_last_index last index in scantable order that refers to a non zero element in block. |
| 61 | */ | 61 | */ |
| 62 | static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){ | 62 | static inline int get_block_rate(MpegEncContext * s, int16_t block[64], int block_last_index, uint8_t scantable[64]){ |
| 63 | int last=0; | 63 | int last=0; |
| 64 | int j; | 64 | int j; |
| 65 | int rate=0; | 65 | int rate=0; |
| @@ -91,7 +91,7 @@ static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int bloc · 25 unmodified lines | |||
| 91 | * @param[out] st scantable for each 8x8 block | 91 | * @param[out] st scantable for each 8x8 block |
| 92 | * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order | 92 | * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order |
| 93 | */ | 93 | */ |
| 94 | 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]) | 94 | 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]) |
| 95 | { | 95 | { |
| 96 | int i, n; | 96 | int i, n; |
| 97 | memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6); | 97 | 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 · 24 unmodified lines | |||
| 122 | * @param[out] st scantable for each 8x8 block | 122 | * @param[out] st scantable for each 8x8 block |
| 123 | * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order | 123 | * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order |
| 124 | */ | 124 | */ |
| 125 | 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]) | 125 | 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]) |
| 126 | { | 126 | { |
| 127 | int score= 0; | 127 | int score= 0; |
| 128 | int i, n; | 128 | int i, n; |
| @@ -294,7 +294,7 @@ static inline int mpeg4_get_dc_length(int level, int n){ · 165 unmodified lines | |||
| 294 | * Encode an 8x8 block. | 294 | * Encode an 8x8 block. |
| 295 | * @param n block index (0-3 are luma, 4-5 are chroma) | 295 | * @param n block index (0-3 are luma, 4-5 are chroma) |
| 296 | */ | 296 | */ |
| 297 | static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, | 297 | static inline void mpeg4_encode_block(MpegEncContext * s, int16_t * block, int n, int intra_dc, |
| 298 | uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) | 298 | uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb) |
| 299 | { | 299 | { |
| 300 | int i, last_non_zero; | 300 | int i, last_non_zero; |
| @@ -345,7 +345,7 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n · 44 unmodified lines | |||
| 345 | } | 345 | } |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc, | 348 | static int mpeg4_get_block_length(MpegEncContext * s, int16_t * block, int n, int intra_dc, |
| 349 | uint8_t *scan_table) | 349 | uint8_t *scan_table) |
| 350 | { | 350 | { |
| 351 | int i, last_non_zero; | 351 | int i, last_non_zero; |
| @@ -396,7 +396,7 @@ static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, in · 44 unmodified lines | |||
| 396 | return len; | 396 | return len; |
| 397 | } | 397 | } |
| 398 | 398 | ||
| 399 | static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6], | 399 | static inline void mpeg4_encode_blocks(MpegEncContext * s, int16_t block[6][64], int intra_dc[6], |
| 400 | uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){ | 400 | uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){ |
| 401 | int i; | 401 | int i; |
| 402 | 402 | ||
| @@ -425,7 +425,7 @@ static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], · 22 unmodified lines | |||
| 425 | } | 425 | } |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64], | 428 | static inline int get_b_cbp(MpegEncContext * s, int16_t block[6][64], |
| 429 | int motion_x, int motion_y, int mb_type) | 429 | int motion_x, int motion_y, int mb_type) |
| 430 | { | 430 | { |
| 431 | int cbp = 0, i; | 431 | int cbp = 0, i; |
| @@ -469,7 +469,7 @@ static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64], · 37 unmodified lines | |||
| 469 | static const int dquant_code[5]= {1,0,9,2,3}; | 469 | static const int dquant_code[5]= {1,0,9,2,3}; |
| 470 | 470 | ||
| 471 | void ff_mpeg4_encode_mb(MpegEncContext * s, | 471 | void ff_mpeg4_encode_mb(MpegEncContext * s, |
| 472 | DCTELEM block[6][64], | 472 | int16_t block[6][64], |
| 473 | int motion_x, int motion_y) | 473 | int motion_x, int motion_y) |
| 474 | { | 474 | { |
| 475 | int cbpc, cbpy, pred_x, pred_y; | 475 | int cbpc, cbpy, pred_x, pred_y; |
| @@ -43,19 +43,19 @@ · 42 unmodified lines | |||
| 43 | //#include <assert.h> | 43 | //#include <assert.h> |
| 44 | 44 | ||
| 45 | static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, | 45 | static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, |
| 46 | DCTELEM *block, int n, int qscale); | 46 | int16_t *block, int n, int qscale); |
| 47 | static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, | 47 | static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, |
| 48 | DCTELEM *block, int n, int qscale); | 48 | int16_t *block, int n, int qscale); |
| 49 | static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, | 49 | static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, |
| 50 | DCTELEM *block, int n, int qscale); | 50 | int16_t *block, int n, int qscale); |
| 51 | static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, | 51 | static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, |
| 52 | DCTELEM *block, int n, int qscale); | 52 | int16_t *block, int n, int qscale); |
| 53 | static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, | 53 | static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
| 54 | DCTELEM *block, int n, int qscale); | 54 | int16_t *block, int n, int qscale); |
| 55 | static void dct_unquantize_h263_intra_c(MpegEncContext *s, | 55 | static void dct_unquantize_h263_intra_c(MpegEncContext *s, |
| 56 | DCTELEM *block, int n, int qscale); | 56 | int16_t *block, int n, int qscale); |
| 57 | static void dct_unquantize_h263_inter_c(MpegEncContext *s, | 57 | static void dct_unquantize_h263_inter_c(MpegEncContext *s, |
| 58 | DCTELEM *block, int n, int qscale); | 58 | int16_t *block, int n, int qscale); |
| 59 | 59 | ||
| 60 | 60 | ||
| 61 | /* enable all paranoid tests for rounding, overflows, etc... */ | 61 | /* enable all paranoid tests for rounding, overflows, etc... */ |
| @@ -394,7 +394,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared) · 332 unmodified lines | |||
| 394 | } | 394 | } |
| 395 | if (s->avctx->debug&FF_DEBUG_DCT_COEFF) { | 395 | if (s->avctx->debug&FF_DEBUG_DCT_COEFF) { |
| 396 | FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.dct_coeff, | 396 | FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.dct_coeff, |
| 397 | 64 * mb_array_size * sizeof(DCTELEM) * 6, fail) | 397 | 64 * mb_array_size * sizeof(int16_t) * 6, fail) |
| 398 | } | 398 | } |
| 399 | pic->f.qstride = s->mb_stride; | 399 | pic->f.qstride = s->mb_stride; |
| 400 | FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.pan_scan, | 400 | FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.pan_scan, |
| @@ -471,7 +471,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base) · 70 unmodified lines | |||
| 471 | 2 * 64 * sizeof(int), fail) | 471 | 2 * 64 * sizeof(int), fail) |
| 472 | } | 472 | } |
| 473 | } | 473 | } |
| 474 | FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(DCTELEM), fail) | 474 | FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(int16_t), fail) |
| 475 | s->block = s->blocks[0]; | 475 | s->block = s->blocks[0]; |
| 476 | 476 | ||
| 477 | for (i = 0; i < 12; i++) { | 477 | for (i = 0; i < 12; i++) { |
| @@ -2067,7 +2067,7 @@ unhandled: · 1589 unmodified lines | |||
| 2067 | 2067 | ||
| 2068 | /* put block[] to dest[] */ | 2068 | /* put block[] to dest[] */ |
| 2069 | static inline void put_dct(MpegEncContext *s, | 2069 | static inline void put_dct(MpegEncContext *s, |
| 2070 | DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale) | 2070 | int16_t *block, int i, uint8_t *dest, int line_size, int qscale) |
| 2071 | { | 2071 | { |
| 2072 | s->dct_unquantize_intra(s, block, i, qscale); | 2072 | s->dct_unquantize_intra(s, block, i, qscale); |
| 2073 | s->dsp.idct_put (dest, line_size, block); | 2073 | s->dsp.idct_put (dest, line_size, block); |
| @@ -2075,7 +2075,7 @@ static inline void put_dct(MpegEncContext *s, · 1 unmodified line | |||
| 2075 | 2075 | ||
| 2076 | /* add block[] to dest[] */ | 2076 | /* add block[] to dest[] */ |
| 2077 | static inline void add_dct(MpegEncContext *s, | 2077 | static inline void add_dct(MpegEncContext *s, |
| 2078 | DCTELEM *block, int i, uint8_t *dest, int line_size) | 2078 | int16_t *block, int i, uint8_t *dest, int line_size) |
| 2079 | { | 2079 | { |
| 2080 | if (s->block_last_index[i] >= 0) { | 2080 | if (s->block_last_index[i] >= 0) { |
| 2081 | s->dsp.idct_add (dest, line_size, block); | 2081 | s->dsp.idct_add (dest, line_size, block); |
| @@ -2083,7 +2083,7 @@ static inline void add_dct(MpegEncContext *s, · 1 unmodified line | |||
| 2083 | } | 2083 | } |
| 2084 | 2084 | ||
| 2085 | static inline void add_dequant_dct(MpegEncContext *s, | 2085 | static inline void add_dequant_dct(MpegEncContext *s, |
| 2086 | DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale) | 2086 | int16_t *block, int i, uint8_t *dest, int line_size, int qscale) |
| 2087 | { | 2087 | { |
| 2088 | if (s->block_last_index[i] >= 0) { | 2088 | if (s->block_last_index[i] >= 0) { |
| 2089 | s->dct_unquantize_inter(s, block, i, qscale); | 2089 | s->dct_unquantize_inter(s, block, i, qscale); |
| @@ -2136,7 +2136,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s) · 46 unmodified lines | |||
| 2136 | s->interlaced_dct : true if interlaced dct used (mpeg2) | 2136 | s->interlaced_dct : true if interlaced dct used (mpeg2) |
| 2137 | */ | 2137 | */ |
| 2138 | static av_always_inline | 2138 | static av_always_inline |
| 2139 | void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64], | 2139 | void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64], |
| 2140 | int is_mpeg12) | 2140 | int is_mpeg12) |
| 2141 | { | 2141 | { |
| 2142 | const int mb_xy = s->mb_y * s->mb_stride + s->mb_x; | 2142 | 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], · 5 unmodified lines | |||
| 2148 | if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { | 2148 | if(s->avctx->debug&FF_DEBUG_DCT_COEFF) { |
| 2149 | /* save DCT coefficients */ | 2149 | /* save DCT coefficients */ |
| 2150 | int i,j; | 2150 | int i,j; |
| 2151 | DCTELEM *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6]; | 2151 | int16_t *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6]; |
| 2152 | av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); | 2152 | av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y); |
| 2153 | for(i=0; i<6; i++){ | 2153 | for(i=0; i<6; i++){ |
| 2154 | for(j=0; j<64; j++){ | 2154 | for(j=0; j<64; j++){ |
| @@ -2367,7 +2367,7 @@ skip_idct: · 212 unmodified lines | |||
| 2367 | } | 2367 | } |
| 2368 | } | 2368 | } |
| 2369 | 2369 | ||
| 2370 | void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){ | 2370 | void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){ |
| 2371 | #if !CONFIG_SMALL | 2371 | #if !CONFIG_SMALL |
| 2372 | if(s->out_format == FMT_MPEG1) { | 2372 | if(s->out_format == FMT_MPEG1) { |
| 2373 | MPV_decode_mb_internal(s, block, 1); | 2373 | MPV_decode_mb_internal(s, block, 1); |
| @@ -2506,7 +2506,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){ · 132 unmodified lines | |||
| 2506 | } | 2506 | } |
| 2507 | 2507 | ||
| 2508 | static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, | 2508 | static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, |
| 2509 | DCTELEM *block, int n, int qscale) | 2509 | int16_t *block, int n, int qscale) |
| 2510 | { | 2510 | { |
| 2511 | int i, level, nCoeffs; | 2511 | int i, level, nCoeffs; |
| 2512 | const uint16_t *quant_matrix; | 2512 | const uint16_t *quant_matrix; |
| @@ -2538,7 +2538,7 @@ static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s, · 25 unmodified lines | |||
| 2538 | } | 2538 | } |
| 2539 | 2539 | ||
| 2540 | static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, | 2540 | static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, |
| 2541 | DCTELEM *block, int n, int qscale) | 2541 | int16_t *block, int n, int qscale) |
| 2542 | { | 2542 | { |
| 2543 | int i, level, nCoeffs; | 2543 | int i, level, nCoeffs; |
| 2544 | const uint16_t *quant_matrix; | 2544 | const uint16_t *quant_matrix; |
| @@ -2567,7 +2567,7 @@ static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, · 22 unmodified lines | |||
| 2567 | } | 2567 | } |
| 2568 | 2568 | ||
| 2569 | static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, | 2569 | static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, |
| 2570 | DCTELEM *block, int n, int qscale) | 2570 | int16_t *block, int n, int qscale) |
| 2571 | { | 2571 | { |
| 2572 | int i, level, nCoeffs; | 2572 | int i, level, nCoeffs; |
| 2573 | const uint16_t *quant_matrix; | 2573 | const uint16_t *quant_matrix; |
| @@ -2597,7 +2597,7 @@ static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, · 23 unmodified lines | |||
| 2597 | } | 2597 | } |
| 2598 | 2598 | ||
| 2599 | static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, | 2599 | static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, |
| 2600 | DCTELEM *block, int n, int qscale) | 2600 | int16_t *block, int n, int qscale) |
| 2601 | { | 2601 | { |
| 2602 | int i, level, nCoeffs; | 2602 | int i, level, nCoeffs; |
| 2603 | const uint16_t *quant_matrix; | 2603 | const uint16_t *quant_matrix; |
| @@ -2630,7 +2630,7 @@ static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, · 26 unmodified lines | |||
| 2630 | } | 2630 | } |
| 2631 | 2631 | ||
| 2632 | static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, | 2632 | static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
| 2633 | DCTELEM *block, int n, int qscale) | 2633 | int16_t *block, int n, int qscale) |
| 2634 | { | 2634 | { |
| 2635 | int i, level, nCoeffs; | 2635 | int i, level, nCoeffs; |
| 2636 | const uint16_t *quant_matrix; | 2636 | const uint16_t *quant_matrix; |
| @@ -2661,7 +2661,7 @@ static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, · 24 unmodified lines | |||
| 2661 | } | 2661 | } |
| 2662 | 2662 | ||
| 2663 | static void dct_unquantize_h263_intra_c(MpegEncContext *s, | 2663 | static void dct_unquantize_h263_intra_c(MpegEncContext *s, |
| 2664 | DCTELEM *block, int n, int qscale) | 2664 | int16_t *block, int n, int qscale) |
| 2665 | { | 2665 | { |
| 2666 | int i, level, qmul, qadd; | 2666 | int i, level, qmul, qadd; |
| 2667 | int nCoeffs; | 2667 | int nCoeffs; |
| @@ -2698,7 +2698,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s, · 30 unmodified lines | |||
| 2698 | } | 2698 | } |
| 2699 | 2699 | ||
| 2700 | static void dct_unquantize_h263_inter_c(MpegEncContext *s, | 2700 | static void dct_unquantize_h263_inter_c(MpegEncContext *s, |
| 2701 | DCTELEM *block, int n, int qscale) | 2701 | int16_t *block, int n, int qscale) |
| 2702 | { | 2702 | { |
| 2703 | int i, level, qmul, qadd; | 2703 | int i, level, qmul, qadd; |
| 2704 | int nCoeffs; | 2704 | int nCoeffs; |
| @@ -669,39 +669,39 @@ typedef struct MpegEncContext { · 668 unmodified lines | |||
| 669 | 669 | ||
| 670 | uint8_t *ptr_lastgob; | 670 | uint8_t *ptr_lastgob; |
| 671 | int swap_uv; //vcr2 codec is an MPEG-2 variant with U and V swapped | 671 | int swap_uv; //vcr2 codec is an MPEG-2 variant with U and V swapped |
| 672 | DCTELEM (*pblocks[12])[64]; | 672 | int16_t (*pblocks[12])[64]; |
| 673 | 673 | ||
| 674 | DCTELEM (*block)[64]; ///< points to one of the following blocks | 674 | int16_t (*block)[64]; ///< points to one of the following blocks |
| 675 | DCTELEM (*blocks)[8][64]; // for HQ mode we need to keep the best block | 675 | int16_t (*blocks)[8][64]; // for HQ mode we need to keep the best block |
| 676 | int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch() | 676 | int (*decode_mb)(struct MpegEncContext *s, int16_t block[6][64]); // used by some codecs to avoid a switch() |
| 677 | #define SLICE_OK 0 | 677 | #define SLICE_OK 0 |
| 678 | #define SLICE_ERROR -1 | 678 | #define SLICE_ERROR -1 |
| 679 | #define SLICE_END -2 ///<end marker found | 679 | #define SLICE_END -2 ///<end marker found |
| 680 | #define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded | 680 | #define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded |
| 681 | 681 | ||
| 682 | void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s, | 682 | void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s, |
| 683 | DCTELEM *block/*align 16*/, int n, int qscale); | 683 | int16_t *block/*align 16*/, int n, int qscale); |
| 684 | void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s, | 684 | void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s, |
| 685 | DCTELEM *block/*align 16*/, int n, int qscale); | 685 | int16_t *block/*align 16*/, int n, int qscale); |
| 686 | void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s, | 686 | void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s, |
| 687 | DCTELEM *block/*align 16*/, int n, int qscale); | 687 | int16_t *block/*align 16*/, int n, int qscale); |
| 688 | void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s, | 688 | void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s, |
| 689 | DCTELEM *block/*align 16*/, int n, int qscale); | 689 | int16_t *block/*align 16*/, int n, int qscale); |
| 690 | void (*dct_unquantize_h263_intra)(struct MpegEncContext *s, | 690 | void (*dct_unquantize_h263_intra)(struct MpegEncContext *s, |
| 691 | DCTELEM *block/*align 16*/, int n, int qscale); | 691 | int16_t *block/*align 16*/, int n, int qscale); |
| 692 | void (*dct_unquantize_h263_inter)(struct MpegEncContext *s, | 692 | void (*dct_unquantize_h263_inter)(struct MpegEncContext *s, |
| 693 | DCTELEM *block/*align 16*/, int n, int qscale); | 693 | int16_t *block/*align 16*/, int n, int qscale); |
| 694 | void (*dct_unquantize_h261_intra)(struct MpegEncContext *s, | 694 | void (*dct_unquantize_h261_intra)(struct MpegEncContext *s, |
| 695 | DCTELEM *block/*align 16*/, int n, int qscale); | 695 | int16_t *block/*align 16*/, int n, int qscale); |
| 696 | void (*dct_unquantize_h261_inter)(struct MpegEncContext *s, | 696 | void (*dct_unquantize_h261_inter)(struct MpegEncContext *s, |
| 697 | DCTELEM *block/*align 16*/, int n, int qscale); | 697 | int16_t *block/*align 16*/, int n, int qscale); |
| 698 | void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) | 698 | void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) |
| 699 | DCTELEM *block/*align 16*/, int n, int qscale); | 699 | int16_t *block/*align 16*/, int n, int qscale); |
| 700 | void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) | 700 | void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both) |
| 701 | DCTELEM *block/*align 16*/, int n, int qscale); | 701 | int16_t *block/*align 16*/, int n, int qscale); |
| 702 | int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); | 702 | int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); |
| 703 | int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow); | 703 | int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow); |
| 704 | void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block); | 704 | void (*denoise_dct)(struct MpegEncContext *s, int16_t *block); |
| 705 | 705 | ||
| 706 | int mpv_flags; ///< flags set by private options | 706 | int mpv_flags; ///< flags set by private options |
| 707 | int quantizer_noise_shaping; | 707 | int quantizer_noise_shaping; |
| @@ -764,7 +764,7 @@ int ff_MPV_common_init(MpegEncContext *s); · 56 unmodified lines | |||
| 764 | int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize); | 764 | int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize); |
| 765 | int ff_MPV_common_frame_size_change(MpegEncContext *s); | 765 | int ff_MPV_common_frame_size_change(MpegEncContext *s); |
| 766 | void ff_MPV_common_end(MpegEncContext *s); | 766 | void ff_MPV_common_end(MpegEncContext *s); |
| 767 | void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]); | 767 | void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]); |
| 768 | int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); | 768 | int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx); |
| 769 | void ff_MPV_frame_end(MpegEncContext *s); | 769 | void ff_MPV_frame_end(MpegEncContext *s); |
| 770 | int ff_MPV_encode_init(AVCodecContext *avctx); | 770 | int ff_MPV_encode_init(AVCodecContext *avctx); |
| @@ -784,7 +784,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict); · 13 unmodified lines | |||
| 784 | void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); | 784 | void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix); |
| 785 | void ff_release_unused_pictures(MpegEncContext *s, int remove_current); | 785 | void ff_release_unused_pictures(MpegEncContext *s, int remove_current); |
| 786 | int ff_find_unused_picture(MpegEncContext *s, int shared); | 786 | int ff_find_unused_picture(MpegEncContext *s, int shared); |
| 787 | void ff_denoise_dct(MpegEncContext *s, DCTELEM *block); | 787 | void ff_denoise_dct(MpegEncContext *s, int16_t *block); |
| 788 | int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src); | 788 | int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src); |
| 789 | int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir); | 789 | int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir); |
| 790 | void ff_MPV_report_decode_progress(MpegEncContext *s); | 790 | 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 · 8 unmodified lines | |||
| 799 | int ff_dct_common_init(MpegEncContext *s); | 799 | int ff_dct_common_init(MpegEncContext *s); |
| 800 | void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64], | 800 | void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64], |
| 801 | const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra); | 801 | const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra); |
| 802 | int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); | 802 | int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow); |
| 803 | 803 | ||
| 804 | void ff_init_block_index(MpegEncContext *s); | 804 | void ff_init_block_index(MpegEncContext *s); |
| 805 | void ff_copy_picture(Picture *dst, Picture *src); | 805 | void ff_copy_picture(Picture *dst, Picture *src); |
| @@ -874,7 +874,7 @@ extern const uint8_t * const ff_mpeg2_dc_scale_table[4]; · 68 unmodified lines | |||
| 874 | 874 | ||
| 875 | void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); | 875 | void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number); |
| 876 | void ff_mpeg1_encode_mb(MpegEncContext *s, | 876 | void ff_mpeg1_encode_mb(MpegEncContext *s, |
| 877 | DCTELEM block[6][64], | 877 | int16_t block[6][64], |
| 878 | int motion_x, int motion_y); | 878 | int motion_x, int motion_y); |
| 879 | void ff_mpeg1_encode_init(MpegEncContext *s); | 879 | void ff_mpeg1_encode_init(MpegEncContext *s); |
| 880 | void ff_mpeg1_encode_slice_header(MpegEncContext *s); | 880 | void ff_mpeg1_encode_slice_header(MpegEncContext *s); |
| @@ -889,7 +889,7 @@ extern const uint8_t ff_h263_loop_filter_strength[32]; · 8 unmodified lines | |||
| 889 | void ff_h261_loop_filter(MpegEncContext *s); | 889 | void ff_h261_loop_filter(MpegEncContext *s); |
| 890 | void ff_h261_reorder_mb_index(MpegEncContext* s); | 890 | void ff_h261_reorder_mb_index(MpegEncContext* s); |
| 891 | void ff_h261_encode_mb(MpegEncContext *s, | 891 | void ff_h261_encode_mb(MpegEncContext *s, |
| 892 | DCTELEM block[6][64], | 892 | int16_t block[6][64], |
| 893 | int motion_x, int motion_y); | 893 | int motion_x, int motion_y); |
| 894 | void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number); | 894 | void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number); |
| 895 | void ff_h261_encode_init(MpegEncContext *s); | 895 | void ff_h261_encode_init(MpegEncContext *s); |
| @@ -906,7 +906,7 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number); · 10 unmodified lines | |||
| 906 | void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number); | 906 | void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number); |
| 907 | void ff_msmpeg4_encode_ext_header(MpegEncContext * s); | 907 | void ff_msmpeg4_encode_ext_header(MpegEncContext * s); |
| 908 | void ff_msmpeg4_encode_mb(MpegEncContext * s, | 908 | void ff_msmpeg4_encode_mb(MpegEncContext * s, |
| 909 | DCTELEM block[6][64], | 909 | int16_t block[6][64], |
| 910 | int motion_x, int motion_y); | 910 | int motion_x, int motion_y); |
| 911 | int ff_msmpeg4_decode_picture_header(MpegEncContext * s); | 911 | int ff_msmpeg4_decode_picture_header(MpegEncContext * s); |
| 912 | int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size); | 912 | int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size); |
| @@ -914,14 +914,14 @@ int ff_msmpeg4_decode_init(AVCodecContext *avctx); · 1 unmodified line | |||
| 914 | void ff_msmpeg4_encode_init(MpegEncContext *s); | 914 | void ff_msmpeg4_encode_init(MpegEncContext *s); |
| 915 | int ff_wmv2_decode_picture_header(MpegEncContext * s); | 915 | int ff_wmv2_decode_picture_header(MpegEncContext * s); |
| 916 | int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s); | 916 | int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s); |
| 917 | void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); | 917 | void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr); |
| 918 | void ff_mspel_motion(MpegEncContext *s, | 918 | void ff_mspel_motion(MpegEncContext *s, |
| 919 | uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, | 919 | uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, |
| 920 | uint8_t **ref_picture, op_pixels_func (*pix_op)[4], | 920 | uint8_t **ref_picture, op_pixels_func (*pix_op)[4], |
| 921 | int motion_x, int motion_y, int h); | 921 | int motion_x, int motion_y, int h); |
| 922 | int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); | 922 | int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number); |
| 923 | void ff_wmv2_encode_mb(MpegEncContext * s, | 923 | void ff_wmv2_encode_mb(MpegEncContext * s, |
| 924 | DCTELEM block[6][64], | 924 | int16_t block[6][64], |
| 925 | int motion_x, int motion_y); | 925 | int motion_x, int motion_y); |
| 926 | 926 | ||
| 927 | #endif /* AVCODEC_MPEGVIDEO_H */ | 927 | #endif /* AVCODEC_MPEGVIDEO_H */ |
| @@ -51,10 +51,10 @@ · 50 unmodified lines | |||
| 51 | //#include <assert.h> | 51 | //#include <assert.h> |
| 52 | 52 | ||
| 53 | static int encode_picture(MpegEncContext *s, int picture_number); | 53 | static int encode_picture(MpegEncContext *s, int picture_number); |
| 54 | static int dct_quantize_refine(MpegEncContext *s, DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale); | 54 | static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale); |
| 55 | static int sse_mb(MpegEncContext *s); | 55 | static int sse_mb(MpegEncContext *s); |
| 56 | static void denoise_dct_c(MpegEncContext *s, DCTELEM *block); | 56 | static void denoise_dct_c(MpegEncContext *s, int16_t *block); |
| 57 | static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow); | 57 | static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow); |
| 58 | 58 | ||
| 59 | /* enable all paranoid tests for rounding, overflows, etc... */ | 59 | /* enable all paranoid tests for rounding, overflows, etc... */ |
| 60 | //#define PARANOID | 60 | //#define PARANOID |
| @@ -1625,7 +1625,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s, · 1564 unmodified lines | |||
| 1625 | int score = 0; | 1625 | int score = 0; |
| 1626 | int run = 0; | 1626 | int run = 0; |
| 1627 | int i; | 1627 | int i; |
| 1628 | DCTELEM *block = s->block[n]; | 1628 | int16_t *block = s->block[n]; |
| 1629 | const int last_index = s->block_last_index[n]; | 1629 | const int last_index = s->block_last_index[n]; |
| 1630 | int skip_dc; | 1630 | int skip_dc; |
| 1631 | 1631 | ||
| @@ -1665,7 +1665,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s, · 33 unmodified lines | |||
| 1665 | s->block_last_index[n] = -1; | 1665 | s->block_last_index[n] = -1; |
| 1666 | } | 1666 | } |
| 1667 | 1667 | ||
| 1668 | static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block, | 1668 | static inline void clip_coeffs(MpegEncContext *s, int16_t *block, |
| 1669 | int last_index) | 1669 | int last_index) |
| 1670 | { | 1670 | { |
| 1671 | int i; | 1671 | int i; |
| @@ -1729,7 +1729,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 57 unmodified lines | |||
| 1729 | int mb_block_count) | 1729 | int mb_block_count) |
| 1730 | { | 1730 | { |
| 1731 | int16_t weight[8][64]; | 1731 | int16_t weight[8][64]; |
| 1732 | DCTELEM orig[8][64]; | 1732 | int16_t orig[8][64]; |
| 1733 | const int mb_x = s->mb_x; | 1733 | const int mb_x = s->mb_x; |
| 1734 | const int mb_y = s->mb_y; | 1734 | const int mb_y = s->mb_y; |
| 1735 | int i; | 1735 | int i; |
| @@ -1979,7 +1979,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, · 243 unmodified lines | |||
| 1979 | get_visual_weight(weight[7], ptr_cr + (dct_offset >> 1), | 1979 | get_visual_weight(weight[7], ptr_cr + (dct_offset >> 1), |
| 1980 | wrap_c); | 1980 | wrap_c); |
| 1981 | } | 1981 | } |
| 1982 | memcpy(orig[0], s->block[0], sizeof(DCTELEM) * 64 * mb_block_count); | 1982 | memcpy(orig[0], s->block[0], sizeof(int16_t) * 64 * mb_block_count); |
| 1983 | } | 1983 | } |
| 1984 | 1984 | ||
| 1985 | /* DCT & quantize */ | 1985 | /* DCT & quantize */ |
| @@ -2716,7 +2716,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 730 unmodified lines | |||
| 2716 | if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD | 2716 | if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD |
| 2717 | const int last_qp= backup_s.qscale; | 2717 | const int last_qp= backup_s.qscale; |
| 2718 | int qpi, qp, dc[6]; | 2718 | int qpi, qp, dc[6]; |
| 2719 | DCTELEM ac[6][16]; | 2719 | int16_t ac[6][16]; |
| 2720 | const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0; | 2720 | const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0; |
| 2721 | static const int dquant_tab[4]={-1,1,-2,2}; | 2721 | static const int dquant_tab[4]={-1,1,-2,2}; |
| 2722 | 2722 | ||
| @@ -2741,7 +2741,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 18 unmodified lines | |||
| 2741 | if(s->mb_intra && s->dc_val[0]){ | 2741 | if(s->mb_intra && s->dc_val[0]){ |
| 2742 | for(i=0; i<6; i++){ | 2742 | for(i=0; i<6; i++){ |
| 2743 | dc[i]= s->dc_val[0][ s->block_index[i] ]; | 2743 | dc[i]= s->dc_val[0][ s->block_index[i] ]; |
| 2744 | memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(DCTELEM)*16); | 2744 | memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(int16_t)*16); |
| 2745 | } | 2745 | } |
| 2746 | } | 2746 | } |
| 2747 | 2747 | ||
| @@ -2751,7 +2751,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 3 unmodified lines | |||
| 2751 | if(s->mb_intra && s->dc_val[0]){ | 2751 | if(s->mb_intra && s->dc_val[0]){ |
| 2752 | for(i=0; i<6; i++){ | 2752 | for(i=0; i<6; i++){ |
| 2753 | s->dc_val[0][ s->block_index[i] ]= dc[i]; | 2753 | s->dc_val[0][ s->block_index[i] ]= dc[i]; |
| 2754 | memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(DCTELEM)*16); | 2754 | memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(int16_t)*16); |
| 2755 | } | 2755 | } |
| 2756 | } | 2756 | } |
| 2757 | } | 2757 | } |
| @@ -3327,7 +3327,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) · 569 unmodified lines | |||
| 3327 | return 0; | 3327 | return 0; |
| 3328 | } | 3328 | } |
| 3329 | 3329 | ||
| 3330 | static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){ | 3330 | static void denoise_dct_c(MpegEncContext *s, int16_t *block){ |
| 3331 | const int intra= s->mb_intra; | 3331 | const int intra= s->mb_intra; |
| 3332 | int i; | 3332 | int i; |
| 3333 | 3333 | ||
| @@ -3352,7 +3352,7 @@ static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){ · 18 unmodified lines | |||
| 3352 | } | 3352 | } |
| 3353 | 3353 | ||
| 3354 | static int dct_quantize_trellis_c(MpegEncContext *s, | 3354 | static int dct_quantize_trellis_c(MpegEncContext *s, |
| 3355 | DCTELEM *block, int n, | 3355 | int16_t *block, int n, |
| 3356 | int qscale, int *overflow){ | 3356 | int qscale, int *overflow){ |
| 3357 | const int *qmat; | 3357 | const int *qmat; |
| 3358 | const uint8_t *scantable= s->intra_scantable.scantable; | 3358 | const uint8_t *scantable= s->intra_scantable.scantable; |
| @@ -3459,7 +3459,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, · 100 unmodified lines | |||
| 3459 | *overflow= s->max_qcoeff < max; //overflow might have happened | 3459 | *overflow= s->max_qcoeff < max; //overflow might have happened |
| 3460 | 3460 | ||
| 3461 | if(last_non_zero < start_i){ | 3461 | if(last_non_zero < start_i){ |
| 3462 | memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); | 3462 | memset(block + start_i, 0, (64-start_i)*sizeof(int16_t)); |
| 3463 | return last_non_zero; | 3463 | return last_non_zero; |
| 3464 | } | 3464 | } |
| 3465 | 3465 | ||
| @@ -3591,7 +3591,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s, · 125 unmodified lines | |||
| 3591 | 3591 | ||
| 3592 | dc= FFABS(block[0]); | 3592 | dc= FFABS(block[0]); |
| 3593 | last_non_zero= last_i - 1; | 3593 | last_non_zero= last_i - 1; |
| 3594 | memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM)); | 3594 | memset(block + start_i, 0, (64-start_i)*sizeof(int16_t)); |
| 3595 | 3595 | ||
| 3596 | if(last_non_zero < start_i) | 3596 | if(last_non_zero < start_i) |
| 3597 | return last_non_zero; | 3597 | return last_non_zero; |
| @@ -3666,10 +3666,10 @@ static void build_basis(uint8_t *perm){ · 68 unmodified lines | |||
| 3666 | } | 3666 | } |
| 3667 | 3667 | ||
| 3668 | static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? | 3668 | static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise? |
| 3669 | DCTELEM *block, int16_t *weight, DCTELEM *orig, | 3669 | int16_t *block, int16_t *weight, int16_t *orig, |
| 3670 | int n, int qscale){ | 3670 | int n, int qscale){ |
| 3671 | int16_t rem[64]; | 3671 | int16_t rem[64]; |
| 3672 | LOCAL_ALIGNED_16(DCTELEM, d1, [64]); | 3672 | LOCAL_ALIGNED_16(int16_t, d1, [64]); |
| 3673 | const uint8_t *scantable= s->intra_scantable.scantable; | 3673 | const uint8_t *scantable= s->intra_scantable.scantable; |
| 3674 | const uint8_t *perm_scantable= s->intra_scantable.permutated; | 3674 | const uint8_t *perm_scantable= s->intra_scantable.permutated; |
| 3675 | // unsigned int threshold1, threshold2; | 3675 | // unsigned int threshold1, threshold2; |
| @@ -4039,7 +4039,7 @@ STOP_TIMER("iterative search") · 363 unmodified lines | |||
| 4039 | } | 4039 | } |
| 4040 | 4040 | ||
| 4041 | int ff_dct_quantize_c(MpegEncContext *s, | 4041 | int ff_dct_quantize_c(MpegEncContext *s, |
| 4042 | DCTELEM *block, int n, | 4042 | int16_t *block, int n, |
| 4043 | int qscale, int *overflow) | 4043 | int qscale, int *overflow) |
| 4044 | { | 4044 | { |
| 4045 | int i, j, level, last_non_zero, q, start_i; | 4045 | int i, j, level, last_non_zero, q, start_i; |
| @@ -44,7 +44,7 @@ void ff_xvmc_init_block(MpegEncContext *s) · 43 unmodified lines | |||
| 44 | struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2]; | 44 | struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2]; |
| 45 | assert(render && render->xvmc_id == AV_XVMC_ID); | 45 | assert(render && render->xvmc_id == AV_XVMC_ID); |
| 46 | 46 | ||
| 47 | s->block = (DCTELEM (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); | 47 | s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | /** | 50 | /** |
| @@ -406,7 +406,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code) · 405 unmodified lines | |||
| 406 | return val; | 406 | return val; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) | 409 | static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64]) |
| 410 | { | 410 | { |
| 411 | int cbp, code, i; | 411 | int cbp, code, i; |
| 412 | 412 | ||
| @@ -492,7 +492,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) · 79 unmodified lines | |||
| 492 | return 0; | 492 | return 0; |
| 493 | } | 493 | } |
| 494 | 494 | ||
| 495 | static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) | 495 | static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64]) |
| 496 | { | 496 | { |
| 497 | int cbp, code, i; | 497 | int cbp, code, i; |
| 498 | uint8_t *coded_val; | 498 | uint8_t *coded_val; |
| @@ -934,7 +934,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr) · 435 unmodified lines | |||
| 934 | } | 934 | } |
| 935 | 935 | ||
| 936 | //#define ERROR_DETAILS | 936 | //#define ERROR_DETAILS |
| 937 | int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, | 937 | int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, |
| 938 | int n, int coded, const uint8_t *scan_table) | 938 | int n, int coded, const uint8_t *scan_table) |
| 939 | { | 939 | { |
| 940 | int level, i, last, run, run_diff; | 940 | int level, i, last, run, run_diff; |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | #include "config.h" | 27 | #include "config.h" |
| 28 | #include "avcodec.h" | 28 | #include "avcodec.h" |
| 29 | #include "dsputil.h" | ||
| 30 | #include "mpegvideo.h" | 29 | #include "mpegvideo.h" |
| 31 | #include "msmpeg4data.h" | 30 | #include "msmpeg4data.h" |
| 32 | #include "put_bits.h" | 31 | #include "put_bits.h" |
| @@ -45,17 +44,17 @@ extern VLC ff_inter_intra_vlc; · 12 unmodified lines | |||
| 45 | 44 | ||
| 46 | void ff_msmpeg4_code012(PutBitContext *pb, int n); | 45 | void ff_msmpeg4_code012(PutBitContext *pb, int n); |
| 47 | void ff_msmpeg4_common_init(MpegEncContext *s); | 46 | void ff_msmpeg4_common_init(MpegEncContext *s); |
| 48 | void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n); | 47 | void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n); |
| 49 | void ff_msmpeg4_handle_slices(MpegEncContext *s); | 48 | void ff_msmpeg4_handle_slices(MpegEncContext *s); |
| 50 | void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); | 49 | void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my); |
| 51 | int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, | 50 | int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n, |
| 52 | uint8_t **coded_block_ptr); | 51 | uint8_t **coded_block_ptr); |
| 53 | int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); | 52 | int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr); |
| 54 | int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block, | 53 | int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block, |
| 55 | int n, int coded, const uint8_t *scan_table); | 54 | int n, int coded, const uint8_t *scan_table); |
| 56 | int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, | 55 | int ff_msmpeg4_pred_dc(MpegEncContext *s, int n, |
| 57 | int16_t **dc_val_ptr, int *dir_ptr); | 56 | int16_t **dc_val_ptr, int *dir_ptr); |
| 58 | int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]); | 57 | int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]); |
| 59 | 58 | ||
| 60 | #define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ | 59 | #define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \ |
| 61 | CONFIG_MSMPEG4V2_DECODER || \ | 60 | CONFIG_MSMPEG4V2_DECODER || \ |
| @@ -368,7 +368,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) · 367 unmodified lines | |||
| 368 | } | 368 | } |
| 369 | 369 | ||
| 370 | void ff_msmpeg4_encode_mb(MpegEncContext * s, | 370 | void ff_msmpeg4_encode_mb(MpegEncContext * s, |
| 371 | DCTELEM block[6][64], | 371 | int16_t block[6][64], |
| 372 | int motion_x, int motion_y) | 372 | int motion_x, int motion_y) |
| 373 | { | 373 | { |
| 374 | int cbp, coded_cbp, i; | 374 | int cbp, coded_cbp, i; |
| @@ -569,7 +569,7 @@ static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr · 194 unmodified lines | |||
| 569 | /* Encoding of a block. Very similar to MPEG4 except for a different | 569 | /* Encoding of a block. Very similar to MPEG4 except for a different |
| 570 | escape coding (same as H263) and more vlc tables. | 570 | escape coding (same as H263) and more vlc tables. |
| 571 | */ | 571 | */ |
| 572 | void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n) | 572 | void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n) |
| 573 | { | 573 | { |
| 574 | int level, run, last, i, j, last_index; | 574 | int level, run, last, i, j, last_index; |
| 575 | int last_non_zero, sign, slevel; | 575 | int last_non_zero, sign, slevel; |
| @@ -476,7 +476,7 @@ static int pix_sum_altivec(uint8_t * pix, int line_size) · 475 unmodified lines | |||
| 476 | return s; | 476 | return s; |
| 477 | } | 477 | } |
| 478 | 478 | ||
| 479 | static void get_pixels_altivec(DCTELEM *restrict block, const uint8_t *pixels, int line_size) | 479 | static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size) |
| 480 | { | 480 | { |
| 481 | int i; | 481 | int i; |
| 482 | vector unsigned char perm = vec_lvsl(0, pixels); | 482 | 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 · 19 unmodified lines | |||
| 502 | } | 502 | } |
| 503 | } | 503 | } |
| 504 | 504 | ||
| 505 | static void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1, | 505 | static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1, |
| 506 | const uint8_t *s2, int stride) | 506 | const uint8_t *s2, int stride) |
| 507 | { | 507 | { |
| 508 | int i; | 508 | int i; |
| @@ -576,7 +576,7 @@ static void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1, · 67 unmodified lines | |||
| 576 | } | 576 | } |
| 577 | 577 | ||
| 578 | 578 | ||
| 579 | static void clear_block_altivec(DCTELEM *block) { | 579 | static void clear_block_altivec(int16_t *block) { |
| 580 | LOAD_ZERO; | 580 | LOAD_ZERO; |
| 581 | vec_st(zero_s16v, 0, block); | 581 | vec_st(zero_s16v, 0, block); |
| 582 | vec_st(zero_s16v, 16, block); | 582 | vec_st(zero_s16v, 16, block); |
| @@ -47,7 +47,7 @@ distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required. · 46 unmodified lines | |||
| 47 | see <http://developer.apple.com/technotes/tn/tn2087.html> | 47 | see <http://developer.apple.com/technotes/tn/tn2087.html> |
| 48 | and <http://developer.apple.com/technotes/tn/tn2086.html> | 48 | and <http://developer.apple.com/technotes/tn/tn2086.html> |
| 49 | */ | 49 | */ |
| 50 | static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) | 50 | static void clear_blocks_dcbz32_ppc(int16_t *blocks) |
| 51 | { | 51 | { |
| 52 | register int misal = ((unsigned long)blocks & 0x00000010); | 52 | register int misal = ((unsigned long)blocks & 0x00000010); |
| 53 | register int i = 0; | 53 | register int i = 0; |
| @@ -58,7 +58,7 @@ static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) · 4 unmodified lines | |||
| 58 | ((unsigned long*)blocks)[3] = 0L; | 58 | ((unsigned long*)blocks)[3] = 0L; |
| 59 | i += 16; | 59 | i += 16; |
| 60 | } | 60 | } |
| 61 | for ( ; i < sizeof(DCTELEM)*6*64-31 ; i += 32) { | 61 | for ( ; i < sizeof(int16_t)*6*64-31 ; i += 32) { |
| 62 | __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory"); | 62 | __asm__ volatile("dcbz %0,%1" : : "b" (blocks), "r" (i) : "memory"); |
| 63 | } | 63 | } |
| 64 | if (misal) { | 64 | if (misal) { |
| @@ -73,7 +73,7 @@ static void clear_blocks_dcbz32_ppc(DCTELEM *blocks) · 8 unmodified lines | |||
| 73 | /* same as above, when dcbzl clear a whole 128B cache line | 73 | /* same as above, when dcbzl clear a whole 128B cache line |
| 74 | i.e. the PPC970 aka G5 */ | 74 | i.e. the PPC970 aka G5 */ |
| 75 | #if HAVE_DCBZL | 75 | #if HAVE_DCBZL |
| 76 | static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) | 76 | static void clear_blocks_dcbz128_ppc(int16_t *blocks) |
| 77 | { | 77 | { |
| 78 | register int misal = ((unsigned long)blocks & 0x0000007f); | 78 | register int misal = ((unsigned long)blocks & 0x0000007f); |
| 79 | register int i = 0; | 79 | register int i = 0; |
| @@ -81,17 +81,17 @@ static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) · 1 unmodified line | |||
| 81 | // we could probably also optimize this case, | 81 | // we could probably also optimize this case, |
| 82 | // but there's not much point as the machines | 82 | // but there's not much point as the machines |
| 83 | // aren't available yet (2003-06-26) | 83 | // aren't available yet (2003-06-26) |
| 84 | memset(blocks, 0, sizeof(DCTELEM)*6*64); | 84 | memset(blocks, 0, sizeof(int16_t)*6*64); |
| 85 | } | 85 | } |
| 86 | else | 86 | else |
| 87 | for ( ; i < sizeof(DCTELEM)*6*64 ; i += 128) { | 87 | for ( ; i < sizeof(int16_t)*6*64 ; i += 128) { |
| 88 | __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory"); | 88 | __asm__ volatile("dcbzl %0,%1" : : "b" (blocks), "r" (i) : "memory"); |
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | #else | 91 | #else |
| 92 | static void clear_blocks_dcbz128_ppc(DCTELEM *blocks) | 92 | static void clear_blocks_dcbz128_ppc(int16_t *blocks) |
| 93 | { | 93 | { |
| 94 | memset(blocks, 0, sizeof(DCTELEM)*6*64); | 94 | memset(blocks, 0, sizeof(int16_t)*6*64); |
| 95 | } | 95 | } |
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| @@ -315,7 +315,7 @@ H264_MC(avg_, 16, altivec) · 314 unmodified lines | |||
| 315 | va_u32 = vec_splat((vec_u32)va_u8, 0); \ | 315 | va_u32 = vec_splat((vec_u32)va_u8, 0); \ |
| 316 | vec_ste(va_u32, element, (uint32_t*)dst); | 316 | vec_ste(va_u32, element, (uint32_t*)dst); |
| 317 | 317 | ||
| 318 | static void ff_h264_idct_add_altivec(uint8_t *dst, DCTELEM *block, int stride) | 318 | static void ff_h264_idct_add_altivec(uint8_t *dst, int16_t *block, int stride) |
| 319 | { | 319 | { |
| 320 | vec_s16 va0, va1, va2, va3; | 320 | vec_s16 va0, va1, va2, va3; |
| 321 | vec_s16 vz0, vz1, vz2, vz3; | 321 | vec_s16 vz0, vz1, vz2, vz3; |
| @@ -429,7 +429,7 @@ static void ff_h264_idct_add_altivec(uint8_t *dst, DCTELEM *block, int stride) · 107 unmodified lines | |||
| 429 | vec_st( hv, 0, dest ); \ | 429 | vec_st( hv, 0, dest ); \ |
| 430 | } | 430 | } |
| 431 | 431 | ||
| 432 | static void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) { | 432 | static void ff_h264_idct8_add_altivec( uint8_t *dst, int16_t *dct, int stride ) { |
| 433 | vec_s16 s0, s1, s2, s3, s4, s5, s6, s7; | 433 | vec_s16 s0, s1, s2, s3, s4, s5, s6, s7; |
| 434 | vec_s16 d0, d1, d2, d3, d4, d5, d6, d7; | 434 | vec_s16 d0, d1, d2, d3, d4, d5, d6, d7; |
| 435 | vec_s16 idct0, idct1, idct2, idct3, idct4, idct5, idct6, idct7; | 435 | 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 ) · 37 unmodified lines | |||
| 473 | ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel); | 473 | ALTIVEC_STORE_SUM_CLIP(&dst[7*stride], idct7, perm_ldv, perm_stv, sel); |
| 474 | } | 474 | } |
| 475 | 475 | ||
| 476 | static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, DCTELEM *block, int stride, int size) | 476 | static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, int16_t *block, int stride, int size) |
| 477 | { | 477 | { |
| 478 | vec_s16 dc16; | 478 | vec_s16 dc16; |
| 479 | vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner; | 479 | 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 · 38 unmodified lines | |||
| 518 | } | 518 | } |
| 519 | } | 519 | } |
| 520 | 520 | ||
| 521 | static void h264_idct_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride) | 521 | static void h264_idct_dc_add_altivec(uint8_t *dst, int16_t *block, int stride) |
| 522 | { | 522 | { |
| 523 | h264_idct_dc_add_internal(dst, block, stride, 4); | 523 | h264_idct_dc_add_internal(dst, block, stride, 4); |
| 524 | } | 524 | } |
| 525 | 525 | ||
| 526 | static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride) | 526 | static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, int16_t *block, int stride) |
| 527 | { | 527 | { |
| 528 | h264_idct_dc_add_internal(dst, block, stride, 8); | 528 | h264_idct_dc_add_internal(dst, block, stride, 8); |
| 529 | } | 529 | } |
| 530 | 530 | ||
| 531 | static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 531 | 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]){ |
| 532 | int i; | 532 | int i; |
| 533 | for(i=0; i<16; i++){ | 533 | for(i=0; i<16; i++){ |
| 534 | int nnz = nnzc[ scan8[i] ]; | 534 | int nnz = nnzc[ scan8[i] ]; |
| @@ -539,7 +539,7 @@ static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, DC · 4 unmodified lines | |||
| 539 | } | 539 | } |
| 540 | } | 540 | } |
| 541 | 541 | ||
| 542 | static void ff_h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 542 | 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]){ |
| 543 | int i; | 543 | int i; |
| 544 | for(i=0; i<16; i++){ | 544 | for(i=0; i<16; i++){ |
| 545 | if(nnzc[ scan8[i] ]) ff_h264_idct_add_altivec(dst + block_offset[i], block + i*16, stride); | 545 | 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 · 1 unmodified line | |||
| 547 | } | 547 | } |
| 548 | } | 548 | } |
| 549 | 549 | ||
| 550 | static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 550 | 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]){ |
| 551 | int i; | 551 | int i; |
| 552 | for(i=0; i<16; i+=4){ | 552 | for(i=0; i<16; i+=4){ |
| 553 | int nnz = nnzc[ scan8[i] ]; | 553 | int nnz = nnzc[ scan8[i] ]; |
| @@ -558,7 +558,7 @@ static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DC · 4 unmodified lines | |||
| 558 | } | 558 | } |
| 559 | } | 559 | } |
| 560 | 560 | ||
| 561 | static void ff_h264_idct_add8_altivec(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){ | 561 | 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]){ |
| 562 | int i, j; | 562 | int i, j; |
| 563 | for (j = 1; j < 3; j++) { | 563 | for (j = 1; j < 3; j++) { |
| 564 | for(i = j * 16; i < j * 16 + 4; i++){ | 564 | for(i = j * 16; i < j * 16 + 4; i++){ |
| @@ -35,7 +35,7 @@ · 34 unmodified lines | |||
| 35 | /* AltiVec version of dct_unquantize_h263 | 35 | /* AltiVec version of dct_unquantize_h263 |
| 36 | this code assumes `block' is 16 bytes-aligned */ | 36 | this code assumes `block' is 16 bytes-aligned */ |
| 37 | static void dct_unquantize_h263_altivec(MpegEncContext *s, | 37 | static void dct_unquantize_h263_altivec(MpegEncContext *s, |
| 38 | DCTELEM *block, int n, int qscale) | 38 | int16_t *block, int n, int qscale) |
| 39 | { | 39 | { |
| 40 | int i, level, qmul, qadd; | 40 | int i, level, qmul, qadd; |
| 41 | int nCoeffs; | 41 | int nCoeffs; |
| @@ -129,7 +129,7 @@ do { \ · 128 unmodified lines | |||
| 129 | 129 | ||
| 130 | /** Do inverse transform on 8x8 block | 130 | /** Do inverse transform on 8x8 block |
| 131 | */ | 131 | */ |
| 132 | static void vc1_inv_trans_8x8_altivec(DCTELEM block[64]) | 132 | static void vc1_inv_trans_8x8_altivec(int16_t block[64]) |
| 133 | { | 133 | { |
| 134 | vector signed short src0, src1, src2, src3, src4, src5, src6, src7; | 134 | vector signed short src0, src1, src2, src3, src4, src5, src6, src7; |
| 135 | vector signed int s0, s1, s2, s3, s4, s5, s6, s7; | 135 | 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]) · 88 unmodified lines | |||
| 224 | 224 | ||
| 225 | /** Do inverse transform on 8x4 part of block | 225 | /** Do inverse transform on 8x4 part of block |
| 226 | */ | 226 | */ |
| 227 | static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, DCTELEM *block) | 227 | static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block) |
| 228 | { | 228 | { |
| 229 | vector signed short src0, src1, src2, src3, src4, src5, src6, src7; | 229 | vector signed short src0, src1, src2, src3, src4, src5, src6, src7; |
| 230 | vector signed int s0, s1, s2, s3, s4, s5, s6, s7; | 230 | vector signed int s0, s1, s2, s3, s4, s5, s6, s7; |
| @@ -116,7 +116,7 @@ static inline vec_s16 M16(vec_s16 a, vec_s16 C) · 115 unmodified lines | |||
| 116 | #define ADD8(a) vec_add(a, eight) | 116 | #define ADD8(a) vec_add(a, eight) |
| 117 | #define SHIFT4(a) vec_sra(a, four) | 117 | #define SHIFT4(a) vec_sra(a, four) |
| 118 | 118 | ||
| 119 | static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) | 119 | static void vp3_idct_put_altivec(uint8_t *dst, int stride, int16_t block[64]) |
| 120 | { | 120 | { |
| 121 | vec_u8 t; | 121 | vec_u8 t; |
| 122 | IDCT_START | 122 | IDCT_START |
| @@ -145,7 +145,7 @@ static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64]) · 22 unmodified lines | |||
| 145 | memset(block, 0, sizeof(*block) * 64); | 145 | memset(block, 0, sizeof(*block) * 64); |
| 146 | } | 146 | } |
| 147 | 147 | ||
| 148 | static void vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64]) | 148 | static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64]) |
| 149 | { | 149 | { |
| 150 | LOAD_ZERO; | 150 | LOAD_ZERO; |
| 151 | vec_u8 t, vdst; | 151 | vec_u8 t, vdst; |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | |||
| 34 | 34 | ||
| 35 | #include "libavutil/intmath.h" | 35 | #include "libavutil/intmath.h" |
| 36 | #include "avcodec.h" | 36 | #include "avcodec.h" |
| 37 | #include "dsputil.h" | ||
| 37 | #include "internal.h" | 38 | #include "internal.h" |
| 38 | #include "proresdata.h" | 39 | #include "proresdata.h" |
| 39 | #include "proresdsp.h" | 40 | #include "proresdsp.h" |
| @@ -45,7 +46,7 @@ typedef struct { · 5 unmodified lines | |||
| 45 | int x_pos, y_pos; | 46 | int x_pos, y_pos; |
| 46 | int slice_width; | 47 | int slice_width; |
| 47 | int prev_slice_sf; ///< scalefactor of the previous decoded slice | 48 | int prev_slice_sf; ///< scalefactor of the previous decoded slice |
| 48 | DECLARE_ALIGNED(16, DCTELEM, blocks)[8 * 4 * 64]; | 49 | DECLARE_ALIGNED(16, int16_t, blocks)[8 * 4 * 64]; |
| 49 | DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; | 50 | DECLARE_ALIGNED(16, int16_t, qmat_luma_scaled)[64]; |
| 50 | DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; | 51 | DECLARE_ALIGNED(16, int16_t, qmat_chroma_scaled)[64]; |
| 51 | } ProresThreadData; | 52 | } ProresThreadData; |
| @@ -340,10 +341,10 @@ static inline int decode_vlc_codeword(GetBitContext *gb, unsigned codebook) · 288 unmodified lines | |||
| 340 | /** | 341 | /** |
| 341 | * Decode DC coefficients for all blocks in a slice. | 342 | * Decode DC coefficients for all blocks in a slice. |
| 342 | */ | 343 | */ |
| 343 | static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, | 344 | static inline void decode_dc_coeffs(GetBitContext *gb, int16_t *out, |
| 344 | int nblocks) | 345 | int nblocks) |
| 345 | { | 346 | { |
| 346 | DCTELEM prev_dc; | 347 | int16_t prev_dc; |
| 347 | int i, sign; | 348 | int i, sign; |
| 348 | int16_t delta; | 349 | int16_t delta; |
| 349 | unsigned int code; | 350 | unsigned int code; |
| @@ -368,7 +369,7 @@ static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out, · 18 unmodified lines | |||
| 368 | /** | 369 | /** |
| 369 | * Decode AC coefficients for all blocks in a slice. | 370 | * Decode AC coefficients for all blocks in a slice. |
| 370 | */ | 371 | */ |
| 371 | static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out, | 372 | static inline void decode_ac_coeffs(GetBitContext *gb, int16_t *out, |
| 372 | int blocks_per_slice, | 373 | int blocks_per_slice, |
| 373 | int plane_size_factor, | 374 | int plane_size_factor, |
| 374 | const uint8_t *scan) | 375 | const uint8_t *scan) |
| @@ -421,7 +422,7 @@ static void decode_slice_plane(ProresContext *ctx, ProresThreadData *td, · 46 unmodified lines | |||
| 421 | const int16_t *qmat, int is_chroma) | 422 | const int16_t *qmat, int is_chroma) |
| 422 | { | 423 | { |
| 423 | GetBitContext gb; | 424 | GetBitContext gb; |
| 424 | DCTELEM *block_ptr; | 425 | int16_t *block_ptr; |
| 425 | int mb_num, blocks_per_slice; | 426 | int mb_num, blocks_per_slice; |
| 426 | 427 | ||
| 427 | blocks_per_slice = mbs_per_slice * blocks_per_mb; | 428 | blocks_per_slice = mbs_per_slice * blocks_per_mb; |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include "dsputil.h" | ||
| 23 | #include "proresdsp.h" | 24 | #include "proresdsp.h" |
| 24 | #include "simple_idct.h" | 25 | #include "simple_idct.h" |
| 25 | #include "libavutil/common.h" | 26 | #include "libavutil/common.h" |
| @@ -34,7 +35,7 @@ · 8 unmodified lines | |||
| 34 | /** | 35 | /** |
| 35 | * Add bias value, clamp and output pixels of a slice | 36 | * Add bias value, clamp and output pixels of a slice |
| 36 | */ | 37 | */ |
| 37 | static void put_pixels(uint16_t *dst, int stride, const DCTELEM *in) | 38 | static void put_pixels(uint16_t *dst, int stride, const int16_t *in) |
| 38 | { | 39 | { |
| 39 | int x, y, src_offset, dst_offset; | 40 | int x, y, src_offset, dst_offset; |
| 40 | 41 | ||
| @@ -47,7 +48,7 @@ static void put_pixels(uint16_t *dst, int stride, const DCTELEM *in) · 6 unmodified lines | |||
| 47 | } | 48 | } |
| 48 | } | 49 | } |
| 49 | 50 | ||
| 50 | static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat) | 51 | static void prores_idct_put_c(uint16_t *out, int linesize, int16_t *block, const int16_t *qmat) |
| 51 | { | 52 | { |
| 52 | ff_prores_idct(block, qmat); | 53 | ff_prores_idct(block, qmat); |
| 53 | put_pixels(out, linesize >> 1, block); | 54 | put_pixels(out, linesize >> 1, block); |
| @@ -55,7 +56,7 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const · 1 unmodified line | |||
| 55 | #endif | 56 | #endif |
| 56 | 57 | ||
| 57 | #if CONFIG_PRORES_ENCODER | 58 | #if CONFIG_PRORES_ENCODER |
| 58 | static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block) | 59 | static void prores_fdct_c(const uint16_t *src, int linesize, int16_t *block) |
| 59 | { | 60 | { |
| 60 | int x, y; | 61 | int x, y; |
| 61 | const uint16_t *tsrc = src; | 62 | const uint16_t *tsrc = src; |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | |||
| 23 | #ifndef AVCODEC_PRORESDSP_H | 23 | #ifndef AVCODEC_PRORESDSP_H |
| 24 | #define AVCODEC_PRORESDSP_H | 24 | #define AVCODEC_PRORESDSP_H |
| 25 | 25 | ||
| 26 | #include "dsputil.h" | 26 | #include <stdint.h> |
| 27 | 27 | ||
| 28 | #define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder | 28 | #define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder |
| 29 | 29 | ||
| @@ -32,8 +32,8 @@ typedef struct ProresDSPContext { · 2 unmodified lines | |||
| 32 | uint8_t idct_permutation[64]; | 32 | uint8_t idct_permutation[64]; |
| 33 | int dct_permutation_type; | 33 | int dct_permutation_type; |
| 34 | uint8_t dct_permutation[64]; | 34 | uint8_t dct_permutation[64]; |
| 35 | void (* idct_put) (uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat); | 35 | void (* idct_put) (uint16_t *out, int linesize, int16_t *block, const int16_t *qmat); |
| 36 | void (* fdct) (const uint16_t *src, int linesize, DCTELEM *block); | 36 | void (* fdct) (const uint16_t *src, int linesize, int16_t *block); |
| 37 | } ProresDSPContext; | 37 | } ProresDSPContext; |
| 38 | 38 | ||
| 39 | void ff_proresdsp_init(ProresDSPContext *dsp); | 39 | void ff_proresdsp_init(ProresDSPContext *dsp); |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #include "libavutil/opt.h" | 23 | #include "libavutil/opt.h" |
| 24 | #include "avcodec.h" | 24 | #include "avcodec.h" |
| 25 | #include "dsputil.h" | ||
| 25 | #include "put_bits.h" | 26 | #include "put_bits.h" |
| 26 | #include "bytestream.h" | 27 | #include "bytestream.h" |
| 27 | #include "internal.h" | 28 | #include "internal.h" |
| @@ -167,7 +168,7 @@ struct TrellisNode { · 139 unmodified lines | |||
| 167 | #define MAX_STORED_Q 16 | 168 | #define MAX_STORED_Q 16 |
| 168 | 169 | ||
| 169 | typedef struct ProresThreadData { | 170 | typedef struct ProresThreadData { |
| 170 | DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; | 171 | DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; |
| 171 | DECLARE_ALIGNED(16, uint16_t, emu_buf)[16 * 16]; | 172 | DECLARE_ALIGNED(16, uint16_t, emu_buf)[16 * 16]; |
| 172 | int16_t custom_q[64]; | 173 | int16_t custom_q[64]; |
| 173 | struct TrellisNode *nodes; | 174 | struct TrellisNode *nodes; |
| @@ -175,7 +176,7 @@ typedef struct ProresThreadData { · 1 unmodified line | |||
| 175 | 176 | ||
| 176 | typedef struct ProresContext { | 177 | typedef struct ProresContext { |
| 177 | AVClass *class; | 178 | AVClass *class; |
| 178 | DECLARE_ALIGNED(16, DCTELEM, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; | 179 | DECLARE_ALIGNED(16, int16_t, blocks)[MAX_PLANES][64 * 4 * MAX_MBS_PER_SLICE]; |
| 179 | DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16]; | 180 | DECLARE_ALIGNED(16, uint16_t, emu_buf)[16*16]; |
| 180 | int16_t quants[MAX_STORED_Q][64]; | 181 | int16_t quants[MAX_STORED_Q][64]; |
| 181 | int16_t custom_q[64]; | 182 | int16_t custom_q[64]; |
| @@ -210,7 +211,7 @@ typedef struct ProresContext { · 28 unmodified lines | |||
| 210 | 211 | ||
| 211 | static void get_slice_data(ProresContext *ctx, const uint16_t *src, | 212 | static void get_slice_data(ProresContext *ctx, const uint16_t *src, |
| 212 | int linesize, int x, int y, int w, int h, | 213 | int linesize, int x, int y, int w, int h, |
| 213 | DCTELEM *blocks, uint16_t *emu_buf, | 214 | int16_t *blocks, uint16_t *emu_buf, |
| 214 | int mbs_per_slice, int blocks_per_mb, int is_chroma) | 215 | int mbs_per_slice, int blocks_per_mb, int is_chroma) |
| 215 | { | 216 | { |
| 216 | const uint16_t *esrc; | 217 | const uint16_t *esrc; |
| @@ -314,7 +315,7 @@ static inline void encode_vlc_codeword(PutBitContext *pb, unsigned codebook, int · 97 unmodified lines | |||
| 314 | #define GET_SIGN(x) ((x) >> 31) | 315 | #define GET_SIGN(x) ((x) >> 31) |
| 315 | #define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x)) | 316 | #define MAKE_CODE(x) (((x) << 1) ^ GET_SIGN(x)) |
| 316 | 317 | ||
| 317 | static void encode_dcs(PutBitContext *pb, DCTELEM *blocks, | 318 | static void encode_dcs(PutBitContext *pb, int16_t *blocks, |
| 318 | int blocks_per_slice, int scale) | 319 | int blocks_per_slice, int scale) |
| 319 | { | 320 | { |
| 320 | int i; | 321 | int i; |
| @@ -340,7 +341,7 @@ static void encode_dcs(PutBitContext *pb, DCTELEM *blocks, · 19 unmodified lines | |||
| 340 | } | 341 | } |
| 341 | } | 342 | } |
| 342 | 343 | ||
| 343 | static void encode_acs(PutBitContext *pb, DCTELEM *blocks, | 344 | static void encode_acs(PutBitContext *pb, int16_t *blocks, |
| 344 | int blocks_per_slice, | 345 | int blocks_per_slice, |
| 345 | int plane_size_factor, | 346 | int plane_size_factor, |
| 346 | const uint8_t *scan, const int16_t *qmat) | 347 | const uint8_t *scan, const int16_t *qmat) |
| @@ -376,7 +377,7 @@ static void encode_acs(PutBitContext *pb, DCTELEM *blocks, · 29 unmodified lines | |||
| 376 | 377 | ||
| 377 | static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb, | 378 | static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb, |
| 378 | const uint16_t *src, int linesize, | 379 | const uint16_t *src, int linesize, |
| 379 | int mbs_per_slice, DCTELEM *blocks, | 380 | int mbs_per_slice, int16_t *blocks, |
| 380 | int blocks_per_mb, int plane_size_factor, | 381 | int blocks_per_mb, int plane_size_factor, |
| 381 | const int16_t *qmat) | 382 | const int16_t *qmat) |
| 382 | { | 383 | { |
| @@ -478,7 +479,7 @@ static inline int estimate_vlc(unsigned codebook, int val) · 95 unmodified lines | |||
| 478 | } | 479 | } |
| 479 | } | 480 | } |
| 480 | 481 | ||
| 481 | static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice, | 482 | static int estimate_dcs(int *error, int16_t *blocks, int blocks_per_slice, |
| 482 | int scale) | 483 | int scale) |
| 483 | { | 484 | { |
| 484 | int i; | 485 | int i; |
| @@ -509,7 +510,7 @@ static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice, · 24 unmodified lines | |||
| 509 | return bits; | 510 | return bits; |
| 510 | } | 511 | } |
| 511 | 512 | ||
| 512 | static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice, | 513 | static int estimate_acs(int *error, int16_t *blocks, int blocks_per_slice, |
| 513 | int plane_size_factor, | 514 | int plane_size_factor, |
| 514 | const uint8_t *scan, const int16_t *qmat) | 515 | const uint8_t *scan, const int16_t *qmat) |
| 515 | { | 516 | { |
| @@ -44,7 +44,7 @@ · 43 unmodified lines | |||
| 44 | * aligned this could be done faster in a different way, e.g. as it is done | 44 | * aligned this could be done faster in a different way, e.g. as it is done |
| 45 | * in MPlayer libmpcodecs/native/rtjpegn.c. | 45 | * in MPlayer libmpcodecs/native/rtjpegn.c. |
| 46 | */ | 46 | */ |
| 47 | static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan, | 47 | static inline int get_block(GetBitContext *gb, int16_t *block, const uint8_t *scan, |
| 48 | const uint32_t *quant) { | 48 | const uint32_t *quant) { |
| 49 | int coeff, i, n; | 49 | int coeff, i, n; |
| 50 | int8_t ac; | 50 | int8_t ac; |
| @@ -61,7 +61,7 @@ static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *sc · 10 unmodified lines | |||
| 61 | 61 | ||
| 62 | // normally we would only need to clear the (63 - coeff) last values, | 62 | // normally we would only need to clear the (63 - coeff) last values, |
| 63 | // but since we do not know where they are we just clear the whole block | 63 | // but since we do not know where they are we just clear the whole block |
| 64 | memset(block, 0, 64 * sizeof(DCTELEM)); | 64 | memset(block, 0, 64 * sizeof(int16_t)); |
| 65 | 65 | ||
| 66 | // 2 bits per coefficient | 66 | // 2 bits per coefficient |
| 67 | while (coeff) { | 67 | while (coeff) { |
| @@ -121,7 +121,7 @@ int ff_rtjpeg_decode_frame_yuv420(RTJpegContext *c, AVFrame *f, · 53 unmodified lines | |||
| 121 | if (res > 0) \ | 121 | if (res > 0) \ |
| 122 | c->dsp->idct_put(dst, stride, block); \ | 122 | c->dsp->idct_put(dst, stride, block); \ |
| 123 | } while (0) | 123 | } while (0) |
| 124 | DCTELEM *block = c->block; | 124 | int16_t *block = c->block; |
| 125 | BLOCK(c->lquant, y1, f->linesize[0]); | 125 | BLOCK(c->lquant, y1, f->linesize[0]); |
| 126 | y1 += 8; | 126 | y1 += 8; |
| 127 | BLOCK(c->lquant, y1, f->linesize[0]); | 127 | BLOCK(c->lquant, y1, f->linesize[0]); |
| @@ -35,7 +35,7 @@ typedef struct RTJpegContext { · 34 unmodified lines | |||
| 35 | uint8_t scan[64]; | 35 | uint8_t scan[64]; |
| 36 | uint32_t lquant[64]; | 36 | uint32_t lquant[64]; |
| 37 | uint32_t cquant[64]; | 37 | uint32_t cquant[64]; |
| 38 | DECLARE_ALIGNED(16, DCTELEM, block)[64]; | 38 | DECLARE_ALIGNED(16, int16_t, block)[64]; |
| 39 | } RTJpegContext; | 39 | } RTJpegContext; |
| 40 | 40 | ||
| 41 | void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, | 41 | void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp, |
| @@ -216,7 +216,7 @@ static int rv34_decode_cbp(GetBitContext *gb, RV34VLC *vlc, int table) · 215 unmodified lines | |||
| 216 | /** | 216 | /** |
| 217 | * Get one coefficient value from the bistream and store it. | 217 | * Get one coefficient value from the bistream and store it. |
| 218 | */ | 218 | */ |
| 219 | static inline void decode_coeff(DCTELEM *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q) | 219 | static inline void decode_coeff(int16_t *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q) |
| 220 | { | 220 | { |
| 221 | if(coef){ | 221 | if(coef){ |
| 222 | if(coef == esc){ | 222 | if(coef == esc){ |
| @@ -236,7 +236,7 @@ static inline void decode_coeff(DCTELEM *dst, int coef, int esc, GetBitContext * · 13 unmodified lines | |||
| 236 | /** | 236 | /** |
| 237 | * Decode 2x2 subblock of coefficients. | 237 | * Decode 2x2 subblock of coefficients. |
| 238 | */ | 238 | */ |
| 239 | static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q) | 239 | static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q) |
| 240 | { | 240 | { |
| 241 | int flags = modulo_three_table[code]; | 241 | int flags = modulo_three_table[code]; |
| 242 | 242 | ||
| @@ -254,13 +254,13 @@ static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, · 11 unmodified lines | |||
| 254 | /** | 254 | /** |
| 255 | * Decode a single coefficient. | 255 | * Decode a single coefficient. |
| 256 | */ | 256 | */ |
| 257 | static inline void decode_subblock1(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, int q) | 257 | static inline void decode_subblock1(int16_t *dst, int code, GetBitContext *gb, VLC *vlc, int q) |
| 258 | { | 258 | { |
| 259 | int coeff = modulo_three_table[code] >> 6; | 259 | int coeff = modulo_three_table[code] >> 6; |
| 260 | decode_coeff(dst, coeff, 3, gb, vlc, q); | 260 | decode_coeff(dst, coeff, 3, gb, vlc, q); |
| 261 | } | 261 | } |
| 262 | 262 | ||
| 263 | static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, | 263 | static inline void decode_subblock3(int16_t *dst, int code, GetBitContext *gb, VLC *vlc, |
| 264 | int q_dc, int q_ac1, int q_ac2) | 264 | int q_dc, int q_ac1, int q_ac2) |
| 265 | { | 265 | { |
| 266 | int flags = modulo_three_table[code]; | 266 | int flags = modulo_three_table[code]; |
| @@ -282,7 +282,7 @@ static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, V · 15 unmodified lines | |||
| 282 | * o--o | 282 | * o--o |
| 283 | */ | 283 | */ |
| 284 | 284 | ||
| 285 | static int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2) | 285 | 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) |
| 286 | { | 286 | { |
| 287 | int code, pattern, has_ac = 1; | 287 | int code, pattern, has_ac = 1; |
| 288 | 288 | ||
| @@ -994,7 +994,7 @@ static inline void rv34_process_block(RV34DecContext *r, · 705 unmodified lines | |||
| 994 | int fc, int sc, int q_dc, int q_ac) | 994 | int fc, int sc, int q_dc, int q_ac) |
| 995 | { | 995 | { |
| 996 | MpegEncContext *s = &r->s; | 996 | MpegEncContext *s = &r->s; |
| 997 | DCTELEM *ptr = s->block[0]; | 997 | int16_t *ptr = s->block[0]; |
| 998 | int has_ac = rv34_decode_block(ptr, &s->gb, r->cur_vlcs, | 998 | int has_ac = rv34_decode_block(ptr, &s->gb, r->cur_vlcs, |
| 999 | fc, sc, q_dc, q_ac, q_ac); | 999 | fc, sc, q_dc, q_ac, q_ac); |
| 1000 | if(has_ac){ | 1000 | if(has_ac){ |
| @@ -1007,13 +1007,13 @@ static inline void rv34_process_block(RV34DecContext *r, · 6 unmodified lines | |||
| 1007 | 1007 | ||
| 1008 | static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp) | 1008 | static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp) |
| 1009 | { | 1009 | { |
| 1010 | LOCAL_ALIGNED_16(DCTELEM, block16, [16]); | 1010 | LOCAL_ALIGNED_16(int16_t, block16, [16]); |
| 1011 | MpegEncContext *s = &r->s; | 1011 | MpegEncContext *s = &r->s; |
| 1012 | GetBitContext *gb = &s->gb; | 1012 | GetBitContext *gb = &s->gb; |
| 1013 | int q_dc = rv34_qscale_tab[ r->luma_dc_quant_i[s->qscale] ], | 1013 | int q_dc = rv34_qscale_tab[ r->luma_dc_quant_i[s->qscale] ], |
| 1014 | q_ac = rv34_qscale_tab[s->qscale]; | 1014 | q_ac = rv34_qscale_tab[s->qscale]; |
| 1015 | uint8_t *dst = s->dest[0]; | 1015 | uint8_t *dst = s->dest[0]; |
| 1016 | DCTELEM *ptr = s->block[0]; | 1016 | int16_t *ptr = s->block[0]; |
| 1017 | int i, j, itype, has_ac; | 1017 | int i, j, itype, has_ac; |
| 1018 | 1018 | ||
| 1019 | memset(block16, 0, 16 * sizeof(*block16)); | 1019 | memset(block16, 0, 16 * sizeof(*block16)); |
| @@ -1179,7 +1179,7 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) · 159 unmodified lines | |||
| 1179 | MpegEncContext *s = &r->s; | 1179 | MpegEncContext *s = &r->s; |
| 1180 | GetBitContext *gb = &s->gb; | 1180 | GetBitContext *gb = &s->gb; |
| 1181 | uint8_t *dst = s->dest[0]; | 1181 | uint8_t *dst = s->dest[0]; |
| 1182 | DCTELEM *ptr = s->block[0]; | 1182 | int16_t *ptr = s->block[0]; |
| 1183 | int mb_pos = s->mb_x + s->mb_y * s->mb_stride; | 1183 | int mb_pos = s->mb_x + s->mb_y * s->mb_stride; |
| 1184 | int cbp, cbp2; | 1184 | int cbp, cbp2; |
| 1185 | int q_dc, q_ac, has_ac; | 1185 | int q_dc, q_ac, has_ac; |
| @@ -1219,7 +1219,7 @@ static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types) · 33 unmodified lines | |||
| 1219 | 1219 | ||
| 1220 | if(r->is16){ | 1220 | if(r->is16){ |
| 1221 | // Only for RV34_MB_P_MIX16x16 | 1221 | // Only for RV34_MB_P_MIX16x16 |
| 1222 | LOCAL_ALIGNED_16(DCTELEM, block16, [16]); | 1222 | LOCAL_ALIGNED_16(int16_t, block16, [16]); |
| 1223 | memset(block16, 0, 16 * sizeof(*block16)); | 1223 | memset(block16, 0, 16 * sizeof(*block16)); |
| 1224 | q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ]; | 1224 | q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ]; |
| 1225 | q_ac = rv34_qscale_tab[s->qscale]; | 1225 | q_ac = rv34_qscale_tab[s->qscale]; |
| @@ -33,7 +33,7 @@ · 32 unmodified lines | |||
| 33 | * @{ | 33 | * @{ |
| 34 | */ | 34 | */ |
| 35 | 35 | ||
| 36 | static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block) | 36 | static av_always_inline void rv34_row_transform(int temp[16], int16_t *block) |
| 37 | { | 37 | { |
| 38 | int i; | 38 | int i; |
| 39 | 39 | ||
| @@ -54,12 +54,12 @@ static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block) · 14 unmodified lines | |||
| 54 | * Real Video 3.0/4.0 inverse transform + sample reconstruction | 54 | * Real Video 3.0/4.0 inverse transform + sample reconstruction |
| 55 | * Code is almost the same as in SVQ3, only scaling is different. | 55 | * Code is almost the same as in SVQ3, only scaling is different. |
| 56 | */ | 56 | */ |
| 57 | static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block){ | 57 | static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, int16_t *block){ |
| 58 | int temp[16]; | 58 | int temp[16]; |
| 59 | int i; | 59 | int i; |
| 60 | 60 | ||
| 61 | rv34_row_transform(temp, block); | 61 | rv34_row_transform(temp, block); |
| 62 | memset(block, 0, 16*sizeof(DCTELEM)); | 62 | memset(block, 0, 16*sizeof(int16_t)); |
| 63 | 63 | ||
| 64 | for(i = 0; i < 4; i++){ | 64 | for(i = 0; i < 4; i++){ |
| 65 | const int z0 = 13*(temp[4*0+i] + temp[4*2+i]) + 0x200; | 65 | 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){ · 16 unmodified lines | |||
| 82 | * Code is almost the same as rv34_inv_transform() | 82 | * Code is almost the same as rv34_inv_transform() |
| 83 | * but final coefficients are multiplied by 1.5 and have no rounding. | 83 | * but final coefficients are multiplied by 1.5 and have no rounding. |
| 84 | */ | 84 | */ |
| 85 | static void rv34_inv_transform_noround_c(DCTELEM *block){ | 85 | static void rv34_inv_transform_noround_c(int16_t *block){ |
| 86 | int temp[16]; | 86 | int temp[16]; |
| 87 | int i; | 87 | int i; |
| 88 | 88 | ||
| @@ -115,9 +115,9 @@ static void rv34_idct_dc_add_c(uint8_t *dst, ptrdiff_t stride, int dc) · 26 unmodified lines | |||
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | static void rv34_inv_transform_dc_noround_c(DCTELEM *block) | 118 | static void rv34_inv_transform_dc_noround_c(int16_t *block) |
| 119 | { | 119 | { |
| 120 | DCTELEM dc = (13 * 13 * 3 * block[0]) >> 11; | 120 | int16_t dc = (13 * 13 * 3 * block[0]) >> 11; |
| 121 | int i, j; | 121 | int i, j; |
| 122 | 122 | ||
| 123 | for (i = 0; i < 4; i++, block += 4) | 123 | for (i = 0; i < 4; i++, block += 4) |
| @@ -34,9 +34,9 @@ typedef void (*rv40_weight_func)(uint8_t *dst/*align width (8 or 16)*/, · 33 unmodified lines | |||
| 34 | uint8_t *src2/*align width (8 or 16)*/, | 34 | uint8_t *src2/*align width (8 or 16)*/, |
| 35 | int w1, int w2, ptrdiff_t stride); | 35 | int w1, int w2, ptrdiff_t stride); |
| 36 | 36 | ||
| 37 | typedef void (*rv34_inv_transform_func)(DCTELEM *block); | 37 | typedef void (*rv34_inv_transform_func)(int16_t *block); |
| 38 | 38 | ||
| 39 | typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); | 39 | typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block); |
| 40 | typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride, | 40 | typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride, |
| 41 | int dc); | 41 | int dc); |
| 42 | 42 | ||
| @@ -47,12 +47,12 @@ static void memzero_align8(void *dst,size_t size) · 46 unmodified lines | |||
| 47 | fp_single_leave(fpscr); | 47 | fp_single_leave(fpscr); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | static void clear_blocks_sh4(DCTELEM *blocks) | 50 | static void clear_blocks_sh4(int16_t *blocks) |
| 51 | { | 51 | { |
| 52 | memzero_align8(blocks,sizeof(DCTELEM)*6*64); | 52 | memzero_align8(blocks,sizeof(int16_t)*6*64); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | static void idct_put(uint8_t *dest, int line_size, DCTELEM *block) | 55 | static void idct_put(uint8_t *dest, int line_size, int16_t *block) |
| 56 | { | 56 | { |
| 57 | int i; | 57 | int i; |
| 58 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; | 58 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; |
| @@ -70,7 +70,7 @@ static void idct_put(uint8_t *dest, int line_size, DCTELEM *block) · 11 unmodified lines | |||
| 70 | block+=8; | 70 | block+=8; |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | static void idct_add(uint8_t *dest, int line_size, DCTELEM *block) | 73 | static void idct_add(uint8_t *dest, int line_size, int16_t *block) |
| 74 | { | 74 | { |
| 75 | int i; | 75 | int i; |
| 76 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; | 76 | uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | #include "libavcodec/avcodec.h" | 22 | #include "libavcodec/avcodec.h" |
| 23 | #include "libavcodec/dsputil.h" | 23 | #include "libavcodec/dsputil.h" |
| 24 | 24 | ||
| 25 | void ff_idct_sh4(DCTELEM *block); | 25 | void ff_idct_sh4(int16_t *block); |
| 26 | void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx); | 26 | void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx); |
| 27 | 27 | ||
| 28 | #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */ | 28 | #endif /* AVCODEC_SH4_DSPUTIL_SH4_H */ |
| @@ -89,7 +89,7 @@ static const float odd_table[] __attribute__ ((aligned(8))) = { · 88 unmodified lines | |||
| 89 | 89 | ||
| 90 | //optimized | 90 | //optimized |
| 91 | 91 | ||
| 92 | void ff_idct_sh4(DCTELEM *block) | 92 | void ff_idct_sh4(int16_t *block) |
| 93 | { | 93 | { |
| 94 | DEFREG; | 94 | DEFREG; |
| 95 | 95 | ||
| @@ -50,7 +50,7 @@ · 49 unmodified lines | |||
| 50 | and the butterfly must be multiplied by 0.5 * sqrt(2.0) */ | 50 | and the butterfly must be multiplied by 0.5 * sqrt(2.0) */ |
| 51 | #define C_SHIFT (4+1+12) | 51 | #define C_SHIFT (4+1+12) |
| 52 | 52 | ||
| 53 | static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col) | 53 | static inline void idct4col_put(uint8_t *dest, int line_size, const int16_t *col) |
| 54 | { | 54 | { |
| 55 | int c0, c1, c2, c3, a0, a1, a2, a3; | 55 | int c0, c1, c2, c3, a0, a1, a2, a3; |
| 56 | 56 | ||
| @@ -86,10 +86,10 @@ static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col · 29 unmodified lines | |||
| 86 | /* XXX: I think a 1.0/sqrt(2) normalization should be needed to | 86 | /* XXX: I think a 1.0/sqrt(2) normalization should be needed to |
| 87 | compensate the extra butterfly stage - I don't have the full DV | 87 | compensate the extra butterfly stage - I don't have the full DV |
| 88 | specification */ | 88 | specification */ |
| 89 | void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block) | 89 | void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block) |
| 90 | { | 90 | { |
| 91 | int i; | 91 | int i; |
| 92 | DCTELEM *ptr; | 92 | int16_t *ptr; |
| 93 | 93 | ||
| 94 | /* butterfly */ | 94 | /* butterfly */ |
| 95 | ptr = block; | 95 | ptr = block; |
| @@ -129,7 +129,7 @@ void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block) · 33 unmodified lines | |||
| 129 | #define C2 C_FIX(0.2705980501) | 129 | #define C2 C_FIX(0.2705980501) |
| 130 | #define C3 C_FIX(0.5) | 130 | #define C3 C_FIX(0.5) |
| 131 | #define C_SHIFT (4+1+12) | 131 | #define C_SHIFT (4+1+12) |
| 132 | static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col) | 132 | static inline void idct4col_add(uint8_t *dest, int line_size, const int16_t *col) |
| 133 | { | 133 | { |
| 134 | int c0, c1, c2, c3, a0, a1, a2, a3; | 134 | int c0, c1, c2, c3, a0, a1, a2, a3; |
| 135 | 135 | ||
| @@ -156,7 +156,7 @@ static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col · 20 unmodified lines | |||
| 156 | #define R2 R_FIX(0.2705980501) | 156 | #define R2 R_FIX(0.2705980501) |
| 157 | #define R3 R_FIX(0.5) | 157 | #define R3 R_FIX(0.5) |
| 158 | #define R_SHIFT 11 | 158 | #define R_SHIFT 11 |
| 159 | static inline void idct4row(DCTELEM *row) | 159 | static inline void idct4row(int16_t *row) |
| 160 | { | 160 | { |
| 161 | int c0, c1, c2, c3, a0, a1, a2, a3; | 161 | int c0, c1, c2, c3, a0, a1, a2, a3; |
| 162 | 162 | ||
| @@ -174,7 +174,7 @@ static inline void idct4row(DCTELEM *row) · 11 unmodified lines | |||
| 174 | row[3]= (c0 - c1) >> R_SHIFT; | 174 | row[3]= (c0 - c1) >> R_SHIFT; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) | 177 | void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block) |
| 178 | { | 178 | { |
| 179 | int i; | 179 | int i; |
| 180 | 180 | ||
| @@ -189,7 +189,7 @@ void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block) · 8 unmodified lines | |||
| 189 | } | 189 | } |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block) | 192 | void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block) |
| 193 | { | 193 | { |
| 194 | int i; | 194 | int i; |
| 195 | 195 | ||
| @@ -204,7 +204,7 @@ void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block) · 8 unmodified lines | |||
| 204 | } | 204 | } |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block) | 207 | void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block) |
| 208 | { | 208 | { |
| 209 | int i; | 209 | int i; |
| 210 | 210 | ||
| @@ -219,7 +219,7 @@ void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block) · 8 unmodified lines | |||
| 219 | } | 219 | } |
| 220 | } | 220 | } |
| 221 | 221 | ||
| 222 | void ff_prores_idct(DCTELEM *block, const int16_t *qmat) | 222 | void ff_prores_idct(int16_t *block, const int16_t *qmat) |
| 223 | { | 223 | { |
| 224 | int i; | 224 | int i; |
| 225 | 225 | ||
| @@ -29,30 +29,29 @@ · 28 unmodified lines | |||
| 29 | #define AVCODEC_SIMPLE_IDCT_H | 29 | #define AVCODEC_SIMPLE_IDCT_H |
| 30 | 30 | ||
| 31 | #include <stdint.h> | 31 | #include <stdint.h> |
| 32 | #include "dsputil.h" | ||
| 33 | 32 | ||
| 34 | void ff_simple_idct_put_8(uint8_t *dest, int line_size, DCTELEM *block); | 33 | void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block); |
| 35 | void ff_simple_idct_add_8(uint8_t *dest, int line_size, DCTELEM *block); | 34 | void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block); |
| 36 | void ff_simple_idct_8(DCTELEM *block); | 35 | void ff_simple_idct_8(int16_t *block); |
| 37 | 36 | ||
| 38 | void ff_simple_idct_put_10(uint8_t *dest, int line_size, DCTELEM *block); | 37 | void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block); |
| 39 | void ff_simple_idct_add_10(uint8_t *dest, int line_size, DCTELEM *block); | 38 | void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block); |
| 40 | void ff_simple_idct_10(DCTELEM *block); | 39 | void ff_simple_idct_10(int16_t *block); |
| 41 | /** | 40 | /** |
| 42 | * Special version of ff_simple_idct_10() which does dequantization | 41 | * Special version of ff_simple_idct_10() which does dequantization |
| 43 | * and scales by a factor of 2 more between the two IDCTs to account | 42 | * and scales by a factor of 2 more between the two IDCTs to account |
| 44 | * for larger scale of input coefficients. | 43 | * for larger scale of input coefficients. |
| 45 | */ | 44 | */ |
| 46 | void ff_prores_idct(DCTELEM *block, const int16_t *qmat); | 45 | void ff_prores_idct(int16_t *block, const int16_t *qmat); |
| 47 | 46 | ||
| 48 | void ff_simple_idct_mmx(int16_t *block); | 47 | void ff_simple_idct_mmx(int16_t *block); |
| 49 | void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); | 48 | void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); |
| 50 | void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); | 49 | void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); |
| 51 | 50 | ||
| 52 | void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block); | 51 | void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block); |
| 53 | 52 | ||
| 54 | void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block); | 53 | void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block); |
| 55 | void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block); | 54 | void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block); |
| 56 | void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block); | 55 | void ff_simple_idct44_add(uint8_t *dest, int line_size, int16_t *block); |
| 57 | 56 | ||
| 58 | #endif /* AVCODEC_SIMPLE_IDCT_H */ | 57 | #endif /* AVCODEC_SIMPLE_IDCT_H */ |
| @@ -85,7 +85,7 @@ · 84 unmodified lines | |||
| 85 | 85 | ||
| 86 | #endif | 86 | #endif |
| 87 | 87 | ||
| 88 | static inline void FUNC(idctRowCondDC)(DCTELEM *row, int extra_shift) | 88 | static inline void FUNC(idctRowCondDC)(int16_t *row, int extra_shift) |
| 89 | { | 89 | { |
| 90 | int a0, a1, a2, a3, b0, b1, b2, b3; | 90 | int a0, a1, a2, a3, b0, b1, b2, b3; |
| 91 | 91 | ||
| @@ -221,7 +221,7 @@ static inline void FUNC(idctRowCondDC)(DCTELEM *row, int extra_shift) · 129 unmodified lines | |||
| 221 | } while (0) | 221 | } while (0) |
| 222 | 222 | ||
| 223 | static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, | 223 | static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, |
| 224 | DCTELEM *col) | 224 | int16_t *col) |
| 225 | { | 225 | { |
| 226 | int a0, a1, a2, a3, b0, b1, b2, b3; | 226 | int a0, a1, a2, a3, b0, b1, b2, b3; |
| 227 | 227 | ||
| @@ -245,7 +245,7 @@ static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size, · 17 unmodified lines | |||
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, | 247 | static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, |
| 248 | DCTELEM *col) | 248 | int16_t *col) |
| 249 | { | 249 | { |
| 250 | int a0, a1, a2, a3, b0, b1, b2, b3; | 250 | int a0, a1, a2, a3, b0, b1, b2, b3; |
| 251 | 251 | ||
| @@ -268,7 +268,7 @@ static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size, · 16 unmodified lines | |||
| 268 | dest[0] = av_clip_pixel(dest[0] + ((a0 - b0) >> COL_SHIFT)); | 268 | dest[0] = av_clip_pixel(dest[0] + ((a0 - b0) >> COL_SHIFT)); |
| 269 | } | 269 | } |
| 270 | 270 | ||
| 271 | static inline void FUNC(idctSparseCol)(DCTELEM *col) | 271 | static inline void FUNC(idctSparseCol)(int16_t *col) |
| 272 | { | 272 | { |
| 273 | int a0, a1, a2, a3, b0, b1, b2, b3; | 273 | int a0, a1, a2, a3, b0, b1, b2, b3; |
| 274 | 274 | ||
| @@ -284,7 +284,7 @@ static inline void FUNC(idctSparseCol)(DCTELEM *col) · 9 unmodified lines | |||
| 284 | col[56] = ((a0 - b0) >> COL_SHIFT); | 284 | col[56] = ((a0 - b0) >> COL_SHIFT); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block) | 287 | void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, int16_t *block) |
| 288 | { | 288 | { |
| 289 | pixel *dest = (pixel *)dest_; | 289 | pixel *dest = (pixel *)dest_; |
| 290 | int i; | 290 | int i; |
| @@ -298,7 +298,7 @@ void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block) · 7 unmodified lines | |||
| 298 | FUNC(idctSparseColPut)(dest + i, line_size, block + i); | 298 | FUNC(idctSparseColPut)(dest + i, line_size, block + i); |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block) | 301 | void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, int16_t *block) |
| 302 | { | 302 | { |
| 303 | pixel *dest = (pixel *)dest_; | 303 | pixel *dest = (pixel *)dest_; |
| 304 | int i; | 304 | int i; |
| @@ -312,7 +312,7 @@ void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block) · 7 unmodified lines | |||
| 312 | FUNC(idctSparseColAdd)(dest + i, line_size, block + i); | 312 | FUNC(idctSparseColAdd)(dest + i, line_size, block + i); |
| 313 | } | 313 | } |
| 314 | 314 | ||
| 315 | void FUNC(ff_simple_idct)(DCTELEM *block) | 315 | void FUNC(ff_simple_idct)(int16_t *block) |
| 316 | { | 316 | { |
| 317 | int i; | 317 | int i; |
| 318 | 318 | ||
| @@ -20,10 +20,9 @@ · 19 unmodified lines | |||
| 20 | #define AVCODEC_SPARC_DSPUTIL_VIS_H | 20 | #define AVCODEC_SPARC_DSPUTIL_VIS_H |
| 21 | 21 | ||
| 22 | #include <stdint.h> | 22 | #include <stdint.h> |
| 23 | #include "libavcodec/dsputil.h" | ||
| 24 | 23 | ||
| 25 | void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data); | 24 | void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data); |
| 26 | void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data); | 25 | void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data); |
| 27 | void ff_simple_idct_vis(DCTELEM *data); | 26 | void ff_simple_idct_vis(int16_t *data); |
| 28 | 27 | ||
| 29 | #endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */ | 28 | #endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */ |
| @@ -388,7 +388,7 @@ static const DECLARE_ALIGNED(8, uint16_t, expand)[4] = { · 387 unmodified lines | |||
| 388 | "st %%f14, [%12+" dest "] \n\t"\ | 388 | "st %%f14, [%12+" dest "] \n\t"\ |
| 389 | 389 | ||
| 390 | 390 | ||
| 391 | void ff_simple_idct_vis(DCTELEM *data) { | 391 | void ff_simple_idct_vis(int16_t *data) { |
| 392 | int out1, out2, out3, out4; | 392 | int out1, out2, out3, out4; |
| 393 | DECLARE_ALIGNED(8, int16_t, temp)[8*8]; | 393 | DECLARE_ALIGNED(8, int16_t, temp)[8*8]; |
| 394 | 394 | ||
| @@ -428,7 +428,7 @@ void ff_simple_idct_vis(DCTELEM *data) { · 33 unmodified lines | |||
| 428 | ); | 428 | ); |
| 429 | } | 429 | } |
| 430 | 430 | ||
| 431 | void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data) { | 431 | void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data) { |
| 432 | int out1, out2, out3, out4, out5; | 432 | int out1, out2, out3, out4, out5; |
| 433 | int r1, r2, r3, r4, r5, r6, r7; | 433 | int r1, r2, r3, r4, r5, r6, r7; |
| 434 | 434 | ||
| @@ -478,7 +478,7 @@ void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data) { · 43 unmodified lines | |||
| 478 | ); | 478 | ); |
| 479 | } | 479 | } |
| 480 | 480 | ||
| 481 | void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data) { | 481 | void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data) { |
| 482 | int out1, out2, out3, out4, out5, out6; | 482 | int out1, out2, out3, out4, out5, out6; |
| 483 | int r1, r2, r3, r4, r5, r6, r7; | 483 | int r1, r2, r3, r4, r5, r6, r7; |
| 484 | 484 | ||
| @@ -137,7 +137,7 @@ static const uint32_t svq3_dequant_coeff[32] = { · 136 unmodified lines | |||
| 137 | 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533 | 137 | 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533 |
| 138 | }; | 138 | }; |
| 139 | 139 | ||
| 140 | void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) | 140 | void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp) |
| 141 | { | 141 | { |
| 142 | const int qmul = svq3_dequant_coeff[qp]; | 142 | const int qmul = svq3_dequant_coeff[qp]; |
| 143 | #define stride 16 | 143 | #define stride 16 |
| @@ -172,7 +172,7 @@ void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp) · 28 unmodified lines | |||
| 172 | } | 172 | } |
| 173 | #undef stride | 173 | #undef stride |
| 174 | 174 | ||
| 175 | void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, | 175 | void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, |
| 176 | int stride, int qp, int dc) | 176 | int stride, int qp, int dc) |
| 177 | { | 177 | { |
| 178 | const int qmul = svq3_dequant_coeff[qp]; | 178 | const int qmul = svq3_dequant_coeff[qp]; |
| @@ -210,7 +210,7 @@ void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, · 31 unmodified lines | |||
| 210 | } | 210 | } |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block, | 213 | static inline int svq3_decode_block(GetBitContext *gb, int16_t *block, |
| 214 | int index, const int type) | 214 | int index, const int type) |
| 215 | { | 215 | { |
| 216 | static const uint8_t *const scan_patterns[4] = | 216 | static const uint8_t *const scan_patterns[4] = |
| @@ -385,7 +385,7 @@ typedef struct VC1Context{ · 384 unmodified lines | |||
| 385 | int bi_type; | 385 | int bi_type; |
| 386 | int x8_type; | 386 | int x8_type; |
| 387 | 387 | ||
| 388 | DCTELEM (*block)[6][64]; | 388 | int16_t (*block)[6][64]; |
| 389 | int n_allocated_blks, cur_blk_idx, left_blk_idx, topleft_blk_idx, top_blk_idx; | 389 | int n_allocated_blks, cur_blk_idx, left_blk_idx, topleft_blk_idx, top_blk_idx; |
| 390 | uint32_t *cbp_base, *cbp; | 390 | uint32_t *cbp_base, *cbp; |
| 391 | uint8_t *is_intra_base, *is_intra; | 391 | uint8_t *is_intra_base, *is_intra; |
| @@ -2538,7 +2538,7 @@ static void vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, · 2537 unmodified lines | |||
| 2538 | * @param coded are AC coeffs present or not | 2538 | * @param coded are AC coeffs present or not |
| 2539 | * @param codingset set of VLC to decode data | 2539 | * @param codingset set of VLC to decode data |
| 2540 | */ | 2540 | */ |
| 2541 | static int vc1_decode_i_block(VC1Context *v, DCTELEM block[64], int n, | 2541 | static int vc1_decode_i_block(VC1Context *v, int16_t block[64], int n, |
| 2542 | int coded, int codingset) | 2542 | int coded, int codingset) |
| 2543 | { | 2543 | { |
| 2544 | GetBitContext *gb = &v->s.gb; | 2544 | GetBitContext *gb = &v->s.gb; |
| @@ -2701,7 +2701,7 @@ not_coded: · 156 unmodified lines | |||
| 2701 | * @param codingset set of VLC to decode data | 2701 | * @param codingset set of VLC to decode data |
| 2702 | * @param mquant quantizer value for this macroblock | 2702 | * @param mquant quantizer value for this macroblock |
| 2703 | */ | 2703 | */ |
| 2704 | static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, | 2704 | static int vc1_decode_i_block_adv(VC1Context *v, int16_t block[64], int n, |
| 2705 | int coded, int codingset, int mquant) | 2705 | int coded, int codingset, int mquant) |
| 2706 | { | 2706 | { |
| 2707 | GetBitContext *gb = &v->s.gb; | 2707 | GetBitContext *gb = &v->s.gb; |
| @@ -2913,7 +2913,7 @@ static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n, · 205 unmodified lines | |||
| 2913 | * @param mquant block quantizer | 2913 | * @param mquant block quantizer |
| 2914 | * @param codingset set of VLC to decode data | 2914 | * @param codingset set of VLC to decode data |
| 2915 | */ | 2915 | */ |
| 2916 | static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, | 2916 | static int vc1_decode_intra_block(VC1Context *v, int16_t block[64], int n, |
| 2917 | int coded, int mquant, int codingset) | 2917 | int coded, int mquant, int codingset) |
| 2918 | { | 2918 | { |
| 2919 | GetBitContext *gb = &v->s.gb; | 2919 | GetBitContext *gb = &v->s.gb; |
| @@ -3123,7 +3123,7 @@ static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n, · 203 unmodified lines | |||
| 3123 | 3123 | ||
| 3124 | /** Decode P block | 3124 | /** Decode P block |
| 3125 | */ | 3125 | */ |
| 3126 | static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n, | 3126 | static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n, |
| 3127 | int mquant, int ttmb, int first_block, | 3127 | int mquant, int ttmb, int first_block, |
| 3128 | uint8_t *dst, int linesize, int skip_block, | 3128 | uint8_t *dst, int linesize, int skip_block, |
| 3129 | int *ttmb_out) | 3129 | int *ttmb_out) |
| @@ -4505,7 +4505,7 @@ static void vc1_decode_i_blocks_adv(VC1Context *v) · 1375 unmodified lines | |||
| 4505 | s->mb_x = 0; | 4505 | s->mb_x = 0; |
| 4506 | ff_init_block_index(s); | 4506 | ff_init_block_index(s); |
| 4507 | for (;s->mb_x < s->mb_width; s->mb_x++) { | 4507 | for (;s->mb_x < s->mb_width; s->mb_x++) { |
| 4508 | DCTELEM (*block)[64] = v->block[v->cur_blk_idx]; | 4508 | int16_t (*block)[64] = v->block[v->cur_blk_idx]; |
| 4509 | ff_update_block_index(s); | 4509 | ff_update_block_index(s); |
| 4510 | s->dsp.clear_blocks(block[0]); | 4510 | s->dsp.clear_blocks(block[0]); |
| 4511 | mb_pos = s->mb_x + s->mb_y * s->mb_stride; | 4511 | mb_pos = s->mb_x + s->mb_y * s->mb_stride; |
| @@ -79,7 +79,7 @@ static void vc1_h_overlap_c(uint8_t* src, int stride) · 78 unmodified lines | |||
| 79 | } | 79 | } |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static void vc1_v_s_overlap_c(DCTELEM *top, DCTELEM *bottom) | 82 | static void vc1_v_s_overlap_c(int16_t *top, int16_t *bottom) |
| 83 | { | 83 | { |
| 84 | int i; | 84 | int i; |
| 85 | int a, b, c, d; | 85 | int a, b, c, d; |
| @@ -105,7 +105,7 @@ static void vc1_v_s_overlap_c(DCTELEM *top, DCTELEM *bottom) · 19 unmodified lines | |||
| 105 | } | 105 | } |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | static void vc1_h_s_overlap_c(DCTELEM *left, DCTELEM *right) | 108 | static void vc1_h_s_overlap_c(int16_t *left, int16_t *right) |
| 109 | { | 109 | { |
| 110 | int i; | 110 | int i; |
| 111 | int a, b, c, d; | 111 | int a, b, c, d; |
| @@ -229,7 +229,7 @@ static void vc1_h_loop_filter16_c(uint8_t *src, int stride, int pq) · 117 unmodified lines | |||
| 229 | 229 | ||
| 230 | /** Do inverse transform on 8x8 block | 230 | /** Do inverse transform on 8x8 block |
| 231 | */ | 231 | */ |
| 232 | static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) | 232 | static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, int16_t *block) |
| 233 | { | 233 | { |
| 234 | int i; | 234 | int i; |
| 235 | int dc = block[0]; | 235 | int dc = block[0]; |
| @@ -248,11 +248,11 @@ static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) · 12 unmodified lines | |||
| 248 | } | 248 | } |
| 249 | } | 249 | } |
| 250 | 250 | ||
| 251 | static void vc1_inv_trans_8x8_c(DCTELEM block[64]) | 251 | static void vc1_inv_trans_8x8_c(int16_t block[64]) |
| 252 | { | 252 | { |
| 253 | int i; | 253 | int i; |
| 254 | register int t1,t2,t3,t4,t5,t6,t7,t8; | 254 | register int t1,t2,t3,t4,t5,t6,t7,t8; |
| 255 | DCTELEM *src, *dst, temp[64]; | 255 | int16_t *src, *dst, temp[64]; |
| 256 | 256 | ||
| 257 | src = block; | 257 | src = block; |
| 258 | dst = temp; | 258 | dst = temp; |
| @@ -319,7 +319,7 @@ static void vc1_inv_trans_8x8_c(DCTELEM block[64]) · 60 unmodified lines | |||
| 319 | 319 | ||
| 320 | /** Do inverse transform on 8x4 part of block | 320 | /** Do inverse transform on 8x4 part of block |
| 321 | */ | 321 | */ |
| 322 | static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) | 322 | static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, int16_t *block) |
| 323 | { | 323 | { |
| 324 | int i; | 324 | int i; |
| 325 | int dc = block[0]; | 325 | int dc = block[0]; |
| @@ -338,11 +338,11 @@ static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) · 12 unmodified lines | |||
| 338 | } | 338 | } |
| 339 | } | 339 | } |
| 340 | 340 | ||
| 341 | static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) | 341 | static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, int16_t *block) |
| 342 | { | 342 | { |
| 343 | int i; | 343 | int i; |
| 344 | register int t1,t2,t3,t4,t5,t6,t7,t8; | 344 | register int t1,t2,t3,t4,t5,t6,t7,t8; |
| 345 | DCTELEM *src, *dst; | 345 | int16_t *src, *dst; |
| 346 | 346 | ||
| 347 | src = block; | 347 | src = block; |
| 348 | dst = block; | 348 | dst = block; |
| @@ -394,7 +394,7 @@ static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block) · 45 unmodified lines | |||
| 394 | 394 | ||
| 395 | /** Do inverse transform on 4x8 parts of block | 395 | /** Do inverse transform on 4x8 parts of block |
| 396 | */ | 396 | */ |
| 397 | static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) | 397 | static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, int16_t *block) |
| 398 | { | 398 | { |
| 399 | int i; | 399 | int i; |
| 400 | int dc = block[0]; | 400 | int dc = block[0]; |
| @@ -409,11 +409,11 @@ static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block) · 8 unmodified lines | |||
| 409 | } | 409 | } |
| 410 | } | 410 | } |
| 411 | 411 | ||
| 412 | static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) | 412 | static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, int16_t *block) |
| 413 | { | 413 | { |
| 414 | int i; | 414 | int i; |
| 415 | register int t1,t2,t3,t4,t5,t6,t7,t8; | 415 | register int t1,t2,t3,t4,t5,t6,t7,t8; |
| 416 | DCTELEM *src, *dst; | 416 | int16_t *src, *dst; |
| 417 | 417 | ||
| 418 | src = block; | 418 | src = block; |
| 419 | dst = block; | 419 | dst = block; |
| @@ -465,7 +465,7 @@ static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block) · 45 unmodified lines | |||
| 465 | 465 | ||
| 466 | /** Do inverse transform on 4x4 part of block | 466 | /** Do inverse transform on 4x4 part of block |
| 467 | */ | 467 | */ |
| 468 | static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) | 468 | static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, int16_t *block) |
| 469 | { | 469 | { |
| 470 | int i; | 470 | int i; |
| 471 | int dc = block[0]; | 471 | int dc = block[0]; |
| @@ -480,11 +480,11 @@ static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block) · 8 unmodified lines | |||
| 480 | } | 480 | } |
| 481 | } | 481 | } |
| 482 | 482 | ||
| 483 | static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block) | 483 | static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, int16_t *block) |
| 484 | { | 484 | { |
| 485 | int i; | 485 | int i; |
| 486 | register int t1,t2,t3,t4; | 486 | register int t1,t2,t3,t4; |
| 487 | DCTELEM *src, *dst; | 487 | int16_t *src, *dst; |
| 488 | 488 | ||
| 489 | src = block; | 489 | src = block; |
| 490 | dst = block; | 490 | dst = block; |
| @@ -32,18 +32,18 @@ · 31 unmodified lines | |||
| 32 | 32 | ||
| 33 | typedef struct VC1DSPContext { | 33 | typedef struct VC1DSPContext { |
| 34 | /* vc1 functions */ | 34 | /* vc1 functions */ |
| 35 | void (*vc1_inv_trans_8x8)(DCTELEM *b); | 35 | void (*vc1_inv_trans_8x8)(int16_t *b); |
| 36 | void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, DCTELEM *block); | 36 | void (*vc1_inv_trans_8x4)(uint8_t *dest, int line_size, int16_t *block); |
| 37 | void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, DCTELEM *block); | 37 | void (*vc1_inv_trans_4x8)(uint8_t *dest, int line_size, int16_t *block); |
| 38 | void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, DCTELEM *block); | 38 | void (*vc1_inv_trans_4x4)(uint8_t *dest, int line_size, int16_t *block); |
| 39 | void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, DCTELEM *block); | 39 | void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, int line_size, int16_t *block); |
| 40 | void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, DCTELEM *block); | 40 | void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, int line_size, int16_t *block); |
| 41 | void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, DCTELEM *block); | 41 | void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, int line_size, int16_t *block); |
| 42 | void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, DCTELEM *block); | 42 | void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, int line_size, int16_t *block); |
| 43 | void (*vc1_v_overlap)(uint8_t *src, int stride); | 43 | void (*vc1_v_overlap)(uint8_t *src, int stride); |
| 44 | void (*vc1_h_overlap)(uint8_t *src, int stride); | 44 | void (*vc1_h_overlap)(uint8_t *src, int stride); |
| 45 | void (*vc1_v_s_overlap)(DCTELEM *top, DCTELEM *bottom); | 45 | void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom); |
| 46 | void (*vc1_h_s_overlap)(DCTELEM *left, DCTELEM *right); | 46 | void (*vc1_h_s_overlap)(int16_t *left, int16_t *right); |
| 47 | void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq); | 47 | void (*vc1_v_loop_filter4)(uint8_t *src, int stride, int pq); |
| 48 | void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq); | 48 | void (*vc1_h_loop_filter4)(uint8_t *src, int stride, int pq); |
| 49 | void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq); | 49 | void (*vc1_v_loop_filter8)(uint8_t *src, int stride, int pq); |
| @@ -138,7 +138,7 @@ typedef struct Vp3DecodeContext { · 137 unmodified lines | |||
| 138 | DSPContext dsp; | 138 | DSPContext dsp; |
| 139 | VideoDSPContext vdsp; | 139 | VideoDSPContext vdsp; |
| 140 | VP3DSPContext vp3dsp; | 140 | VP3DSPContext vp3dsp; |
| 141 | DECLARE_ALIGNED(16, DCTELEM, block)[64]; | 141 | DECLARE_ALIGNED(16, int16_t, block)[64]; |
| 142 | int flipped_image; | 142 | int flipped_image; |
| 143 | int last_slice_end; | 143 | int last_slice_end; |
| 144 | int skip_loop_filter; | 144 | int skip_loop_filter; |
| @@ -920,7 +920,7 @@ static int unpack_vlcs(Vp3DecodeContext *s, GetBitContext *gb, · 775 unmodified lines | |||
| 920 | int i, j = 0; | 920 | int i, j = 0; |
| 921 | int token; | 921 | int token; |
| 922 | int zero_run = 0; | 922 | int zero_run = 0; |
| 923 | DCTELEM coeff = 0; | 923 | int16_t coeff = 0; |
| 924 | int bits_to_get; | 924 | int bits_to_get; |
| 925 | int blocks_ended; | 925 | int blocks_ended; |
| 926 | int coeff_i = 0; | 926 | int coeff_i = 0; |
| @@ -1350,7 +1350,7 @@ static void apply_loop_filter(Vp3DecodeContext *s, int plane, int ystart, int ye · 423 unmodified lines | |||
| 1350 | * for the next block in coding order | 1350 | * for the next block in coding order |
| 1351 | */ | 1351 | */ |
| 1352 | static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, | 1352 | static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag, |
| 1353 | int plane, int inter, DCTELEM block[64]) | 1353 | int plane, int inter, int16_t block[64]) |
| 1354 | { | 1354 | { |
| 1355 | int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; | 1355 | int16_t *dequantizer = s->qmat[frag->qpi][inter][plane]; |
| 1356 | uint8_t *perm = s->scantable.permutated; | 1356 | uint8_t *perm = s->scantable.permutated; |
| @@ -1459,7 +1459,7 @@ static void await_reference_row(Vp3DecodeContext *s, Vp3Fragment *fragment, int · 102 unmodified lines | |||
| 1459 | static void render_slice(Vp3DecodeContext *s, int slice) | 1459 | static void render_slice(Vp3DecodeContext *s, int slice) |
| 1460 | { | 1460 | { |
| 1461 | int x, y, i, j, fragment; | 1461 | int x, y, i, j, fragment; |
| 1462 | DCTELEM *block = s->block; | 1462 | int16_t *block = s->block; |
| 1463 | int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; | 1463 | int motion_x = 0xdeadbeef, motion_y = 0xdeadbeef; |
| 1464 | int motion_halfpel_index; | 1464 | int motion_halfpel_index; |
| 1465 | uint8_t *motion_source; | 1465 | uint8_t *motion_source; |
| @@ -213,18 +213,23 @@ static av_always_inline void idct(uint8_t *dst, int stride, int16_t *input, int · 212 unmodified lines | |||
| 213 | } | 213 | } |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ | 216 | static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, |
| 217 | int16_t *block/*align 16*/) | ||
| 218 | { | ||
| 217 | idct(dest, line_size, block, 1); | 219 | idct(dest, line_size, block, 1); |
| 218 | memset(block, 0, sizeof(*block) * 64); | 220 | memset(block, 0, sizeof(*block) * 64); |
| 219 | } | 221 | } |
| 220 | 222 | ||
| 221 | static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){ | 223 | static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, |
| 224 | int16_t *block/*align 16*/) | ||
| 225 | { | ||
| 222 | idct(dest, line_size, block, 2); | 226 | idct(dest, line_size, block, 2); |
| 223 | memset(block, 0, sizeof(*block) * 64); | 227 | memset(block, 0, sizeof(*block) * 64); |
| 224 | } | 228 | } |
| 225 | 229 | ||
| 226 | static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, | 230 | static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size, |
| 227 | DCTELEM *block/*align 16*/){ | 231 | int16_t *block/*align 16*/) |
| 232 | { | ||
| 228 | int i, dc = (block[0] + 15) >> 5; | 233 | int i, dc = (block[0] + 15) >> 5; |
| 229 | 234 | ||
| 230 | for(i = 0; i < 8; i++){ | 235 | for(i = 0; i < 8; i++){ |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | |||
| 21 | 21 | ||
| 22 | #include <stddef.h> | 22 | #include <stddef.h> |
| 23 | #include <stdint.h> | 23 | #include <stdint.h> |
| 24 | #include "dsputil.h" | ||
| 25 | 24 | ||
| 26 | typedef struct VP3DSPContext { | 25 | typedef struct VP3DSPContext { |
| 27 | /** | 26 | /** |
| @@ -39,9 +38,9 @@ typedef struct VP3DSPContext { · 11 unmodified lines | |||
| 39 | const uint8_t *b, | 38 | const uint8_t *b, |
| 40 | ptrdiff_t stride, int h); | 39 | ptrdiff_t stride, int h); |
| 41 | 40 | ||
| 42 | void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); | 41 | void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); |
| 43 | void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block); | 42 | void (*idct_add)(uint8_t *dest, int line_size, int16_t *block); |
| 44 | void (*idct_dc_add)(uint8_t *dest, int line_size, DCTELEM *block); | 43 | void (*idct_dc_add)(uint8_t *dest, int line_size, int16_t *block); |
| 45 | void (*v_loop_filter)(uint8_t *src, int stride, int *bounding_values); | 44 | void (*v_loop_filter)(uint8_t *src, int stride, int *bounding_values); |
| 46 | void (*h_loop_filter)(uint8_t *src, int stride, int *bounding_values); | 45 | void (*h_loop_filter)(uint8_t *src, int stride, int *bounding_values); |
| 47 | 46 | ||
| @@ -67,7 +67,7 @@ typedef struct VP56RangeCoder { · 66 unmodified lines | |||
| 67 | typedef struct VP56RefDc { | 67 | typedef struct VP56RefDc { |
| 68 | uint8_t not_null_dc; | 68 | uint8_t not_null_dc; |
| 69 | VP56Frame ref_frame; | 69 | VP56Frame ref_frame; |
| 70 | DCTELEM dc_coeff; | 70 | int16_t dc_coeff; |
| 71 | } VP56RefDc; | 71 | } VP56RefDc; |
| 72 | 72 | ||
| 73 | typedef struct VP56Macroblock { | 73 | typedef struct VP56Macroblock { |
| @@ -124,12 +124,12 @@ struct vp56_context { · 50 unmodified lines | |||
| 124 | VP56RefDc *above_blocks; | 124 | VP56RefDc *above_blocks; |
| 125 | VP56RefDc left_block[4]; | 125 | VP56RefDc left_block[4]; |
| 126 | int above_block_idx[6]; | 126 | int above_block_idx[6]; |
| 127 | DCTELEM prev_dc[3][3]; /* [plan][ref_frame] */ | 127 | int16_t prev_dc[3][3]; /* [plan][ref_frame] */ |
| 128 | 128 | ||
| 129 | /* blocks / macroblock */ | 129 | /* blocks / macroblock */ |
| 130 | VP56mb mb_type; | 130 | VP56mb mb_type; |
| 131 | VP56Macroblock *macroblocks; | 131 | VP56Macroblock *macroblocks; |
| 132 | DECLARE_ALIGNED(16, DCTELEM, block_coeff)[6][64]; | 132 | DECLARE_ALIGNED(16, int16_t, block_coeff)[6][64]; |
| 133 | 133 | ||
| 134 | /* motion vectors */ | 134 | /* motion vectors */ |
| 135 | VP56mv mv[6]; /* vectors for each block in MB */ | 135 | VP56mv mv[6]; /* vectors for each block in MB */ |
| @@ -760,7 +760,7 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, · 759 unmodified lines | |||
| 760 | * @return 0 if no coeffs were decoded | 760 | * @return 0 if no coeffs were decoded |
| 761 | * otherwise, the index of the last coeff decoded plus one | 761 | * otherwise, the index of the last coeff decoded plus one |
| 762 | */ | 762 | */ |
| 763 | static int decode_block_coeffs_internal(VP56RangeCoder *r, DCTELEM block[16], | 763 | static int decode_block_coeffs_internal(VP56RangeCoder *r, int16_t block[16], |
| 764 | uint8_t probs[16][3][NUM_DCT_TOKENS-1], | 764 | uint8_t probs[16][3][NUM_DCT_TOKENS-1], |
| 765 | int i, uint8_t *token_prob, int16_t qmul[2]) | 765 | int i, uint8_t *token_prob, int16_t qmul[2]) |
| 766 | { | 766 | { |
| @@ -828,7 +828,7 @@ skip_eob: · 61 unmodified lines | |||
| 828 | * otherwise, the index of the last coeff decoded plus one | 828 | * otherwise, the index of the last coeff decoded plus one |
| 829 | */ | 829 | */ |
| 830 | static av_always_inline | 830 | static av_always_inline |
| 831 | int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16], | 831 | int decode_block_coeffs(VP56RangeCoder *c, int16_t block[16], |
| 832 | uint8_t probs[16][3][NUM_DCT_TOKENS-1], | 832 | uint8_t probs[16][3][NUM_DCT_TOKENS-1], |
| 833 | int i, int zero_nhood, int16_t qmul[2]) | 833 | int i, int zero_nhood, int16_t qmul[2]) |
| 834 | { | 834 | { |
| @@ -94,8 +94,8 @@ typedef struct VP8Macroblock { · 93 unmodified lines | |||
| 94 | } VP8Macroblock; | 94 | } VP8Macroblock; |
| 95 | 95 | ||
| 96 | typedef struct VP8ThreadData { | 96 | typedef struct VP8ThreadData { |
| 97 | DECLARE_ALIGNED(16, DCTELEM, block)[6][4][16]; | 97 | DECLARE_ALIGNED(16, int16_t, block)[6][4][16]; |
| 98 | DECLARE_ALIGNED(16, DCTELEM, block_dc)[16]; | 98 | DECLARE_ALIGNED(16, int16_t, block_dc)[16]; |
| 99 | /** | 99 | /** |
| 100 | * This is the index plus one of the last non-zero coeff | 100 | * This is the index plus one of the last non-zero coeff |
| 101 | * for each of the blocks in the current macroblock. | 101 | * for each of the blocks in the current macroblock. |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | |||
| 29 | #include "libavutil/common.h" | 29 | #include "libavutil/common.h" |
| 30 | 30 | ||
| 31 | // TODO: Maybe add dequant | 31 | // TODO: Maybe add dequant |
| 32 | static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16]) | 32 | static void vp8_luma_dc_wht_c(int16_t block[4][4][16], int16_t dc[16]) |
| 33 | { | 33 | { |
| 34 | int i, t0, t1, t2, t3; | 34 | int i, t0, t1, t2, t3; |
| 35 | 35 | ||
| @@ -62,7 +62,7 @@ static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16]) · 26 unmodified lines | |||
| 62 | } | 62 | } |
| 63 | } | 63 | } |
| 64 | 64 | ||
| 65 | static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16]) | 65 | static void vp8_luma_dc_wht_dc_c(int16_t block[4][4][16], int16_t dc[16]) |
| 66 | { | 66 | { |
| 67 | int i, val = (dc[0] + 3) >> 3; | 67 | int i, val = (dc[0] + 3) >> 3; |
| 68 | dc[0] = 0; | 68 | dc[0] = 0; |
| @@ -78,10 +78,10 @@ static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16]) · 9 unmodified lines | |||
| 78 | #define MUL_20091(a) ((((a)*20091) >> 16) + (a)) | 78 | #define MUL_20091(a) ((((a)*20091) >> 16) + (a)) |
| 79 | #define MUL_35468(a) (((a)*35468) >> 16) | 79 | #define MUL_35468(a) (((a)*35468) >> 16) |
| 80 | 80 | ||
| 81 | static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) | 81 | static void vp8_idct_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
| 82 | { | 82 | { |
| 83 | int i, t0, t1, t2, t3; | 83 | int i, t0, t1, t2, t3; |
| 84 | DCTELEM tmp[16]; | 84 | int16_t tmp[16]; |
| 85 | 85 | ||
| 86 | for (i = 0; i < 4; i++) { | 86 | for (i = 0; i < 4; i++) { |
| 87 | t0 = block[0*4+i] + block[2*4+i]; | 87 | 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) · 25 unmodified lines | |||
| 113 | } | 113 | } |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) | 116 | static void vp8_idct_dc_add_c(uint8_t *dst, int16_t block[16], ptrdiff_t stride) |
| 117 | { | 117 | { |
| 118 | int i, dc = (block[0] + 4) >> 3; | 118 | int i, dc = (block[0] + 4) >> 3; |
| 119 | block[0] = 0; | 119 | block[0] = 0; |
| @@ -127,7 +127,7 @@ static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride) · 7 unmodified lines | |||
| 127 | } | 127 | } |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride) | 130 | static void vp8_idct_dc_add4uv_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride) |
| 131 | { | 131 | { |
| 132 | vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride); | 132 | vp8_idct_dc_add_c(dst+stride*0+0, block[0], stride); |
| 133 | vp8_idct_dc_add_c(dst+stride*0+4, block[1], stride); | 133 | 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 · 1 unmodified line | |||
| 135 | vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride); | 135 | vp8_idct_dc_add_c(dst+stride*4+4, block[3], stride); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static void vp8_idct_dc_add4y_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride) | 138 | static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride) |
| 139 | { | 139 | { |
| 140 | vp8_idct_dc_add_c(dst+ 0, block[0], stride); | 140 | vp8_idct_dc_add_c(dst+ 0, block[0], stride); |
| 141 | vp8_idct_dc_add_c(dst+ 4, block[1], stride); | 141 | vp8_idct_dc_add_c(dst+ 4, block[1], stride); |
| @@ -27,20 +27,21 @@ · 26 unmodified lines | |||
| 27 | #ifndef AVCODEC_VP8DSP_H | 27 | #ifndef AVCODEC_VP8DSP_H |
| 28 | #define AVCODEC_VP8DSP_H | 28 | #define AVCODEC_VP8DSP_H |
| 29 | 29 | ||
| 30 | #include "dsputil.h" | 30 | #include <stddef.h> |
| 31 | #include <stdint.h> | ||
| 31 | 32 | ||
| 32 | typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride, | 33 | typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride, |
| 33 | uint8_t *src/*align 1*/, ptrdiff_t srcStride, | 34 | uint8_t *src/*align 1*/, ptrdiff_t srcStride, |
| 34 | int h, int x, int y); | 35 | int h, int x, int y); |
| 35 | 36 | ||
| 36 | typedef struct VP8DSPContext { | 37 | typedef struct VP8DSPContext { |
| 37 | void (*vp8_luma_dc_wht)(DCTELEM block[4][4][16], DCTELEM dc[16]); | 38 | void (*vp8_luma_dc_wht)(int16_t block[4][4][16], int16_t dc[16]); |
| 38 | void (*vp8_luma_dc_wht_dc)(DCTELEM block[4][4][16], DCTELEM dc[16]); | 39 | void (*vp8_luma_dc_wht_dc)(int16_t block[4][4][16], int16_t dc[16]); |
| 39 | void (*vp8_idct_add)(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 40 | void (*vp8_idct_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 40 | void (*vp8_idct_dc_add)(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride); | 41 | void (*vp8_idct_dc_add)(uint8_t *dst, int16_t block[16], ptrdiff_t stride); |
| 41 | void (*vp8_idct_dc_add4y)(uint8_t *dst, DCTELEM block[4][16], | 42 | void (*vp8_idct_dc_add4y)(uint8_t *dst, int16_t block[4][16], |
| 42 | ptrdiff_t stride); | 43 | ptrdiff_t stride); |
| 43 | void (*vp8_idct_dc_add4uv)(uint8_t *dst, DCTELEM block[4][16], | 44 | void (*vp8_idct_dc_add4uv)(uint8_t *dst, int16_t block[4][16], |
| 44 | ptrdiff_t stride); | 45 | ptrdiff_t stride); |
| 45 | 46 | ||
| 46 | // loop filter applied to edges between macroblocks | 47 | // loop filter applied to edges between macroblocks |
| @@ -48,7 +48,7 @@ av_cold void ff_wmv2_common_init(Wmv2Context * w){ · 47 unmodified lines | |||
| 48 | s->dsp.idct = NULL; | 48 | s->dsp.idct = NULL; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ | 51 | static void wmv2_add_block(Wmv2Context *w, int16_t *block1, uint8_t *dst, int stride, int n){ |
| 52 | MpegEncContext * const s= &w->s; | 52 | MpegEncContext * const s= &w->s; |
| 53 | 53 | ||
| 54 | if (s->block_last_index[n] >= 0) { | 54 | 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 · 17 unmodified lines | |||
| 72 | } | 72 | } |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){ | 75 | void ff_wmv2_add_mb(MpegEncContext *s, int16_t block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){ |
| 76 | Wmv2Context * const w= (Wmv2Context*)s; | 76 | Wmv2Context * const w= (Wmv2Context*)s; |
| 77 | 77 | ||
| 78 | wmv2_add_block(w, block1[0], dest_y , s->linesize, 0); | 78 | wmv2_add_block(w, block1[0], dest_y , s->linesize, 0); |
| @@ -52,7 +52,7 @@ typedef struct Wmv2Context{ · 51 unmodified lines | |||
| 52 | int hshift; | 52 | int hshift; |
| 53 | 53 | ||
| 54 | ScanTable abt_scantable[2]; | 54 | ScanTable abt_scantable[2]; |
| 55 | DECLARE_ALIGNED(16, DCTELEM, abt_block2)[6][64]; | 55 | DECLARE_ALIGNED(16, int16_t, abt_block2)[6][64]; |
| 56 | }Wmv2Context; | 56 | }Wmv2Context; |
| 57 | 57 | ||
| 58 | void ff_wmv2_common_init(Wmv2Context * w); | 58 | void ff_wmv2_common_init(Wmv2Context * w); |
| @@ -291,7 +291,7 @@ static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){ · 290 unmodified lines | |||
| 291 | return mot_val; | 291 | return mot_val; |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){ | 294 | static inline int wmv2_decode_inter_block(Wmv2Context *w, int16_t *block, int n, int cbp){ |
| 295 | MpegEncContext * const s= &w->s; | 295 | MpegEncContext * const s= &w->s; |
| 296 | static const int sub_cbp_table[3]= {2,3,1}; | 296 | static const int sub_cbp_table[3]= {2,3,1}; |
| 297 | int sub_cbp; | 297 | int sub_cbp; |
| @@ -331,7 +331,7 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, · 33 unmodified lines | |||
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | 333 | ||
| 334 | int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) | 334 | int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]) |
| 335 | { | 335 | { |
| 336 | Wmv2Context * const w= (Wmv2Context*)s; | 336 | Wmv2Context * const w= (Wmv2Context*)s; |
| 337 | int cbp, code, i; | 337 | int cbp, code, i; |
| @@ -19,6 +19,7 @@ · 18 unmodified lines | |||
| 19 | #include "libavutil/attributes.h" | 19 | #include "libavutil/attributes.h" |
| 20 | #include "libavutil/common.h" | 20 | #include "libavutil/common.h" |
| 21 | #include "avcodec.h" | 21 | #include "avcodec.h" |
| 22 | #include "dsputil.h" | ||
| 22 | #include "wmv2dsp.h" | 23 | #include "wmv2dsp.h" |
| 23 | 24 | ||
| 24 | #define W0 2048 | 25 | #define W0 2048 |
| @@ -91,7 +92,7 @@ static void wmv2_idct_col(short * b) · 66 unmodified lines | |||
| 91 | b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14; | 92 | b[8 * 7] = (a0 + a2 - a1 - a5 + (1 << 13)) >> 14; |
| 92 | } | 93 | } |
| 93 | 94 | ||
| 94 | static void wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block) | 95 | static void wmv2_idct_add_c(uint8_t *dest, int line_size, int16_t *block) |
| 95 | { | 96 | { |
| 96 | int i; | 97 | int i; |
| 97 | 98 | ||
| @@ -114,7 +115,7 @@ static void wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block) · 16 unmodified lines | |||
| 114 | } | 115 | } |
| 115 | } | 116 | } |
| 116 | 117 | ||
| 117 | static void wmv2_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block) | 118 | static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block) |
| 118 | { | 119 | { |
| 119 | int i; | 120 | int i; |
| 120 | 121 | ||
| @@ -20,11 +20,10 @@ · 19 unmodified lines | |||
| 20 | #define AVCODEC_WMV2DSP_H | 20 | #define AVCODEC_WMV2DSP_H |
| 21 | 21 | ||
| 22 | #include <stdint.h> | 22 | #include <stdint.h> |
| 23 | #include "dsputil.h" | ||
| 24 | 23 | ||
| 25 | typedef struct WMV2DSPContext { | 24 | typedef struct WMV2DSPContext { |
| 26 | void (*idct_add)(uint8_t *dest, int line_size, DCTELEM *block); | 25 | void (*idct_add)(uint8_t *dest, int line_size, int16_t *block); |
| 27 | void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block); | 26 | void (*idct_put)(uint8_t *dest, int line_size, int16_t *block); |
| 28 | 27 | ||
| 29 | int idct_perm; | 28 | int idct_perm; |
| 30 | } WMV2DSPContext; | 29 | } WMV2DSPContext; |
| @@ -148,7 +148,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) · 147 unmodified lines | |||
| 148 | * useless M$ crap features. It is duplicated here in case someone wants | 148 | * useless M$ crap features. It is duplicated here in case someone wants |
| 149 | * to add support for these crap features. */ | 149 | * to add support for these crap features. */ |
| 150 | void ff_wmv2_encode_mb(MpegEncContext * s, | 150 | void ff_wmv2_encode_mb(MpegEncContext * s, |
| 151 | DCTELEM block[6][64], | 151 | int16_t block[6][64], |
| 152 | int motion_x, int motion_y) | 152 | int motion_x, int motion_y) |
| 153 | { | 153 | { |
| 154 | Wmv2Context * const w= (Wmv2Context*)s; | 154 | Wmv2Context * const w= (Wmv2Context*)s; |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | |||
| 26 | 26 | ||
| 27 | #if HAVE_SSE2_INLINE | 27 | #if HAVE_SSE2_INLINE |
| 28 | 28 | ||
| 29 | static void get_pixels_8x4_sym_sse2(DCTELEM *block, const uint8_t *pixels, int line_size) | 29 | static void get_pixels_8x4_sym_sse2(int16_t *block, const uint8_t *pixels, int line_size) |
| 30 | { | 30 | { |
| 31 | __asm__ volatile( | 31 | __asm__ volatile( |
| 32 | "pxor %%xmm5, %%xmm5 \n\t" | 32 | "pxor %%xmm5, %%xmm5 \n\t" |
| @@ -225,10 +225,10 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 }; · 224 unmodified lines | |||
| 225 | /***********************************/ | 225 | /***********************************/ |
| 226 | /* standard MMX */ | 226 | /* standard MMX */ |
| 227 | 227 | ||
| 228 | void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, | 228 | void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, |
| 229 | int line_size) | 229 | int line_size) |
| 230 | { | 230 | { |
| 231 | const DCTELEM *p; | 231 | const int16_t *p; |
| 232 | uint8_t *pix; | 232 | uint8_t *pix; |
| 233 | 233 | ||
| 234 | /* read the pixels */ | 234 | /* read the pixels */ |
| @@ -300,7 +300,7 @@ void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, · 65 unmodified lines | |||
| 300 | "movq %%mm3, (%0, %3, 2) \n\t" \ | 300 | "movq %%mm3, (%0, %3, 2) \n\t" \ |
| 301 | "movq %%mm4, (%0, %1) \n\t" | 301 | "movq %%mm4, (%0, %1) \n\t" |
| 302 | 302 | ||
| 303 | void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, | 303 | void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, |
| 304 | int line_size) | 304 | int line_size) |
| 305 | { | 305 | { |
| 306 | x86_reg line_skip = line_size; | 306 | x86_reg line_skip = line_size; |
| @@ -317,10 +317,10 @@ void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, · 10 unmodified lines | |||
| 317 | : "memory"); | 317 | : "memory"); |
| 318 | } | 318 | } |
| 319 | 319 | ||
| 320 | void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, | 320 | void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, |
| 321 | int line_size) | 321 | int line_size) |
| 322 | { | 322 | { |
| 323 | const DCTELEM *p; | 323 | const int16_t *p; |
| 324 | uint8_t *pix; | 324 | uint8_t *pix; |
| 325 | int i; | 325 | int i; |
| 326 | 326 | ||
| @@ -422,7 +422,7 @@ static void put_pixels16_mmx(uint8_t *block, const uint8_t *pixels, · 95 unmodified lines | |||
| 422 | } | 422 | } |
| 423 | 423 | ||
| 424 | #define CLEAR_BLOCKS(name, n) \ | 424 | #define CLEAR_BLOCKS(name, n) \ |
| 425 | static void name(DCTELEM *blocks) \ | 425 | static void name(int16_t *blocks) \ |
| 426 | { \ | 426 | { \ |
| 427 | __asm__ volatile ( \ | 427 | __asm__ volatile ( \ |
| 428 | "pxor %%mm7, %%mm7 \n\t" \ | 428 | "pxor %%mm7, %%mm7 \n\t" \ |
| @@ -442,7 +442,7 @@ static void name(DCTELEM *blocks) \ · 13 unmodified lines | |||
| 442 | CLEAR_BLOCKS(clear_blocks_mmx, 6) | 442 | CLEAR_BLOCKS(clear_blocks_mmx, 6) |
| 443 | CLEAR_BLOCKS(clear_block_mmx, 1) | 443 | CLEAR_BLOCKS(clear_block_mmx, 1) |
| 444 | 444 | ||
| 445 | static void clear_block_sse(DCTELEM *block) | 445 | static void clear_block_sse(int16_t *block) |
| 446 | { | 446 | { |
| 447 | __asm__ volatile ( | 447 | __asm__ volatile ( |
| 448 | "xorps %%xmm0, %%xmm0 \n" | 448 | "xorps %%xmm0, %%xmm0 \n" |
| @@ -459,7 +459,7 @@ static void clear_block_sse(DCTELEM *block) · 10 unmodified lines | |||
| 459 | ); | 459 | ); |
| 460 | } | 460 | } |
| 461 | 461 | ||
| 462 | static void clear_blocks_sse(DCTELEM *blocks) | 462 | static void clear_blocks_sse(int16_t *blocks) |
| 463 | { | 463 | { |
| 464 | __asm__ volatile ( | 464 | __asm__ volatile ( |
| 465 | "xorps %%xmm0, %%xmm0 \n" | 465 | "xorps %%xmm0, %%xmm0 \n" |
| @@ -83,9 +83,9 @@ extern const double ff_pd_2[2]; · 82 unmodified lines | |||
| 83 | void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx); | 83 | void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx); |
| 84 | void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); | 84 | void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx); |
| 85 | 85 | ||
| 86 | void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); | 86 | void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); |
| 87 | void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); | 87 | void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); |
| 88 | void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size); | 88 | void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size); |
| 89 | 89 | ||
| 90 | void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); | 90 | void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); |
| 91 | void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); | 91 | void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride); |
| @@ -335,7 +335,7 @@ cglobal sse16, 5, 5, 8 · 334 unmodified lines | |||
| 335 | RET | 335 | RET |
| 336 | 336 | ||
| 337 | INIT_MMX mmx | 337 | INIT_MMX mmx |
| 338 | ; get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size) | 338 | ; get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size) |
| 339 | cglobal get_pixels, 3,4 | 339 | cglobal get_pixels, 3,4 |
| 340 | movsxdifnidn r2, r2d | 340 | movsxdifnidn r2, r2d |
| 341 | add r0, 128 | 341 | add r0, 128 |
| @@ -392,7 +392,7 @@ cglobal get_pixels, 3, 4 · 50 unmodified lines | |||
| 392 | RET | 392 | RET |
| 393 | 393 | ||
| 394 | INIT_MMX mmx | 394 | INIT_MMX mmx |
| 395 | ; diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const unint8_t *s2, stride) | 395 | ; diff_pixels_mmx(int16_t *block, const uint8_t *s1, const unint8_t *s2, stride) |
| 396 | cglobal diff_pixels, 4,5 | 396 | cglobal diff_pixels, 4,5 |
| 397 | movsxdifnidn r3, r3d | 397 | movsxdifnidn r3, r3d |
| 398 | pxor m7, m7 | 398 | pxor m7, m7 |
| @@ -30,9 +30,9 @@ · 29 unmodified lines | |||
| 30 | #include "libavcodec/mathops.h" | 30 | #include "libavcodec/mathops.h" |
| 31 | #include "dsputil_mmx.h" | 31 | #include "dsputil_mmx.h" |
| 32 | 32 | ||
| 33 | void ff_get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size); | 33 | void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size); |
| 34 | void ff_get_pixels_sse2(DCTELEM *block, const uint8_t *pixels, int line_size); | 34 | void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, int line_size); |
| 35 | void ff_diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride); | 35 | void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride); |
| 36 | int ff_pix_sum16_mmx(uint8_t * pix, int line_size); | 36 | int ff_pix_sum16_mmx(uint8_t * pix, int line_size); |
| 37 | int ff_pix_norm1_mmx(uint8_t *pix, int line_size); | 37 | int ff_pix_norm1_mmx(uint8_t *pix, int line_size); |
| 38 | 38 | ||
| @@ -797,7 +797,7 @@ static void sub_hfyu_median_prediction_mmxext(uint8_t *dst, const uint8_t *src1, · 758 unmodified lines | |||
| 797 | HSUM(%%xmm0, %%xmm1, %0) | 797 | HSUM(%%xmm0, %%xmm1, %0) |
| 798 | 798 | ||
| 799 | #define DCT_SAD_FUNC(cpu) \ | 799 | #define DCT_SAD_FUNC(cpu) \ |
| 800 | static int sum_abs_dctelem_##cpu(DCTELEM *block){\ | 800 | static int sum_abs_dctelem_##cpu(int16_t *block){\ |
| 801 | int sum;\ | 801 | int sum;\ |
| 802 | __asm__ volatile(\ | 802 | __asm__ volatile(\ |
| 803 | DCT_SAD\ | 803 | DCT_SAD\ |
| @@ -302,7 +302,7 @@ cglobal h264_idct8_dc_add_8, 3, 3, 0 · 301 unmodified lines | |||
| 302 | 302 | ||
| 303 | INIT_MMX mmx | 303 | INIT_MMX mmx |
| 304 | ; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset, | 304 | ; ff_h264_idct_add16_mmx(uint8_t *dst, const int *block_offset, |
| 305 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 305 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 306 | cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg | 306 | cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg |
| 307 | xor r5, r5 | 307 | xor r5, r5 |
| 308 | %ifdef PIC | 308 | %ifdef PIC |
| @@ -324,7 +324,7 @@ cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, · 15 unmodified lines | |||
| 324 | REP_RET | 324 | REP_RET |
| 325 | 325 | ||
| 326 | ; ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset, | 326 | ; ff_h264_idct8_add4_mmx(uint8_t *dst, const int *block_offset, |
| 327 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 327 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 328 | cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg | 328 | cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg |
| 329 | %assign pad 128+4-(stack_offset&7) | 329 | %assign pad 128+4-(stack_offset&7) |
| 330 | SUB rsp, pad | 330 | SUB rsp, pad |
| @@ -357,7 +357,7 @@ cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, · 26 unmodified lines | |||
| 357 | 357 | ||
| 358 | INIT_MMX mmxext | 358 | INIT_MMX mmxext |
| 359 | ; ff_h264_idct_add16_mmxext(uint8_t *dst, const int *block_offset, | 359 | ; ff_h264_idct_add16_mmxext(uint8_t *dst, const int *block_offset, |
| 360 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 360 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 361 | cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 361 | cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 362 | xor r5, r5 | 362 | xor r5, r5 |
| 363 | %ifdef PIC | 363 | %ifdef PIC |
| @@ -402,7 +402,7 @@ cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride · 38 unmodified lines | |||
| 402 | 402 | ||
| 403 | INIT_MMX mmx | 403 | INIT_MMX mmx |
| 404 | ; ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset, | 404 | ; ff_h264_idct_add16intra_mmx(uint8_t *dst, const int *block_offset, |
| 405 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 405 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 406 | cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg | 406 | cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg |
| 407 | xor r5, r5 | 407 | xor r5, r5 |
| 408 | %ifdef PIC | 408 | %ifdef PIC |
| @@ -426,7 +426,7 @@ cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, st · 17 unmodified lines | |||
| 426 | 426 | ||
| 427 | INIT_MMX mmxext | 427 | INIT_MMX mmxext |
| 428 | ; ff_h264_idct_add16intra_mmxext(uint8_t *dst, const int *block_offset, | 428 | ; ff_h264_idct_add16intra_mmxext(uint8_t *dst, const int *block_offset, |
| 429 | ; DCTELEM *block, int stride, | 429 | ; int16_t *block, int stride, |
| 430 | ; const uint8_t nnzc[6*8]) | 430 | ; const uint8_t nnzc[6*8]) |
| 431 | cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 431 | cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 432 | xor r5, r5 | 432 | xor r5, r5 |
| @@ -469,7 +469,7 @@ cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, s · 36 unmodified lines | |||
| 469 | REP_RET | 469 | REP_RET |
| 470 | 470 | ||
| 471 | ; ff_h264_idct8_add4_mmxext(uint8_t *dst, const int *block_offset, | 471 | ; ff_h264_idct8_add4_mmxext(uint8_t *dst, const int *block_offset, |
| 472 | ; DCTELEM *block, int stride, | 472 | ; int16_t *block, int stride, |
| 473 | ; const uint8_t nnzc[6*8]) | 473 | ; const uint8_t nnzc[6*8]) |
| 474 | cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 474 | cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 475 | %assign pad 128+4-(stack_offset&7) | 475 | %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 · 54 unmodified lines | |||
| 530 | 530 | ||
| 531 | INIT_XMM sse2 | 531 | INIT_XMM sse2 |
| 532 | ; ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, | 532 | ; ff_h264_idct8_add4_sse2(uint8_t *dst, const int *block_offset, |
| 533 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 533 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 534 | cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 534 | cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 535 | xor r5, r5 | 535 | xor r5, r5 |
| 536 | %ifdef PIC | 536 | %ifdef PIC |
| @@ -605,7 +605,7 @@ h264_idct_add8_mmx_plane: · 68 unmodified lines | |||
| 605 | rep ret | 605 | rep ret |
| 606 | 606 | ||
| 607 | ; ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset, | 607 | ; ff_h264_idct_add8_mmx(uint8_t **dest, const int *block_offset, |
| 608 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 608 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 609 | cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 609 | cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 610 | mov r5, 16 | 610 | mov r5, 16 |
| 611 | add r2, 512 | 611 | add r2, 512 |
| @@ -669,7 +669,7 @@ h264_idct_add8_mmxext_plane: · 57 unmodified lines | |||
| 669 | 669 | ||
| 670 | INIT_MMX mmxext | 670 | INIT_MMX mmxext |
| 671 | ; ff_h264_idct_add8_mmxext(uint8_t **dest, const int *block_offset, | 671 | ; ff_h264_idct_add8_mmxext(uint8_t **dest, const int *block_offset, |
| 672 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 672 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 673 | cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg | 673 | cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg |
| 674 | mov r5, 16 | 674 | mov r5, 16 |
| 675 | add r2, 512 | 675 | add r2, 512 |
| @@ -746,7 +746,7 @@ h264_add8x4_idct_sse2: · 70 unmodified lines | |||
| 746 | %endmacro | 746 | %endmacro |
| 747 | 747 | ||
| 748 | ; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, | 748 | ; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, |
| 749 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 749 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 750 | cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 | 750 | cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 |
| 751 | %if ARCH_X86_64 | 751 | %if ARCH_X86_64 |
| 752 | mov r5, r0 | 752 | mov r5, r0 |
| @@ -793,7 +793,7 @@ cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 · 40 unmodified lines | |||
| 793 | %endmacro | 793 | %endmacro |
| 794 | 794 | ||
| 795 | ; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, | 795 | ; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, |
| 796 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 796 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 797 | cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 | 797 | cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 |
| 798 | %if ARCH_X86_64 | 798 | %if ARCH_X86_64 |
| 799 | mov r7, r0 | 799 | mov r7, r0 |
| @@ -844,7 +844,7 @@ cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 · 44 unmodified lines | |||
| 844 | %endmacro | 844 | %endmacro |
| 845 | 845 | ||
| 846 | ; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, | 846 | ; ff_h264_idct_add8_sse2(uint8_t **dest, const int *block_offset, |
| 847 | ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) | 847 | ; int16_t *block, int stride, const uint8_t nnzc[6*8]) |
| 848 | cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8 | 848 | cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8 |
| 849 | add r2, 512 | 849 | add r2, 512 |
| 850 | %if ARCH_X86_64 | 850 | %if ARCH_X86_64 |
| @@ -861,7 +861,7 @@ cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8 · 10 unmodified lines | |||
| 861 | add8_sse2_cycle 3, 0x64 | 861 | add8_sse2_cycle 3, 0x64 |
| 862 | RET | 862 | RET |
| 863 | 863 | ||
| 864 | ;void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul) | 864 | ;void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul) |
| 865 | 865 | ||
| 866 | %macro WALSH4_1D 5 | 866 | %macro WALSH4_1D 5 |
| 867 | SUMSUB_BADC w, %4, %3, %2, %1, %5 | 867 | SUMSUB_BADC w, %4, %3, %2, %1, %5 |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | |||
| 20 | 20 | ||
| 21 | #include "libavutil/cpu.h" | 21 | #include "libavutil/cpu.h" |
| 22 | #include "libavutil/x86/cpu.h" | 22 | #include "libavutil/x86/cpu.h" |
| 23 | #include "libavcodec/avcodec.h" | ||
| 23 | #include "libavcodec/h264pred.h" | 24 | #include "libavcodec/h264pred.h" |
| 24 | 25 | ||
| 25 | #define PRED4x4(TYPE, DEPTH, OPT) \ | 26 | #define PRED4x4(TYPE, DEPTH, OPT) \ |
| @@ -48,7 +48,7 @@ IDCT_ADD_FUNC(8, 10, avx) · 47 unmodified lines | |||
| 48 | #define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \ | 48 | #define IDCT_ADD_REP_FUNC(NUM, REP, DEPTH, OPT) \ |
| 49 | void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ | 49 | void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ |
| 50 | (uint8_t *dst, const int *block_offset, \ | 50 | (uint8_t *dst, const int *block_offset, \ |
| 51 | DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); | 51 | int16_t *block, int stride, const uint8_t nnzc[6 * 8]); |
| 52 | 52 | ||
| 53 | IDCT_ADD_REP_FUNC(8, 4, 8, mmx) | 53 | IDCT_ADD_REP_FUNC(8, 4, 8, mmx) |
| 54 | IDCT_ADD_REP_FUNC(8, 4, 8, mmxext) | 54 | IDCT_ADD_REP_FUNC(8, 4, 8, mmxext) |
| @@ -70,7 +70,7 @@ IDCT_ADD_REP_FUNC(, 16intra, 10, avx) · 15 unmodified lines | |||
| 70 | #define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \ | 70 | #define IDCT_ADD_REP_FUNC2(NUM, REP, DEPTH, OPT) \ |
| 71 | void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ | 71 | void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \ |
| 72 | (uint8_t **dst, const int *block_offset, \ | 72 | (uint8_t **dst, const int *block_offset, \ |
| 73 | DCTELEM *block, int stride, const uint8_t nnzc[6 * 8]); | 73 | int16_t *block, int stride, const uint8_t nnzc[6 * 8]); |
| 74 | 74 | ||
| 75 | IDCT_ADD_REP_FUNC2(, 8, 8, mmx) | 75 | IDCT_ADD_REP_FUNC2(, 8, 8, mmx) |
| 76 | IDCT_ADD_REP_FUNC2(, 8, 8, mmxext) | 76 | IDCT_ADD_REP_FUNC2(, 8, 8, mmxext) |
| @@ -78,8 +78,8 @@ IDCT_ADD_REP_FUNC2(, 8, 8, sse2) · 1 unmodified line | |||
| 78 | IDCT_ADD_REP_FUNC2(, 8, 10, sse2) | 78 | IDCT_ADD_REP_FUNC2(, 8, 10, sse2) |
| 79 | IDCT_ADD_REP_FUNC2(, 8, 10, avx) | 79 | IDCT_ADD_REP_FUNC2(, 8, 10, avx) |
| 80 | 80 | ||
| 81 | void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul); | 81 | void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul); |
| 82 | void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul); | 82 | void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul); |
| 83 | 83 | ||
| 84 | /***********************************/ | 84 | /***********************************/ |
| 85 | /* deblocking */ | 85 | /* deblocking */ |
| @@ -531,25 +531,25 @@ __asm__ volatile( · 530 unmodified lines | |||
| 531 | :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16)); | 531 | :: "r"(block), "r"(rounder_0), "r"(tab_i_04_xmm), "r"(tg_1_16)); |
| 532 | } | 532 | } |
| 533 | 533 | ||
| 534 | void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block) | 534 | void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block) |
| 535 | { | 535 | { |
| 536 | ff_idct_xvid_mmx(block); | 536 | ff_idct_xvid_mmx(block); |
| 537 | ff_put_pixels_clamped_mmx(block, dest, line_size); | 537 | ff_put_pixels_clamped_mmx(block, dest, line_size); |
| 538 | } | 538 | } |
| 539 | 539 | ||
| 540 | void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block) | 540 | void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block) |
| 541 | { | 541 | { |
| 542 | ff_idct_xvid_mmx(block); | 542 | ff_idct_xvid_mmx(block); |
| 543 | ff_add_pixels_clamped_mmx(block, dest, line_size); | 543 | ff_add_pixels_clamped_mmx(block, dest, line_size); |
| 544 | } | 544 | } |
| 545 | 545 | ||
| 546 | void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block) | 546 | void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block) |
| 547 | { | 547 | { |
| 548 | ff_idct_xvid_mmxext(block); | 548 | ff_idct_xvid_mmxext(block); |
| 549 | ff_put_pixels_clamped_mmx(block, dest, line_size); | 549 | ff_put_pixels_clamped_mmx(block, dest, line_size); |
| 550 | } | 550 | } |
| 551 | 551 | ||
| 552 | void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block) | 552 | void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block) |
| 553 | { | 553 | { |
| 554 | ff_idct_xvid_mmxext(block); | 554 | ff_idct_xvid_mmxext(block); |
| 555 | ff_add_pixels_clamped_mmx(block, dest, line_size); | 555 | ff_add_pixels_clamped_mmx(block, dest, line_size); |
| @@ -28,15 +28,13 @@ · 27 unmodified lines | |||
| 28 | 28 | ||
| 29 | #include <stdint.h> | 29 | #include <stdint.h> |
| 30 | 30 | ||
| 31 | #include "libavcodec/dsputil.h" | ||
| 32 | |||
| 33 | void ff_idct_xvid_mmx(short *block); | 31 | void ff_idct_xvid_mmx(short *block); |
| 34 | void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block); | 32 | void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block); |
| 35 | void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block); | 33 | void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block); |
| 36 | 34 | ||
| 37 | void ff_idct_xvid_mmxext(short *block); | 35 | void ff_idct_xvid_mmxext(short *block); |
| 38 | void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block); | 36 | void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block); |
| 39 | void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block); | 37 | void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block); |
| 40 | 38 | ||
| 41 | void ff_idct_xvid_sse2(short *block); | 39 | void ff_idct_xvid_sse2(short *block); |
| 42 | void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block); | 40 | void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block); |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | |||
| 29 | #if HAVE_INLINE_ASM | 29 | #if HAVE_INLINE_ASM |
| 30 | 30 | ||
| 31 | static void dct_unquantize_h263_intra_mmx(MpegEncContext *s, | 31 | static void dct_unquantize_h263_intra_mmx(MpegEncContext *s, |
| 32 | DCTELEM *block, int n, int qscale) | 32 | int16_t *block, int n, int qscale) |
| 33 | { | 33 | { |
| 34 | x86_reg level, qmul, qadd, nCoeffs; | 34 | x86_reg level, qmul, qadd, nCoeffs; |
| 35 | 35 | ||
| @@ -104,7 +104,7 @@ __asm__ volatile( · 68 unmodified lines | |||
| 104 | 104 | ||
| 105 | 105 | ||
| 106 | static void dct_unquantize_h263_inter_mmx(MpegEncContext *s, | 106 | static void dct_unquantize_h263_inter_mmx(MpegEncContext *s, |
| 107 | DCTELEM *block, int n, int qscale) | 107 | int16_t *block, int n, int qscale) |
| 108 | { | 108 | { |
| 109 | x86_reg qmul, qadd, nCoeffs; | 109 | x86_reg qmul, qadd, nCoeffs; |
| 110 | 110 | ||
| @@ -195,7 +195,7 @@ __asm__ volatile( · 84 unmodified lines | |||
| 195 | high3 += tlow1 | 195 | high3 += tlow1 |
| 196 | */ | 196 | */ |
| 197 | static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s, | 197 | static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s, |
| 198 | DCTELEM *block, int n, int qscale) | 198 | int16_t *block, int n, int qscale) |
| 199 | { | 199 | { |
| 200 | x86_reg nCoeffs; | 200 | x86_reg nCoeffs; |
| 201 | const uint16_t *quant_matrix; | 201 | const uint16_t *quant_matrix; |
| @@ -264,7 +264,7 @@ __asm__ volatile( · 62 unmodified lines | |||
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s, | 266 | static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s, |
| 267 | DCTELEM *block, int n, int qscale) | 267 | int16_t *block, int n, int qscale) |
| 268 | { | 268 | { |
| 269 | x86_reg nCoeffs; | 269 | x86_reg nCoeffs; |
| 270 | const uint16_t *quant_matrix; | 270 | const uint16_t *quant_matrix; |
| @@ -330,7 +330,7 @@ __asm__ volatile( · 59 unmodified lines | |||
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s, | 332 | static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s, |
| 333 | DCTELEM *block, int n, int qscale) | 333 | int16_t *block, int n, int qscale) |
| 334 | { | 334 | { |
| 335 | x86_reg nCoeffs; | 335 | x86_reg nCoeffs; |
| 336 | const uint16_t *quant_matrix; | 336 | const uint16_t *quant_matrix; |
| @@ -396,7 +396,7 @@ __asm__ volatile( · 59 unmodified lines | |||
| 396 | } | 396 | } |
| 397 | 397 | ||
| 398 | static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s, | 398 | static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s, |
| 399 | DCTELEM *block, int n, int qscale) | 399 | int16_t *block, int n, int qscale) |
| 400 | { | 400 | { |
| 401 | x86_reg nCoeffs; | 401 | x86_reg nCoeffs; |
| 402 | const uint16_t *quant_matrix; | 402 | const uint16_t *quant_matrix; |
| @@ -472,7 +472,7 @@ __asm__ volatile( · 69 unmodified lines | |||
| 472 | ); | 472 | ); |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){ | 475 | static void denoise_dct_mmx(MpegEncContext *s, int16_t *block){ |
| 476 | const int intra= s->mb_intra; | 476 | const int intra= s->mb_intra; |
| 477 | int *sum= s->dct_error_sum[intra]; | 477 | int *sum= s->dct_error_sum[intra]; |
| 478 | uint16_t *offset= s->dct_offset[intra]; | 478 | uint16_t *offset= s->dct_offset[intra]; |
| @@ -526,7 +526,7 @@ static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){ · 47 unmodified lines | |||
| 526 | ); | 526 | ); |
| 527 | } | 527 | } |
| 528 | 528 | ||
| 529 | static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ | 529 | static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){ |
| 530 | const int intra= s->mb_intra; | 530 | const int intra= s->mb_intra; |
| 531 | int *sum= s->dct_error_sum[intra]; | 531 | int *sum= s->dct_error_sum[intra]; |
| 532 | uint16_t *offset= s->dct_offset[intra]; | 532 | uint16_t *offset= s->dct_offset[intra]; |
| @@ -92,7 +92,7 @@ · 91 unmodified lines | |||
| 92 | #endif | 92 | #endif |
| 93 | 93 | ||
| 94 | static int RENAME(dct_quantize)(MpegEncContext *s, | 94 | static int RENAME(dct_quantize)(MpegEncContext *s, |
| 95 | DCTELEM *block, int n, | 95 | int16_t *block, int n, |
| 96 | int qscale, int *overflow) | 96 | int qscale, int *overflow) |
| 97 | { | 97 | { |
| 98 | x86_reg last_non_zero_p1; | 98 | x86_reg last_non_zero_p1; |
| @@ -327,7 +327,7 @@ section .text align=16 · 326 unmodified lines | |||
| 327 | %endmacro | 327 | %endmacro |
| 328 | 328 | ||
| 329 | ; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride, | 329 | ; void prores_idct_put_10_<opt>(uint8_t *pixels, int stride, |
| 330 | ; DCTELEM *block, const int16_t *qmat); | 330 | ; int16_t *block, const int16_t *qmat); |
| 331 | %macro idct_put_fn 1 | 331 | %macro idct_put_fn 1 |
| 332 | cglobal prores_idct_put_10, 4, 4, %1 | 332 | cglobal prores_idct_put_10, 4, 4, %1 |
| 333 | movsxd r1, r1d | 333 | movsxd r1, r1d |
| @@ -21,14 +21,15 @@ · 20 unmodified lines | |||
| 21 | */ | 21 | */ |
| 22 | 22 | ||
| 23 | #include "libavutil/x86/cpu.h" | 23 | #include "libavutil/x86/cpu.h" |
| 24 | #include "libavcodec/dsputil.h" | ||
| 24 | #include "libavcodec/proresdsp.h" | 25 | #include "libavcodec/proresdsp.h" |
| 25 | 26 | ||
| 26 | void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, | 27 | void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, |
| 27 | DCTELEM *block, const int16_t *qmat); | 28 | int16_t *block, const int16_t *qmat); |
| 28 | void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize, | 29 | void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize, |
| 29 | DCTELEM *block, const int16_t *qmat); | 30 | int16_t *block, const int16_t *qmat); |
| 30 | void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize, | 31 | void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize, |
| 31 | DCTELEM *block, const int16_t *qmat); | 32 | int16_t *block, const int16_t *qmat); |
| 32 | 33 | ||
| 33 | void ff_proresdsp_x86_init(ProresDSPContext *dsp) | 34 | void ff_proresdsp_x86_init(ProresDSPContext *dsp) |
| 34 | { | 35 | { |
| @@ -133,7 +133,7 @@ cglobal rv34_idct_dc_add, 3, 3 · 132 unmodified lines | |||
| 133 | mova mm5, [pd_512] ; 0x200 | 133 | mova mm5, [pd_512] ; 0x200 |
| 134 | %endmacro | 134 | %endmacro |
| 135 | 135 | ||
| 136 | ; ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); | 136 | ; ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); |
| 137 | %macro COL_TRANSFORM 4 | 137 | %macro COL_TRANSFORM 4 |
| 138 | pshufw mm3, %2, 0xDD ; col. 1,3,1,3 | 138 | pshufw mm3, %2, 0xDD ; col. 1,3,1,3 |
| 139 | pshufw %2, %2, 0x88 ; col. 0,2,0,2 | 139 | pshufw %2, %2, 0x88 ; col. 0,2,0,2 |
| @@ -25,11 +25,11 @@ · 24 unmodified lines | |||
| 25 | #include "libavcodec/dsputil.h" | 25 | #include "libavcodec/dsputil.h" |
| 26 | #include "libavcodec/rv34dsp.h" | 26 | #include "libavcodec/rv34dsp.h" |
| 27 | 27 | ||
| 28 | void ff_rv34_idct_dc_mmxext(DCTELEM *block); | 28 | void ff_rv34_idct_dc_mmxext(int16_t *block); |
| 29 | void ff_rv34_idct_dc_noround_mmxext(DCTELEM *block); | 29 | void ff_rv34_idct_dc_noround_mmxext(int16_t *block); |
| 30 | void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc); | 30 | void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc); |
| 31 | void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc); | 31 | void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc); |
| 32 | void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, DCTELEM *block); | 32 | void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block); |
| 33 | 33 | ||
| 34 | av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp) | 34 | av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp) |
| 35 | { | 35 | { |
| @@ -1155,12 +1155,12 @@ void ff_simple_idct_mmx(int16_t *block) · 1154 unmodified lines | |||
| 1155 | 1155 | ||
| 1156 | //FIXME merge add/put into the idct | 1156 | //FIXME merge add/put into the idct |
| 1157 | 1157 | ||
| 1158 | void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block) | 1158 | void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block) |
| 1159 | { | 1159 | { |
| 1160 | idct(block); | 1160 | idct(block); |
| 1161 | ff_put_pixels_clamped_mmx(block, dest, line_size); | 1161 | ff_put_pixels_clamped_mmx(block, dest, line_size); |
| 1162 | } | 1162 | } |
| 1163 | void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block) | 1163 | void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block) |
| 1164 | { | 1164 | { |
| 1165 | idct(block); | 1165 | idct(block); |
| 1166 | ff_add_pixels_clamped_mmx(block, dest, line_size); | 1166 | ff_add_pixels_clamped_mmx(block, dest, line_size); |
| @@ -494,7 +494,7 @@ DECLARE_FUNCTION(3, 2) · 493 unmodified lines | |||
| 494 | DECLARE_FUNCTION(3, 3) | 494 | DECLARE_FUNCTION(3, 3) |
| 495 | 495 | ||
| 496 | static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, | 496 | static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, |
| 497 | DCTELEM *block) | 497 | int16_t *block) |
| 498 | { | 498 | { |
| 499 | int dc = block[0]; | 499 | int dc = block[0]; |
| 500 | dc = (17 * dc + 4) >> 3; | 500 | dc = (17 * dc + 4) >> 3; |
| @@ -533,7 +533,7 @@ static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize, · 32 unmodified lines | |||
| 533 | } | 533 | } |
| 534 | 534 | ||
| 535 | static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, | 535 | static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, |
| 536 | DCTELEM *block) | 536 | int16_t *block) |
| 537 | { | 537 | { |
| 538 | int dc = block[0]; | 538 | int dc = block[0]; |
| 539 | dc = (17 * dc + 4) >> 3; | 539 | dc = (17 * dc + 4) >> 3; |
| @@ -595,7 +595,7 @@ static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize, · 55 unmodified lines | |||
| 595 | } | 595 | } |
| 596 | 596 | ||
| 597 | static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, | 597 | static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, |
| 598 | DCTELEM *block) | 598 | int16_t *block) |
| 599 | { | 599 | { |
| 600 | int dc = block[0]; | 600 | int dc = block[0]; |
| 601 | dc = ( 3 * dc + 1) >> 1; | 601 | dc = ( 3 * dc + 1) >> 1; |
| @@ -634,7 +634,7 @@ static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize, · 32 unmodified lines | |||
| 634 | } | 634 | } |
| 635 | 635 | ||
| 636 | static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize, | 636 | static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize, |
| 637 | DCTELEM *block) | 637 | int16_t *block) |
| 638 | { | 638 | { |
| 639 | int dc = block[0]; | 639 | int dc = block[0]; |
| 640 | dc = (3 * dc + 1) >> 1; | 640 | dc = (3 * dc + 1) >> 1; |
| @@ -22,17 +22,18 @@ · 21 unmodified lines | |||
| 22 | #include "libavutil/cpu.h" | 22 | #include "libavutil/cpu.h" |
| 23 | #include "libavutil/x86/cpu.h" | 23 | #include "libavutil/x86/cpu.h" |
| 24 | #include "libavcodec/avcodec.h" | 24 | #include "libavcodec/avcodec.h" |
| 25 | #include "libavcodec/dsputil.h" | ||
| 25 | #include "libavcodec/vp3dsp.h" | 26 | #include "libavcodec/vp3dsp.h" |
| 26 | #include "config.h" | 27 | #include "config.h" |
| 27 | 28 | ||
| 28 | void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block); | 29 | void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block); |
| 29 | void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block); | 30 | void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block); |
| 30 | 31 | ||
| 31 | void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block); | 32 | void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, int16_t *block); |
| 32 | void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block); | 33 | void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, int16_t *block); |
| 33 | 34 | ||
| 34 | void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size, | 35 | void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size, |
| 35 | DCTELEM *block); | 36 | int16_t *block); |
| 36 | 37 | ||
| 37 | void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride, | 38 | void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride, |
| 38 | int *bounding_values); | 39 | int *bounding_values); |
| @@ -899,7 +899,7 @@ cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height · 898 unmodified lines | |||
| 899 | REP_RET | 899 | REP_RET |
| 900 | 900 | ||
| 901 | ;----------------------------------------------------------------------------- | 901 | ;----------------------------------------------------------------------------- |
| 902 | ; void vp8_idct_dc_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride); | 902 | ; void vp8_idct_dc_add_<opt>(uint8_t *dst, int16_t block[16], int stride); |
| 903 | ;----------------------------------------------------------------------------- | 903 | ;----------------------------------------------------------------------------- |
| 904 | 904 | ||
| 905 | %macro ADD_DC 4 | 905 | %macro ADD_DC 4 |
| @@ -977,7 +977,7 @@ cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride · 71 unmodified lines | |||
| 977 | RET | 977 | RET |
| 978 | 978 | ||
| 979 | ;----------------------------------------------------------------------------- | 979 | ;----------------------------------------------------------------------------- |
| 980 | ; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride); | 980 | ; void vp8_idct_dc_add4y_<opt>(uint8_t *dst, int16_t block[4][16], int stride); |
| 981 | ;----------------------------------------------------------------------------- | 981 | ;----------------------------------------------------------------------------- |
| 982 | 982 | ||
| 983 | %if ARCH_X86_32 | 983 | %if ARCH_X86_32 |
| @@ -1050,7 +1050,7 @@ cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride · 66 unmodified lines | |||
| 1050 | RET | 1050 | RET |
| 1051 | 1051 | ||
| 1052 | ;----------------------------------------------------------------------------- | 1052 | ;----------------------------------------------------------------------------- |
| 1053 | ; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, DCTELEM block[4][16], int stride); | 1053 | ; void vp8_idct_dc_add4uv_<opt>(uint8_t *dst, int16_t block[4][16], int stride); |
| 1054 | ;----------------------------------------------------------------------------- | 1054 | ;----------------------------------------------------------------------------- |
| 1055 | 1055 | ||
| 1056 | INIT_MMX mmx | 1056 | INIT_MMX mmx |
| @@ -1092,7 +1092,7 @@ cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride · 35 unmodified lines | |||
| 1092 | RET | 1092 | RET |
| 1093 | 1093 | ||
| 1094 | ;----------------------------------------------------------------------------- | 1094 | ;----------------------------------------------------------------------------- |
| 1095 | ; void vp8_idct_add_<opt>(uint8_t *dst, DCTELEM block[16], int stride); | 1095 | ; void vp8_idct_add_<opt>(uint8_t *dst, int16_t block[16], int stride); |
| 1096 | ;----------------------------------------------------------------------------- | 1096 | ;----------------------------------------------------------------------------- |
| 1097 | 1097 | ||
| 1098 | ; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2) | 1098 | ; calculate %1=mul_35468(%1)-mul_20091(%2); %2=mul_20091(%1)+mul_35468(%2) |
| @@ -1172,7 +1172,7 @@ INIT_MMX sse · 73 unmodified lines | |||
| 1172 | VP8_IDCT_ADD | 1172 | VP8_IDCT_ADD |
| 1173 | 1173 | ||
| 1174 | ;----------------------------------------------------------------------------- | 1174 | ;----------------------------------------------------------------------------- |
| 1175 | ; void vp8_luma_dc_wht_mmxext(DCTELEM block[4][4][16], DCTELEM dc[16]) | 1175 | ; void vp8_luma_dc_wht_mmxext(int16_t block[4][4][16], int16_t dc[16]) |
| 1176 | ;----------------------------------------------------------------------------- | 1176 | ;----------------------------------------------------------------------------- |
| 1177 | 1177 | ||
| 1178 | %macro SCATTER_WHT 3 | 1178 | %macro SCATTER_WHT 3 |
| @@ -230,21 +230,21 @@ HVBILIN(ssse3, 8, 4, 8) · 229 unmodified lines | |||
| 230 | HVBILIN(ssse3, 8, 8, 16) | 230 | HVBILIN(ssse3, 8, 8, 16) |
| 231 | HVBILIN(ssse3, 8, 16, 16) | 231 | HVBILIN(ssse3, 8, 16, 16) |
| 232 | 232 | ||
| 233 | extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16], | 233 | extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16], |
| 234 | ptrdiff_t stride); | 234 | ptrdiff_t stride); |
| 235 | extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16], | 235 | extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16], |
| 236 | ptrdiff_t stride); | 236 | ptrdiff_t stride); |
| 237 | extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16], | 237 | extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16], |
| 238 | ptrdiff_t stride); | 238 | ptrdiff_t stride); |
| 239 | extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16], | 239 | extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16], |
| 240 | ptrdiff_t stride); | 240 | ptrdiff_t stride); |
| 241 | extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16], | 241 | extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16], |
| 242 | ptrdiff_t stride); | 242 | ptrdiff_t stride); |
| 243 | extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]); | 243 | extern void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]); |
| 244 | extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]); | 244 | extern void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]); |
| 245 | extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16], | 245 | extern void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16], |
| 246 | ptrdiff_t stride); | 246 | ptrdiff_t stride); |
| 247 | extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16], | 247 | extern void ff_vp8_idct_add_sse(uint8_t *dst, int16_t block[16], |
| 248 | ptrdiff_t stride); | 248 | ptrdiff_t stride); |
| 249 | 249 | ||
| 250 | #define DECLARE_LOOP_FILTER(NAME)\ | 250 | #define DECLARE_LOOP_FILTER(NAME)\ |
| @@ -173,7 +173,7 @@ vertical align = · 172 unmodified lines | |||
| 173 | /* and * align | 173 | /* and * align |
| 174 | arrays fitting in smaller types | 174 | arrays fitting in smaller types |
| 175 | variables written to twice with no interspaced read | 175 | variables written to twice with no interspaced read |
| 176 | memset(block, 0, 6*64*sizeof(DCTELEM)); -> clear_blocks | 176 | memset(block, 0, 6*64*sizeof(int16_t)); -> clear_blocks |
| 177 | check existence of long_name in AVCodec | 177 | check existence of long_name in AVCodec |
| 178 | check that the patch does not touch codec & (de)muxer layer at the same time ->split | 178 | check that the patch does not touch codec & (de)muxer layer at the same time ->split |
| 179 | 179 | ||