History

Drop DCTELEM typedef

It does not help as an abstraction and adds dsputil dependencies.

Diego Biurrun committed 13 years ago

Commit 88bd7fd1 parent 2e4bb99163 files · +835 −812Browse files

Unified · Split

163 files
  1. doc/optimization.txt +1 −1
  2. libavcodec/4xm.c +5 −5
  3. libavcodec/alpha/dsputil_alpha.c +6 −6
  4. libavcodec/alpha/dsputil_alpha.h +10 −10
  5. libavcodec/alpha/dsputil_alpha_asm.S +2 −2
  6. libavcodec/alpha/motion_est_alpha.c +2 −2
  7. libavcodec/alpha/mpegvideo_alpha.c +4 −4
  8. libavcodec/alpha/simple_idct_alpha.c +6 −6
  9. libavcodec/arm/dsputil_init_arm.c +9 −9
  10. libavcodec/arm/dsputil_init_armv5te.c +3 −3
  11. libavcodec/arm/dsputil_init_armv6.c +6 −6
  12. libavcodec/arm/dsputil_init_neon.c +8 −8
  13. libavcodec/arm/h264dsp_init_arm.c +8 −8
  14. libavcodec/arm/jrevdct_arm.S +1 −1
  15. libavcodec/arm/mpegvideo_arm.c +2 −2
  16. libavcodec/arm/mpegvideo_armv5te.c +4 −4
  17. libavcodec/arm/rv34dsp_init_arm.c +3 −3
  18. libavcodec/arm/rv34dsp_neon.S +3 −3
  19. libavcodec/arm/simple_idct_armv6.S +3 −3
  20. libavcodec/arm/simple_idct_neon.S +3 −3
  21. libavcodec/arm/vp3dsp_init_arm.c +3 −3
  22. libavcodec/arm/vp8.h +1 −1
  23. libavcodec/arm/vp8dsp_armv6.S +6 −6
  24. libavcodec/arm/vp8dsp_init_armv6.c +6 −6
  25. libavcodec/arm/vp8dsp_init_neon.c +5 −5
  26. libavcodec/asv.h +1 −1
  27. libavcodec/asvdec.c +4 −4
  28. libavcodec/asvenc.c +4 −4
  29. libavcodec/bfin/config_bfin.h +1 −1
  30. libavcodec/bfin/dsputil_bfin.c +3 −3
  31. libavcodec/bfin/dsputil_bfin.h +11 −10
  32. libavcodec/bfin/fdct_bfin.S +4 −4
  33. libavcodec/bfin/idct_bfin.S +2 −2
  34. libavcodec/bfin/mpegvideo_bfin.c +1 −1
  35. libavcodec/bfin/pixels_bfin.S +4 −4
  36. libavcodec/bfin/vp3_bfin.c +2 −2
  37. libavcodec/bfin/vp3_idct_bfin.S +2 −2
  38. libavcodec/bink.c +3 −3
  39. libavcodec/cavs.c +1 −1
  40. libavcodec/cavs.h +1 −1
  41. libavcodec/cavsdec.c +4 −4
  42. libavcodec/cavsdsp.c +2 −2
  43. libavcodec/cavsdsp.h +1 −1
  44. libavcodec/dct-test.c +16 −15
  45. libavcodec/dnxhddec.c +7 −7
  46. libavcodec/dnxhdenc.c +10 −10
  47. libavcodec/dnxhdenc.h +2 −2
  48. libavcodec/dsputil.c +17 −17
  49. libavcodec/dsputil.h +45 −46
  50. libavcodec/dsputil_template.c +7 −7
  51. libavcodec/dv.c +2 −2
  52. libavcodec/dvdata.h +3 −3
  53. libavcodec/dvdec.c +4 −4
  54. libavcodec/eaidct.c +3 −3
  55. libavcodec/eaidct.h +1 −2
  56. libavcodec/eamad.c +3 −3
  57. libavcodec/eatgq.c +3 −3
  58. libavcodec/eatqi.c +3 −3
  59. libavcodec/faandct.c +3 −3
  60. libavcodec/faandct.h +3 −3
  61. libavcodec/faanidct.c +4 −4
  62. libavcodec/faanidct.h +3 −4
  63. libavcodec/h261dec.c +2 −2
  64. libavcodec/h261enc.c +4 −4
  65. libavcodec/h263.c +1 −1
  66. libavcodec/h263.h +4 −4
  67. libavcodec/h264.c +5 −5
  68. libavcodec/h264.h +3 −4
  69. libavcodec/h264_cabac.c +28 −8
  70. libavcodec/h264_cavlc.c +3 −3
  71. libavcodec/h264_mb_template.c +1 −1
  72. libavcodec/h264dsp.h +11 −13
  73. libavcodec/h264idct_template.c +12 −12
  74. libavcodec/h264pred.h +6 −6
  75. libavcodec/h264pred_template.c +10 −10
  76. libavcodec/ituh263dec.c +3 −3
  77. libavcodec/ituh263enc.c +2 −2
  78. libavcodec/jfdctfst.c +9 −9
  79. libavcodec/jfdctint_template.c +14 −14
  80. libavcodec/jrevdct.c +19 −19
  81. libavcodec/mdec.c +4 −4
  82. libavcodec/mimic.c +2 −2
  83. libavcodec/mjpegdec.c +6 −6
  84. libavcodec/mjpegdec.h +2 −2
  85. libavcodec/mjpegenc.c +2 −2
  86. libavcodec/mjpegenc.h +3 −2
  87. libavcodec/mpeg12.c +10 −10
  88. libavcodec/mpeg12.h +1 −1
  89. libavcodec/mpeg12enc.c +4 −4
  90. libavcodec/mpeg4video.h +2 −2
  91. libavcodec/mpeg4videodec.c +4 −4
  92. libavcodec/mpeg4videoenc.c +8 −8
  93. libavcodec/mpegvideo.c +22 −22
  94. libavcodec/mpegvideo.h +25 −25
  95. libavcodec/mpegvideo_enc.c +17 −17
  96. libavcodec/mpegvideo_xvmc.c +1 −1
  97. libavcodec/msmpeg4.c +3 −3
  98. libavcodec/msmpeg4.h +3 −4
  99. libavcodec/msmpeg4enc.c +2 −2
  100. libavcodec/ppc/dsputil_altivec.c +3 −3
  101. libavcodec/ppc/dsputil_ppc.c +7 −7
  102. libavcodec/ppc/h264_altivec.c +9 −9
  103. libavcodec/ppc/mpegvideo_altivec.c +1 −1
  104. libavcodec/ppc/vc1dsp_altivec.c +2 −2
  105. libavcodec/ppc/vp3dsp_altivec.c +2 −2
  106. libavcodec/proresdec.c +6 −5
  107. libavcodec/proresdsp.c +4 −3
  108. libavcodec/proresdsp.h +3 −3
  109. libavcodec/proresenc.c +9 −8
  110. libavcodec/rtjpeg.c +3 −3
  111. libavcodec/rtjpeg.h +1 −1
  112. libavcodec/rv34.c +10 −10
  113. libavcodec/rv34dsp.c +6 −6
  114. libavcodec/rv34dsp.h +2 −2
  115. libavcodec/sh4/dsputil_sh4.c +4 −4
  116. libavcodec/sh4/dsputil_sh4.h +1 −1
  117. libavcodec/sh4/idct_sh4.c +1 −1
  118. libavcodec/simple_idct.c +9 −9
  119. libavcodec/simple_idct.h +11 −12
  120. libavcodec/simple_idct_template.c +7 −7
  121. libavcodec/sparc/dsputil_vis.h +3 −4
  122. libavcodec/sparc/simple_idct_vis.c +3 −3
  123. libavcodec/svq3.c +3 −3
  124. libavcodec/vc1.h +1 −1
  125. libavcodec/vc1dec.c +5 −5
  126. libavcodec/vc1dsp.c +14 −14
  127. libavcodec/vc1dsp.h +10 −10
  128. libavcodec/vp3.c +4 −4
  129. libavcodec/vp3dsp.c +8 −3
  130. libavcodec/vp3dsp.h +3 −4
  131. libavcodec/vp56.h +3 −3
  132. libavcodec/vp8.c +2 −2
  133. libavcodec/vp8.h +2 −2
  134. libavcodec/vp8dsp.c +7 −7
  135. libavcodec/vp8dsp.h +8 −7
  136. libavcodec/wmv2.c +2 −2
  137. libavcodec/wmv2.h +1 −1
  138. libavcodec/wmv2dec.c +2 −2
  139. libavcodec/wmv2dsp.c +3 −2
  140. libavcodec/wmv2dsp.h +2 −3
  141. libavcodec/wmv2enc.c +1 −1
  142. libavcodec/x86/dnxhdenc.c +1 −1
  143. libavcodec/x86/dsputil_mmx.c +8 −8
  144. libavcodec/x86/dsputil_mmx.h +3 −3
  145. libavcodec/x86/dsputilenc.asm +2 −2
  146. libavcodec/x86/dsputilenc_mmx.c +4 −4
  147. libavcodec/x86/h264_idct.asm +13 −13
  148. libavcodec/x86/h264_intrapred_init.c +1 −0
  149. libavcodec/x86/h264dsp_init.c +4 −4
  150. libavcodec/x86/idct_mmx_xvid.c +4 −4
  151. libavcodec/x86/idct_xvid.h +4 −6
  152. libavcodec/x86/mpegvideo.c +8 −8
  153. libavcodec/x86/mpegvideoenc_template.c +1 −1
  154. libavcodec/x86/proresdsp.asm +1 −1
  155. libavcodec/x86/proresdsp_init.c +4 −3
  156. libavcodec/x86/rv34dsp.asm +1 −1
  157. libavcodec/x86/rv34dsp_init.c +3 −3
  158. libavcodec/x86/simple_idct.c +2 −2
  159. libavcodec/x86/vc1dsp_mmx.c +4 −4
  160. libavcodec/x86/vp3dsp_init.c +6 −5
  161. libavcodec/x86/vp8dsp.asm +5 −5
  162. libavcodec/x86/vp8dsp_init.c +9 −9
  163. tools/patcheck +1 −1
doc/optimization.txt+1−1
@@ -148,7 +148,7 @@ Alignment: · 147 unmodified lines
148Some instructions on some architectures have strict alignment restrictions,148Some instructions on some architectures have strict alignment restrictions,
149for example most SSE/SSE2 instructions on x86.149for example most SSE/SSE2 instructions on x86.
150The minimum guaranteed alignment is written in the .h files, for example:150The 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
154General Tips:154General Tips:
libavcodec/4xm.c+5−5
@@ -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
157static void idct(DCTELEM block[64])157static 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 */
454static int decode_i_block(FourXContext *f, DCTELEM *block)454static 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
497static inline void idct_put(FourXContext *f, int x, int y)497static 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 optimize521 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];
libavcodec/alpha/dsputil_alpha.c+6−6
@@ -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
26void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,26void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
27 int line_size);27 int line_size);
28void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,28void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
29 int line_size);29 int line_size);
30 30
31#if 031#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. */
34static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,34static 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
58void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,58void 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#endif101#endif
102 102
103static void clear_blocks_axp(DCTELEM *blocks) {103static 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;
libavcodec/alpha/dsputil_alpha.h+10−10
@@ -19,26 +19,26 @@ · 18 unmodified lines
19#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H19#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
20#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H20#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
21 21
22#include "libavcodec/dsputil.h"22#include <stdint.h>
23 23
24void ff_simple_idct_axp(DCTELEM *block);24void ff_simple_idct_axp(int16_t *block);
25void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);25void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
26void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);26void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
27 27
28void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,28void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
29 int line_size, int h);29 int line_size, int h);
30void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,30void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
31 int line_size);31 int line_size);
32void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,32void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
33 int line_size);33 int line_size);
34extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,34extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
35 int line_size);35 int line_size);
36extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,36extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
37 int line_size);37 int line_size);
38 38
39void get_pixels_mvi(DCTELEM *restrict block,39void 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);
41void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,41void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
42 int stride);42 int stride);
43int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);43int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
44int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);44int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
libavcodec/alpha/dsputil_alpha_asm.S+2−2
@@ -135,7 +135,7 @@ $aligned: · 134 unmodified lines
135 .end put_pixels_axp_asm135 .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 6141 .align 6
@@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm: · 43 unmodified lines
185 .end put_pixels_clamped_mvi_asm185 .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 6191 .align 6
libavcodec/alpha/motion_est_alpha.c+2−2
@@ -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
26void get_pixels_mvi(DCTELEM *restrict block,26void 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
43void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,43void 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;
libavcodec/alpha/mpegvideo_alpha.c+4−4
@@ -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
26static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,26static 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
72static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,72static 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
99static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,99static 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]];
libavcodec/alpha/simple_idct_alpha.c+6−6
@@ -44,7 +44,7 @@ · 43 unmodified lines
44#define COL_SHIFT 2044#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 */
47static inline int idct_row(DCTELEM *row)47static 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
155static inline void idct_col(DCTELEM *col)155static 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. */
232static inline void idct_col2(DCTELEM *col)232static 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
254void ff_simple_idct_axp(DCTELEM *block)254void 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
294void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)294void 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
300void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)300void 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);
libavcodec/arm/dsputil_init_arm.c+9−9
@@ -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
26void ff_j_rev_dct_arm(DCTELEM *data);26void ff_j_rev_dct_arm(int16_t *data);
27void ff_simple_idct_arm(DCTELEM *data);27void ff_simple_idct_arm(int16_t *data);
28 28
29/* XXX: local hack */29/* XXX: local hack */
30static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);30static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
31static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);31static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
32 32
33void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);33void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
34void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);34void 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
48CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)48CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
49CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)49CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
50 50
51void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,51void 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 are54/* XXX: those functions should be suppressed ASAP when all IDCTs are
55 converted */55 converted */
56static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)56static 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}
61static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)61static 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}
66static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)66static 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}
71static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)71static 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);
libavcodec/arm/dsputil_init_armv5te.c+3−3
@@ -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
24void ff_simple_idct_armv5te(DCTELEM *data);24void ff_simple_idct_armv5te(int16_t *data);
25void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data);25void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
26void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data);26void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
27 27
28av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)28av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
29{29{
libavcodec/arm/dsputil_init_armv6.c+6−6
@@ -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
27void ff_simple_idct_armv6(DCTELEM *data);27void ff_simple_idct_armv6(int16_t *data);
28void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);28void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
29void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);29void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
30 30
31void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int);31void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
32void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int);32void 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
47void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int);47void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
48 48
49void ff_add_pixels_clamped_armv6(const DCTELEM *block,49void 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
53void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride);53void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
54void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1,54void 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
57int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,57int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,
libavcodec/arm/dsputil_init_neon.c+8−8
@@ -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
28void ff_simple_idct_neon(DCTELEM *data);28void ff_simple_idct_neon(int16_t *data);
29void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);29void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
30void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);30void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
31 31
32void ff_clear_block_neon(DCTELEM *block);32void ff_clear_block_neon(int16_t *block);
33void ff_clear_blocks_neon(DCTELEM *blocks);33void ff_clear_blocks_neon(int16_t *blocks);
34 34
35void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int);35void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int);
36void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int);36void 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
62void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);62void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
63void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);63void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
64 64
65void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);65void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int);
66void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);66void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
67void ff_put_signed_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);67void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
68 68
69void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);69void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);
70void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);70void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);
libavcodec/arm/h264dsp_init_arm.c+8−8
@@ -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
53void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride);53void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
54void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);54void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
55void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,55void 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]);
58void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,58void 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]);
61void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,61void 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
65void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride);65void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
66void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);66void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
67void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,67void 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
71static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)71static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
libavcodec/arm/jrevdct_arm.S+1−1
@@ -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 068 @ 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]
libavcodec/arm/mpegvideo_arm.c+2−2
@@ -34,9 +34,9 @@ CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END); · 33 unmodified lines
34CHK_OFFS(MpegEncContext, h263_aic, H263_AIC);34CHK_OFFS(MpegEncContext, h263_aic, H263_AIC);
35#endif35#endif
36 36
37void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block,37void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
38 int n, int qscale);38 int n, int qscale);
39void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block,39void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block,
40 int n, int qscale);40 int n, int qscale);
41 41
42void ff_MPV_common_init_arm(MpegEncContext *s)42void ff_MPV_common_init_arm(MpegEncContext *s)
libavcodec/arm/mpegvideo_armv5te.c+4−4
@@ -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
27void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count);27void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count);
28 28
29#ifdef ENABLE_ARM_TESTS29#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 reference32 * have optimized implementations for each architecture. Is also used as a reference
33 * implementation in regression tests33 * implementation in regression tests
34 */34 */
35static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)35static 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#endif50#endif
51 51
52static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,52static 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
81static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,81static 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;
libavcodec/arm/rv34dsp_init_arm.c+3−3
@@ -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
27void ff_rv34_inv_transform_noround_neon(DCTELEM *block);27void ff_rv34_inv_transform_noround_neon(int16_t *block);
28 28
29void ff_rv34_inv_transform_noround_dc_neon(DCTELEM *block);29void ff_rv34_inv_transform_noround_dc_neon(int16_t *block);
30 30
31void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, DCTELEM *block);31void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block);
32void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc);32void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc);
33 33
34void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp)34void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp)
libavcodec/arm/rv34dsp_neon.S+3−3
@@ -67,7 +67,7 @@ · 66 unmodified lines
67 vsub.s32 q15, q14, q9 @ z0 - z367 vsub.s32 q15, q14, q9 @ z0 - z3
68.endm68.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) */
71function ff_rv34_idct_add_neon, export=171function ff_rv34_idct_add_neon, export=1
72 mov r3, r072 mov r3, r0
73 rv34_inv_transform r273 rv34_inv_transform r2
@@ -97,7 +97,7 @@ function ff_rv34_idct_add_neon, export=1 · 23 unmodified lines
97 bx lr97 bx lr
98endfunc98endfunc
99 99
100/* void rv34_inv_transform_noround_neon(DCTELEM *block); */100/* void rv34_inv_transform_noround_neon(int16_t *block); */
101function ff_rv34_inv_transform_noround_neon, export=1101function ff_rv34_inv_transform_noround_neon, export=1
102 rv34_inv_transform r0102 rv34_inv_transform r0
103 vshl.s32 q11, q2, #1103 vshl.s32 q11, q2, #1
@@ -142,7 +142,7 @@ function ff_rv34_idct_dc_add_neon, export=1 · 38 unmodified lines
142 bx lr142 bx lr
143endfunc143endfunc
144 144
145/* void rv34_inv_transform_dc_noround_c(DCTELEM *block) */145/* void rv34_inv_transform_dc_noround_c(int16_t *block) */
146function ff_rv34_inv_transform_noround_dc_neon, export=1146function 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, #251148 vmov.i16 d4, #251
libavcodec/arm/simple_idct_armv6.S+3−3
@@ -375,7 +375,7 @@ endfunc · 374 unmodified lines
375 sub r0, r0, #(16*7)375 sub r0, r0, #(16*7)
376 .endm376 .endm
377 377
378/* void ff_simple_idct_armv6(DCTELEM *data); */378/* void ff_simple_idct_armv6(int16_t *data); */
379function ff_simple_idct_armv6, export=1379function ff_simple_idct_armv6, export=1
380 push {r4-r11, lr}380 push {r4-r11, lr}
381 sub sp, sp, #128381 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}
391endfunc391endfunc
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); */
394function ff_simple_idct_add_armv6, export=1394function 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, #128396 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}
408endfunc408endfunc
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); */
411function ff_simple_idct_put_armv6, export=1411function 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, #128413 sub sp, sp, #128
libavcodec/arm/simple_idct_neon.S+3−3
@@ -261,7 +261,7 @@ endconst · 260 unmodified lines
261 pop {r4-r7, pc}261 pop {r4-r7, pc}
262 .endm262 .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); */
265function ff_simple_idct_put_neon, export=1265function ff_simple_idct_put_neon, export=1
266 idct_start r2266 idct_start r2
267 267
@@ -316,7 +316,7 @@ function idct_col4_add8_neon · 48 unmodified lines
316 bx lr316 bx lr
317endfunc317endfunc
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); */
320function ff_simple_idct_add_neon, export=1320function ff_simple_idct_add_neon, export=1
321 idct_start r2321 idct_start r2
322 322
@@ -355,7 +355,7 @@ function idct_col4_st16_neon · 32 unmodified lines
355 bx lr355 bx lr
356endfunc356endfunc
357 357
358/* void ff_simple_idct_neon(DCTELEM *data); */358/* void ff_simple_idct_neon(int16_t *data); */
359function ff_simple_idct_neon, export=1359function ff_simple_idct_neon, export=1
360 idct_start r0360 idct_start r0
361 361
libavcodec/arm/vp3dsp_init_arm.c+3−3
@@ -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
27void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);27void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
28void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);28void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
29void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data);29void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data);
30 30
31void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);31void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
32void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);32void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
libavcodec/arm/vp8.h+1−1
@@ -23,7 +23,7 @@ · 22 unmodified lines
23 23
24#if HAVE_ARMV6_EXTERNAL24#if HAVE_ARMV6_EXTERNAL
25#define decode_block_coeffs_internal ff_decode_block_coeffs_armv625#define decode_block_coeffs_internal ff_decode_block_coeffs_armv6
26int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, DCTELEM block[16],26int 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#endif29#endif
libavcodec/arm/vp8dsp_armv6.S+6−6
@@ -56,7 +56,7 @@ · 55 unmodified lines
56 56
57@ idct57@ 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])
60function ff_vp8_luma_dc_wht_armv6, export=160function 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}
180endfunc180endfunc
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])
183function ff_vp8_luma_dc_wht_dc_armv6, export=1183function ff_vp8_luma_dc_wht_dc_armv6, export=1
184 ldrsh r2, [r1]184 ldrsh r2, [r1]
185 mov r3, #0185 mov r3, #0
@@ -192,7 +192,7 @@ function ff_vp8_luma_dc_wht_dc_armv6, export=1 · 6 unmodified lines
192 bx lr192 bx lr
193endfunc193endfunc
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)
196function ff_vp8_idct_add_armv6, export=1196function ff_vp8_idct_add_armv6, export=1
197 push {r4-r12, lr}197 push {r4-r12, lr}
198 sub sp, sp, #32198 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}
315endfunc315endfunc
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)
318function ff_vp8_idct_dc_add_armv6, export=1318function ff_vp8_idct_dc_add_armv6, export=1
319 push {r4-r6, lr}319 push {r4-r6, lr}
320 add r6, r0, r2, lsl #1320 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}
356endfunc356endfunc
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)
359function ff_vp8_idct_dc_add4uv_armv6, export=1359function 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}
372endfunc372endfunc
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)
375function ff_vp8_idct_dc_add4y_armv6, export=1375function ff_vp8_idct_dc_add4y_armv6, export=1
376 push {r4, lr}376 push {r4, lr}
377 377
libavcodec/arm/vp8dsp_init_armv6.c+6−6
@@ -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
25void ff_vp8_luma_dc_wht_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]);25void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]);
26void ff_vp8_luma_dc_wht_dc_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]);26void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]);
27 27
28void ff_vp8_idct_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);28void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
29void ff_vp8_idct_dc_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);29void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
30void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);30void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
31void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);31void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
32 32
33VP8_LF(armv6);33VP8_LF(armv6);
34 34
libavcodec/arm/vp8dsp_init_neon.c+5−5
@@ -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
25void ff_vp8_luma_dc_wht_neon(DCTELEM block[4][4][16], DCTELEM dc[16]);25void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]);
26 26
27void ff_vp8_idct_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);27void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
28void ff_vp8_idct_dc_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);28void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
29void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);29void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
30void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);30void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
31 31
32VP8_LF(neon);32VP8_LF(neon);
33 33
libavcodec/asv.h+1−1
@@ -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;
libavcodec/asvdec.c+4−4
@@ -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
100static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64])100static 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
131static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64])131static 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
167static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64])167static 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
187static inline void idct_put(ASV1Context *a, int mb_x, int mb_y)187static 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;
libavcodec/asvenc.c+4−4
@@ -55,7 +55,7 @@ static inline void asv2_put_level(PutBitContext *pb, int level){ · 54 unmodified lines
55 }55 }
56}56}
57 57
58static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){58static 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
91static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){91static 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
132static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){132static 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
150static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){150static 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
libavcodec/bfin/config_bfin.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
21 low level assembler interface wrapper21 low level assembler interface wrapper
22 22
23DEFUN(put_pixels_clamped,mL1,23DEFUN(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 body26 body
27 27
libavcodec/bfin/dsputil_bfin.c+3−3
@@ -27,20 +27,20 @@ · 26 unmodified lines
27 27
28int off;28int off;
29 29
30static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block)30static 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
36static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block)36static 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
43static void bfin_clear_blocks (DCTELEM *blocks)43static 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 //
libavcodec/bfin/dsputil_bfin.h+11−10
@@ -24,8 +24,9 @@ · 23 unmodified lines
24#ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H24#ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H
25#define AVCODEC_BFIN_DSPUTIL_BFIN_H25#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_SRAM31#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_b36#define attribute_l1_data_b
36#endif37#endif
37 38
38void ff_bfin_idct (DCTELEM *block) attribute_l1_text;39void ff_bfin_idct (int16_t *block) attribute_l1_text;
39void ff_bfin_fdct (DCTELEM *block) attribute_l1_text;40void ff_bfin_fdct (int16_t *block) attribute_l1_text;
40void ff_bfin_vp3_idct (DCTELEM *block);41void ff_bfin_vp3_idct (int16_t *block);
41void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block);42void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block);
42void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block);43void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block);
43void ff_bfin_add_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;44void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
44void ff_bfin_put_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;45void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
45void ff_bfin_diff_pixels (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;46void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;
46void ff_bfin_get_pixels (DCTELEM *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;47void ff_bfin_get_pixels (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
47int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;48int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;
48int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;49int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
49int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;50int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
libavcodec/bfin/fdct_bfin.S+4−4
@@ -20,7 +20,7 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * 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 input25 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 data26 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 *block64 Input - r0 - pointer to start of int16_t *block
65 65
66 Output - The DCT output coefficients in the DCTELEM *block66 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.text146.text
147DEFUN(fdct,mL1,147DEFUN(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;
libavcodec/bfin/idct_bfin.S+2−2
@@ -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
25Prototype : void ff_bfin_idct(DCTELEM *in)25Prototype : void ff_bfin_idct(int16_t *in)
26 26
27Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.27Registers 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.text91.text
92DEFUN(idct,mL1,92DEFUN(idct,mL1,
93 (DCTELEM *block)):93 (int16_t *block)):
94 94
95/********************** Function Prologue *********************************/95/********************** Function Prologue *********************************/
96 link 16;96 link 16;
libavcodec/bfin/mpegvideo_bfin.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26#include "dsputil_bfin.h"26#include "dsputil_bfin.h"
27 27
28static int dct_quantize_bfin (MpegEncContext *s,28static 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;
libavcodec/bfin/pixels_bfin.S+4−4
@@ -21,7 +21,7 @@ · 20 unmodified lines
21#include "config_bfin.h"21#include "config_bfin.h"
22 22
23DEFUN(put_pixels_clamped,mL1,23DEFUN(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
51DEFUN_END(put_pixels_clamped)51DEFUN_END(put_pixels_clamped)
52 52
53DEFUN(add_pixels_clamped,mL1,53DEFUN(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
444DEFUN(diff_pixels,mL1,444DEFUN(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
520DEFUN(get_pixels,mL1,520DEFUN(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; // dest523 i3=r0; // dest
524 i0=r1; // src0524 i0=r1; // src0
libavcodec/bfin/vp3_bfin.c+2−2
@@ -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 */
26void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block)26void 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 */
39void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block)39void 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);
libavcodec/bfin/vp3_idct_bfin.S+2−2
@@ -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
25Prototype : void ff_bfin_vp3_idct(DCTELEM *in)25Prototype : void ff_bfin_vp3_idct(int16_t *in)
26 26
27Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.27Registers 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.text64.text
65DEFUN(vp3_idct,mL1,65DEFUN(vp3_idct,mL1,
66 (DCTELEM *block)):66 (int16_t *block)):
67 67
68/********************** Function Prologue *********************************/68/********************** Function Prologue *********************************/
69 link 16;69 link 16;
libavcodec/bink.c+3−3
@@ -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 decode696 * @param masks_count number of masks to decode
697 * @return 0 on success, negative value in other cases697 * @return 0 on success, negative value in other cases
698 */698 */
699static int read_residue(GetBitContext *gb, DCTELEM block[64], int masks_count)699static 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];
libavcodec/cavs.c+1−1
@@ -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
719av_cold int ff_cavs_init(AVCodecContext *avctx) {719av_cold int ff_cavs_init(AVCodecContext *avctx) {
libavcodec/cavs.h+1−1
@@ -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
240extern const uint8_t ff_cavs_partition_flags[30];240extern const uint8_t ff_cavs_partition_flags[30];
libavcodec/cavsdec.c+4−4
@@ -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
519static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf,519static 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);
libavcodec/cavsdsp.c+2−2
@@ -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
186static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) {186static 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;
libavcodec/cavsdsp.h+1−1
@@ -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
libavcodec/dct-test.c+16−15
@@ -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 printf50#undef printf
50 51
51// BFIN52// BFIN
52void ff_bfin_idct(DCTELEM *block);53void ff_bfin_idct(int16_t *block);
53void ff_bfin_fdct(DCTELEM *block);54void ff_bfin_fdct(int16_t *block);
54 55
55// ALTIVEC56// ALTIVEC
56void ff_fdct_altivec(DCTELEM *block);57void ff_fdct_altivec(int16_t *block);
57 58
58// ARM59// ARM
59void ff_j_rev_dct_arm(DCTELEM *data);60void ff_j_rev_dct_arm(int16_t *data);
60void ff_simple_idct_arm(DCTELEM *data);61void ff_simple_idct_arm(int16_t *data);
61void ff_simple_idct_armv5te(DCTELEM *data);62void ff_simple_idct_armv5te(int16_t *data);
62void ff_simple_idct_armv6(DCTELEM *data);63void ff_simple_idct_armv6(int16_t *data);
63void ff_simple_idct_neon(DCTELEM *data);64void ff_simple_idct_neon(int16_t *data);
64 65
65void ff_simple_idct_axp(DCTELEM *data);66void ff_simple_idct_axp(int16_t *data);
66 67
67struct algo {68struct 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
169DECLARE_ALIGNED(16, static DCTELEM, block)[64];170DECLARE_ALIGNED(16, static int16_t, block)[64];
170DECLARE_ALIGNED(8, static DCTELEM, block1)[64];171DECLARE_ALIGNED(8, static int16_t, block1)[64];
171 172
172static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng)173static 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
200static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm)201static 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
222static int dct_error(const struct algo *dct, int test, int is_idct, int speed)223static 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;
libavcodec/dnxhddec.c+7−7
@@ -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 955#define DNXHD_VLC_BITS 9
56#define DNXHD_DC_VLC_BITS 756#define DNXHD_DC_VLC_BITS 7
57 57
58static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, int n, int qscale);58static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale);
59static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, int n, int qscale);59static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale);
60 60
61static av_cold int dnxhd_decode_init(AVCodecContext *avctx)61static 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
182static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,182static 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
253static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block,253static 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
259static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block,259static 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);
libavcodec/dnxhdenc.c+10−10
@@ -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 1045#define LAMBDA_FRAC_BITS 10
46 46
47static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size)47static 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
64static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size)64static 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
76static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block,76static 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
373static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *block, int last_index, int n)373static 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]); // EOB393 put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB
394}394}
395 395
396static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index)396static 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
437static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block)437static 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
446static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *block, int last_index)446static 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);
libavcodec/dnxhdenc.h+2−2
@@ -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
98void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);98void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
libavcodec/dsputil.c+17−17
@@ -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
339static void diff_pixels_c(DCTELEM *restrict block, const uint8_t *s1,339static 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
360static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,360static 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
381static void put_signed_pixels_clamped_c(const DCTELEM *block,381static 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
402static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *restrict pixels,402static 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
422static int sum_abs_dctelem_c(DCTELEM *block)422static 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 not1712 * @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 */
1715void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)1715void 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 permutations1721 //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
2031static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2031static 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
2070static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2070static 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
2095static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2095static 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
2111static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2111static 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
2134static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2134static 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
2210static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){2210static 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
2450static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)2450static 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}
2455static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)2455static 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);
libavcodec/dsputil.h+45−46
@@ -36,41 +36,40 @@ · 35 unmodified lines
36 36
37//#define DEBUG37//#define DEBUG
38/* dct code */38/* dct code */
39typedef short DCTELEM;
40 39
41void ff_fdct_ifast (DCTELEM *data);40void ff_fdct_ifast(int16_t *data);
42void ff_fdct_ifast248 (DCTELEM *data);41void ff_fdct_ifast248(int16_t *data);
43void ff_jpeg_fdct_islow_8(DCTELEM *data);42void ff_jpeg_fdct_islow_8(int16_t *data);
44void ff_jpeg_fdct_islow_10(DCTELEM *data);43void ff_jpeg_fdct_islow_10(int16_t *data);
45void ff_fdct248_islow_8(DCTELEM *data);44void ff_fdct248_islow_8(int16_t *data);
46void ff_fdct248_islow_10(DCTELEM *data);45void ff_fdct248_islow_10(int16_t *data);
47 46
48void ff_j_rev_dct (DCTELEM *data);47void ff_j_rev_dct(int16_t *data);
49 48
50void ff_fdct_mmx(DCTELEM *block);49void ff_fdct_mmx(int16_t *block);
51void ff_fdct_mmxext(DCTELEM *block);50void ff_fdct_mmxext(int16_t *block);
52void ff_fdct_sse2(DCTELEM *block);51void ff_fdct_sse2(int16_t *block);
53 52
54#define H264_IDCT(depth) \53#define H264_IDCT(depth) \
55void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\54void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
56void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\55void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
57void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\56void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
58void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\57void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
59void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\58void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
60void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\59void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
61void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\60void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
62void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\61void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
63void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\62void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
64void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(DCTELEM *output, DCTELEM *input, int qmul);\63void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\
65void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);\64void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\
66void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);65void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);
67 66
68H264_IDCT( 8)67H264_IDCT( 8)
69H264_IDCT( 9)68H264_IDCT( 9)
70H264_IDCT(10)69H264_IDCT(10)
71 70
72void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp);71void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp);
73void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);72void 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 */
76extern const uint8_t ff_alternate_horizontal_scan[64];75extern 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/*
131void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);130void get_pixels_c(int16_t *block, const uint8_t *pixels, int line_size);
132void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);131void diff_pixels_c(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride);
133void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);132void put_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size);
134void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);133void add_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size);
135void clear_blocks_c(DCTELEM *blocks);134void 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 2x4220// 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 dest355 * @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 dest361 * @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 order451 * @param last last non zero element in scantable order
453 */452 */
454void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);453void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last);
455 454
456void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);455void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
457 456
libavcodec/dsputil_template.c+7−7
@@ -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) \
117static void FUNCC(get_pixels ## suffix)(DCTELEM *restrict _block, \117static 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 \
140static void FUNCC(add_pixels8 ## suffix)(uint8_t *restrict _pixels, \140static 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 \
163static void FUNCC(add_pixels4 ## suffix)(uint8_t *restrict _pixels, \163static 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 \
182static void FUNCC(clear_block ## suffix)(DCTELEM *block) \182static 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 */ \
190static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks) \190static 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
195DCTELEM_FUNCS(DCTELEM, _16)195DCTELEM_FUNCS(int16_t, _16)
196#if BIT_DEPTH > 8196#if BIT_DEPTH > 8
197DCTELEM_FUNCS(dctcoef, _32)197DCTELEM_FUNCS(dctcoef, _32)
198#endif198#endif
libavcodec/dv.c+2−2
@@ -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: the500 /* We offer two different methods for class number assignment: the
501 method suggested in SMPTE 314M Table 22, and an improved501 method suggested in SMPTE 314M Table 22, and an improved
libavcodec/dvdata.h+3−3
@@ -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
libavcodec/dvdec.c+4−4
@@ -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
57static const int dv_iweight_bits = 14;57static const int dv_iweight_bits = 14;
58 58
59/* decode AC coefficients */59/* decode AC coefficients */
60static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)60static 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;
libavcodec/eaidct.c+3−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
67static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) {67static 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
81void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) {81void 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]);
libavcodec/eaidct.h+1−2
@@ -20,8 +20,7 @@ · 19 unmodified lines
20#define AVCODEC_EAIDCT_H20#define AVCODEC_EAIDCT_H
21 21
22#include <stdint.h>22#include <stdint.h>
23#include "dsputil.h"
24 23
25void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);24void 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 */
libavcodec/eamad.c+3−3
@@ -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
99static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, int j)99static 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
113static inline void decode_block_intra(MadContext *s, DCTELEM * block)113static 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;
libavcodec/eatgq.c+3−3
@@ -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
61static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb){61static 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
106static void tgq_idct_put_mb(TgqContext *s, DCTELEM (*block)[64], int mb_x, int mb_y){106static 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;
libavcodec/eatqi.c+3−3
@@ -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
46static av_cold int tqi_decode_init(AVCodecContext *avctx)46static 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
61static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])61static 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
72static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64])72static 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];
libavcodec/faandct.c+3−3
@@ -64,7 +64,7 @@ B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7, · 63 unmodified lines
64B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7,64B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7,
65};65};
66 66
67static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data)67static 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
122void ff_faandct(DCTELEM * data)122void 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
182void ff_faandct248(DCTELEM * data)182void 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;
libavcodec/faandct.h+3−3
@@ -29,9 +29,9 @@ · 28 unmodified lines
29#ifndef AVCODEC_FAANDCT_H29#ifndef AVCODEC_FAANDCT_H
30#define AVCODEC_FAANDCT_H30#define AVCODEC_FAANDCT_H
31 31
32#include "dsputil.h"32#include <stdint.h>
33 33
34void ff_faandct(DCTELEM * data);34void ff_faandct(int16_t *data);
35void ff_faandct248(DCTELEM * data);35void ff_faandct248(int16_t *data);
36 36
37#endif /* AVCODEC_FAANDCT_H */37#endif /* AVCODEC_FAANDCT_H */
libavcodec/faanidct.c+4−4
@@ -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
47B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8,47B7*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
50static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){50static 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
132void ff_faanidct(DCTELEM block[64]){132void 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
145void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){145void 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
158void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]){158void 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
libavcodec/faanidct.h+3−4
@@ -23,10 +23,9 @@ · 22 unmodified lines
23#define AVCODEC_FAANIDCT_H23#define AVCODEC_FAANIDCT_H
24 24
25#include <stdint.h>25#include <stdint.h>
26#include "dsputil.h"
27 26
28void ff_faanidct(DCTELEM block[64]);27void ff_faanidct(int16_t block[64]);
29void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]);28void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]);
30void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]);29void 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 */
libavcodec/h261dec.c+2−2
@@ -47,7 +47,7 @@ static VLC h261_mtype_vlc; · 46 unmodified lines
47static VLC h261_mv_vlc;47static VLC h261_mv_vlc;
48static VLC h261_cbp_vlc;48static VLC h261_cbp_vlc;
49 49
50static int h261_decode_block(H261Context * h, DCTELEM * block, int n, int coded);50static int h261_decode_block(H261Context * h, int16_t * block, int n, int coded);
51 51
52static av_cold void h261_decode_init_vlc(H261Context *h){52static 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 occurred359 * @return <0 if an error occurred
360 */360 */
361static int h261_decode_block(H261Context * h, DCTELEM * block,361static 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;
libavcodec/h261enc.c+4−4
@@ -34,7 +34,7 @@ · 33 unmodified lines
34 34
35extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];35extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
36 36
37static void h261_encode_block(H261Context * h, DCTELEM * block,37static void h261_encode_block(H261Context * h, int16_t * block,
38 int n);38 int n);
39 39
40int ff_h261_get_picture_format(int width, int height){40int 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
145static inline int get_cbp(MpegEncContext * s,145static 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}
156void ff_h261_encode_mb(MpegEncContext * s,156void 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 block255 * @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 */
258static void h261_encode_block(H261Context * h, DCTELEM * block, int n){258static 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;
libavcodec/h263.c+1−1
@@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){ · 225 unmodified lines
226 }226 }
227}227}
228 228
229void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)229void 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;
libavcodec/h263.h+4−4
@@ -73,7 +73,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx, · 72 unmodified lines
73 AVPacket *avpkt);73 AVPacket *avpkt);
74int ff_h263_decode_end(AVCodecContext *avctx);74int ff_h263_decode_end(AVCodecContext *avctx);
75void ff_h263_encode_mb(MpegEncContext *s,75void 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);
78void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);78void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);
79void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);79void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);
@@ -89,7 +89,7 @@ int ff_h263_decode_mba(MpegEncContext *s); · 9 unmodified lines
89void ff_h263_encode_mba(MpegEncContext *s);89void ff_h263_encode_mba(MpegEncContext *s);
90void ff_init_qscale_tab(MpegEncContext *s);90void ff_init_qscale_tab(MpegEncContext *s);
91int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);91int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
92void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);92void 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
100int ff_intel_h263_decode_picture_header(MpegEncContext *s);100int ff_intel_h263_decode_picture_header(MpegEncContext *s);
101int ff_h263_decode_mb(MpegEncContext *s,101int 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
146static inline int get_p_cbp(MpegEncContext * s,146static 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
libavcodec/h264.c+5−5
@@ -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
1753static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth,1753static 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
1762static av_always_inline void dctcoef_set(DCTELEM *mb, int high_bit_depth,1762static 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)) {
libavcodec/h264.h+3−4
@@ -29,7 +29,6 @@ · 28 unmodified lines
29#define AVCODEC_H264_H29#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 mb390 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 * Cabac393 * Cabac
libavcodec/h264_cabac.c+28−8
@@ -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
1563static av_always_inline void1563static av_always_inline void
1564decode_cabac_residual_internal(H264Context *h, DCTELEM *block,1564decode_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
1748static void decode_cabac_residual_dc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) {1748static 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
1752static void decode_cabac_residual_dc_internal_422(H264Context *h, DCTELEM *block,1756static 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
1759static 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 ) {1763static 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
1775static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) {1784static 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
1784static av_always_inline void1798static av_always_inline void
1785decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block,1799decode_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
1797static 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 ) {1811static 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++) {
libavcodec/h264_cavlc.c+3−3
@@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){ · 441 unmodified lines
442 * @param max_coeff number of coefficients in the block442 * @param max_coeff number of coefficients in the block
443 * @return <0 if an error occurred443 * @return <0 if an error occurred
444 */444 */
445static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){445static 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;
libavcodec/h264_mb_template.c+1−1
@@ -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
libavcodec/h264dsp.h+11−13
@@ -29,8 +29,6 @@ · 28 unmodified lines
29 29
30#include <stdint.h>30#include <stdint.h>
31 31
32#include "dsputil.h"
33
34typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,32typedef 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);
36typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src,34typedef 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
108void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,106void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,
libavcodec/h264idct_template.c+12−12
@@ -47,7 +47,7 @@ static const uint8_t scan8[16*3]={ · 46 unmodified lines
47};47};
48#endif48#endif
49 49
50void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride)50void 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
84void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){84void 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 0156// assumes all AC coefs are 0
157void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){157void 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
170void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, DCTELEM *block, int stride){170void 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
183void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){183void 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
194void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){194void 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
202void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){202void 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
213void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){213void 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
225void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){225void 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 parameter249 * @param qmul quantization parameter
250 */250 */
251void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *_output, DCTELEM *_input, int qmul){251void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){
252#define stride 16252#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 stride283#undef stride
284}284}
285 285
286void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){286void 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
313void FUNCC(ff_h264_chroma_dc_dequant_idct)(DCTELEM *_block, int qmul){313void 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;
libavcodec/h264pred.h+6−6
@@ -28,8 +28,8 @@ · 27 unmodified lines
28#ifndef AVCODEC_H264PRED_H28#ifndef AVCODEC_H264PRED_H
29#define AVCODEC_H264PRED_H29#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 types35 * 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
112void ff_h264_pred_init(H264PredContext *h, int codec_id,112void ff_h264_pred_init(H264PredContext *h, int codec_id,
libavcodec/h264pred_template.c+10−10
@@ -1131,7 +1131,7 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft, · 1130 unmodified lines
1131#undef PL1131#undef PL
1132#undef SRC1132#undef SRC
1133 1133
1134static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block,1134static 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
1153static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,1153static 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
1171static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block,1171static 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
1194static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,1194static 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
1216static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset,1216static 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
1225static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix,1225static 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
1235static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset,1235static 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
1243static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,1243static 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
1253static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,1253static 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
1262static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix,1262static 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++)
libavcodec/ituh263dec.c+3−3
@@ -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
441static int h263_decode_block(MpegEncContext * s, DCTELEM * block,441static 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
564static int h263_skip_b_part(MpegEncContext *s, int cbp)564static 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 correctly569 /* 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
601int ff_h263_decode_mb(MpegEncContext *s,601int 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;
libavcodec/ituh263enc.c+2−2
@@ -306,7 +306,7 @@ static const int dquant_code[5]= {1,0,9,2,3}; · 305 unmodified lines
306 * @param block the 8x8 block306 * @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 */
309static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)309static 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
457void ff_h263_encode_mb(MpegEncContext * s,457void 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;
libavcodec/jfdctfst.c+9−9
@@ -136,17 +136,17 @@ · 135 unmodified lines
136#endif136#endif
137 137
138 138
139/* Multiply a DCTELEM variable by an int32_t constant, and immediately139/* 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
145static av_always_inline void row_fdct(DCTELEM * data){145static 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
207GLOBAL(void)207GLOBAL(void)
208ff_fdct_ifast (DCTELEM * data)208ff_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
273GLOBAL(void)273GLOBAL(void)
274ff_fdct_ifast248 (DCTELEM * data)274ff_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);
libavcodec/jfdctint_template.c+14−14
@@ -184,12 +184,12 @@ · 183 unmodified lines
184#endif184#endif
185 185
186 186
187static av_always_inline void FUNC(row_fdct)(DCTELEM *data)187static 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
264GLOBAL(void)264GLOBAL(void)
265FUNC(ff_jpeg_fdct_islow)(DCTELEM *data)265FUNC(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 */
346GLOBAL(void)346GLOBAL(void)
347FUNC(ff_fdct248_islow)(DCTELEM *data)347FUNC(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);
libavcodec/jrevdct.c+19−19
@@ -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
77typedef DCTELEM DCTBLOCK[DCTSIZE2];77typedef int16_t DCTBLOCK[DCTSIZE2];
78 78
79#define CONST_BITS 1379#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 */
libavcodec/mdec.c+4−4
@@ -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-154//very similar to MPEG-1
55static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n)55static 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
122static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){122static 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
136static inline void idct_put(MDECContext *a, int mb_x, int mb_y){136static 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;
libavcodec/mimic.c+2−2
@@ -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
184static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale)184static 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);
libavcodec/mjpegdec.c+6−6
@@ -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 */
411static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component,411static 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
459static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block,459static 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 */
477static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block,477static 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 */
575static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block,575static 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);
libavcodec/mjpegdec.h+2−2
@@ -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 << interlaced89 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;
libavcodec/mjpegenc.c+2−2
@@ -369,7 +369,7 @@ void ff_mjpeg_encode_dc(MpegEncContext *s, int val, · 368 unmodified lines
369 }369 }
370}370}
371 371
372static void encode_block(MpegEncContext *s, DCTELEM *block, int n)372static 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
430void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64])430void 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++) {
libavcodec/mjpegenc.h+3−2
@@ -33,7 +33,8 @@ · 32 unmodified lines
33#ifndef AVCODEC_MJPEGENC_H33#ifndef AVCODEC_MJPEGENC_H
34#define AVCODEC_MJPEGENC_H34#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
39typedef struct MJpegContext {40typedef struct MJpegContext {
@@ -55,6 +56,6 @@ void ff_mjpeg_encode_picture_trailer(MpegEncContext *s); · 15 unmodified lines
55void ff_mjpeg_encode_stuffing(PutBitContext *pbc);56void ff_mjpeg_encode_stuffing(PutBitContext *pbc);
56void ff_mjpeg_encode_dc(MpegEncContext *s, int val,57void 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);
58void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]);59void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
59 60
60#endif /* AVCODEC_MJPEGENC_H */61#endif /* AVCODEC_MJPEGENC_H */
libavcodec/mpeg12.c+10−10
@@ -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
83static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)83static 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
154int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)154int 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
159static inline int mpeg1_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n)159static 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
234static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n)234static 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
306static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n)306static 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
385static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,385static 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
447static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)447static 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
525static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)525static 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
722static void exchange_uv(MpegEncContext *s)722static 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 2734#define MT_16X8 2
735#define MT_DMV 3735#define MT_DMV 3
736 736
737static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])737static 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);
libavcodec/mpeg12.h+1−1
@@ -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
74extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);74extern 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 */
libavcodec/mpeg12enc.c+4−4
@@ -51,7 +51,7 @@ static const uint8_t svcd_scan_offset_placeholder[14] = { · 50 unmodified lines
51};51};
52 52
53static void mpeg1_encode_block(MpegEncContext *s,53static void mpeg1_encode_block(MpegEncContext *s,
54 DCTELEM *block,54 int16_t *block,
55 int component);55 int component);
56static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added56static 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
434static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,434static 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
659void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)659void 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
841static void mpeg1_encode_block(MpegEncContext *s,841static 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;
libavcodec/mpeg4video.h+2−2
@@ -83,9 +83,9 @@ extern const uint16_t ff_mpeg4_resync_prefix[8]; · 82 unmodified lines
83extern const uint8_t ff_mpeg4_dc_threshold[8];83extern const uint8_t ff_mpeg4_dc_threshold[8];
84 84
85void ff_mpeg4_encode_mb(MpegEncContext *s,85void 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);
88void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,88void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n,
89 int dir);89 int dir);
90void ff_set_mpeg4_time(MpegEncContext * s);90void ff_set_mpeg4_time(MpegEncContext * s);
91void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);91void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);
libavcodec/mpeg4videodec.c+4−4
@@ -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 direction51 * @param dir the ac prediction direction
52 */52 */
53void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,53void 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 occurred842 * @return <0 if an error occurred
843 */843 */
844static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,844static 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 occurred1066 * @return <0 if an error occurred
1067 */1067 */
1068static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])1068static 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
1150static int mpeg4_decode_mb(MpegEncContext *s,1150static 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;
libavcodec/mpeg4videoenc.c+8−8
@@ -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 */
62static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){62static 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 block91 * @param[out] st scantable for each 8x8 block
92 * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order92 * @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order
93 */93 */
94static 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])94static 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 block122 * @param[out] st scantable for each 8x8 block
123 * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order123 * @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order
124 */124 */
125static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6])125static 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 */
297static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,297static 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
348static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,348static 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
399static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6],399static 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
428static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],428static 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
469static const int dquant_code[5]= {1,0,9,2,3};469static const int dquant_code[5]= {1,0,9,2,3};
470 470
471void ff_mpeg4_encode_mb(MpegEncContext * s,471void 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;
libavcodec/mpegvideo.c+22−22
@@ -43,19 +43,19 @@ · 42 unmodified lines
43//#include <assert.h>43//#include <assert.h>
44 44
45static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,45static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
46 DCTELEM *block, int n, int qscale);46 int16_t *block, int n, int qscale);
47static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,47static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
48 DCTELEM *block, int n, int qscale);48 int16_t *block, int n, int qscale);
49static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,49static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
50 DCTELEM *block, int n, int qscale);50 int16_t *block, int n, int qscale);
51static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,51static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
52 DCTELEM *block, int n, int qscale);52 int16_t *block, int n, int qscale);
53static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,53static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
54 DCTELEM *block, int n, int qscale);54 int16_t *block, int n, int qscale);
55static void dct_unquantize_h263_intra_c(MpegEncContext *s,55static void dct_unquantize_h263_intra_c(MpegEncContext *s,
56 DCTELEM *block, int n, int qscale);56 int16_t *block, int n, int qscale);
57static void dct_unquantize_h263_inter_c(MpegEncContext *s,57static 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[] */
2069static inline void put_dct(MpegEncContext *s,2069static 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[] */
2077static inline void add_dct(MpegEncContext *s,2077static 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
2085static inline void add_dequant_dct(MpegEncContext *s,2085static 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 */
2138static av_always_inline2138static av_always_inline
2139void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],2139void 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
2370void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){2370void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){
2371#if !CONFIG_SMALL2371#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
2508static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,2508static 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
2540static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,2540static 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
2569static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,2569static 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
2599static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,2599static 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
2632static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,2632static 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
2663static void dct_unquantize_h263_intra_c(MpegEncContext *s,2663static 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
2700static void dct_unquantize_h263_inter_c(MpegEncContext *s,2700static 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;
libavcodec/mpegvideo.h+25−25
@@ -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 swapped671 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 blocks674 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 block675 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 0677#define SLICE_OK 0
678#define SLICE_ERROR -1678#define SLICE_ERROR -1
679#define SLICE_END -2 ///<end marker found679#define SLICE_END -2 ///<end marker found
680#define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded680#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 options706 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
764int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize);764int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize);
765int ff_MPV_common_frame_size_change(MpegEncContext *s);765int ff_MPV_common_frame_size_change(MpegEncContext *s);
766void ff_MPV_common_end(MpegEncContext *s);766void ff_MPV_common_end(MpegEncContext *s);
767void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]);767void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]);
768int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);768int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
769void ff_MPV_frame_end(MpegEncContext *s);769void ff_MPV_frame_end(MpegEncContext *s);
770int ff_MPV_encode_init(AVCodecContext *avctx);770int ff_MPV_encode_init(AVCodecContext *avctx);
@@ -784,7 +784,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict); · 13 unmodified lines
784void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);784void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
785void ff_release_unused_pictures(MpegEncContext *s, int remove_current);785void ff_release_unused_pictures(MpegEncContext *s, int remove_current);
786int ff_find_unused_picture(MpegEncContext *s, int shared);786int ff_find_unused_picture(MpegEncContext *s, int shared);
787void ff_denoise_dct(MpegEncContext *s, DCTELEM *block);787void ff_denoise_dct(MpegEncContext *s, int16_t *block);
788int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);788int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
789int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);789int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);
790void ff_MPV_report_decode_progress(MpegEncContext *s);790void 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
799int ff_dct_common_init(MpegEncContext *s);799int ff_dct_common_init(MpegEncContext *s);
800void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64],800void 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);
802int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);802int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
803 803
804void ff_init_block_index(MpegEncContext *s);804void ff_init_block_index(MpegEncContext *s);
805void ff_copy_picture(Picture *dst, Picture *src);805void 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
875void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);875void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
876void ff_mpeg1_encode_mb(MpegEncContext *s,876void 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);
879void ff_mpeg1_encode_init(MpegEncContext *s);879void ff_mpeg1_encode_init(MpegEncContext *s);
880void ff_mpeg1_encode_slice_header(MpegEncContext *s);880void ff_mpeg1_encode_slice_header(MpegEncContext *s);
@@ -889,7 +889,7 @@ extern const uint8_t ff_h263_loop_filter_strength[32]; · 8 unmodified lines
889void ff_h261_loop_filter(MpegEncContext *s);889void ff_h261_loop_filter(MpegEncContext *s);
890void ff_h261_reorder_mb_index(MpegEncContext* s);890void ff_h261_reorder_mb_index(MpegEncContext* s);
891void ff_h261_encode_mb(MpegEncContext *s,891void 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);
894void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number);894void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number);
895void ff_h261_encode_init(MpegEncContext *s);895void ff_h261_encode_init(MpegEncContext *s);
@@ -906,7 +906,7 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number); · 10 unmodified lines
906void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);906void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
907void ff_msmpeg4_encode_ext_header(MpegEncContext * s);907void ff_msmpeg4_encode_ext_header(MpegEncContext * s);
908void ff_msmpeg4_encode_mb(MpegEncContext * s,908void 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);
911int ff_msmpeg4_decode_picture_header(MpegEncContext * s);911int ff_msmpeg4_decode_picture_header(MpegEncContext * s);
912int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);912int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
@@ -914,14 +914,14 @@ int ff_msmpeg4_decode_init(AVCodecContext *avctx); · 1 unmodified line
914void ff_msmpeg4_encode_init(MpegEncContext *s);914void ff_msmpeg4_encode_init(MpegEncContext *s);
915int ff_wmv2_decode_picture_header(MpegEncContext * s);915int ff_wmv2_decode_picture_header(MpegEncContext * s);
916int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);916int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);
917void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);917void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
918void ff_mspel_motion(MpegEncContext *s,918void 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);
922int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);922int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
923void ff_wmv2_encode_mb(MpegEncContext * s,923void 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 */
libavcodec/mpegvideo_enc.c+17−17
@@ -51,10 +51,10 @@ · 50 unmodified lines
51//#include <assert.h>51//#include <assert.h>
52 52
53static int encode_picture(MpegEncContext *s, int picture_number);53static int encode_picture(MpegEncContext *s, int picture_number);
54static int dct_quantize_refine(MpegEncContext *s, DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale);54static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale);
55static int sse_mb(MpegEncContext *s);55static int sse_mb(MpegEncContext *s);
56static void denoise_dct_c(MpegEncContext *s, DCTELEM *block);56static void denoise_dct_c(MpegEncContext *s, int16_t *block);
57static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);57static 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 PARANOID60//#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
1668static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block,1668static 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 QPRD2716 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
3330static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){3330static 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
3354static int dct_quantize_trellis_c(MpegEncContext *s,3354static 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 happened3459 *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
3668static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?3668static 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
4041int ff_dct_quantize_c(MpegEncContext *s,4041int 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;
libavcodec/mpegvideo_xvmc.c+1−1
@@ -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/**
libavcodec/msmpeg4.c+3−3
@@ -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
409static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])409static 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
495static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])495static 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_DETAILS936//#define ERROR_DETAILS
937int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,937int 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;
libavcodec/msmpeg4.h+3−4
@@ -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
46void ff_msmpeg4_code012(PutBitContext *pb, int n);45void ff_msmpeg4_code012(PutBitContext *pb, int n);
47void ff_msmpeg4_common_init(MpegEncContext *s);46void ff_msmpeg4_common_init(MpegEncContext *s);
48void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);47void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
49void ff_msmpeg4_handle_slices(MpegEncContext *s);48void ff_msmpeg4_handle_slices(MpegEncContext *s);
50void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);49void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
51int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n,50int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n,
52 uint8_t **coded_block_ptr);51 uint8_t **coded_block_ptr);
53int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr);52int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr);
54int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,53int 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);
56int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,55int 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);
58int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);57int 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 || \
libavcodec/msmpeg4enc.c+2−2
@@ -368,7 +368,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val) · 367 unmodified lines
368}368}
369 369
370void ff_msmpeg4_encode_mb(MpegEncContext * s,370void 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 different569/* 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 */
572void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)572void 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;
libavcodec/ppc/dsputil_altivec.c+3−3
@@ -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
479static void get_pixels_altivec(DCTELEM *restrict block, const uint8_t *pixels, int line_size)479static 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
505static void diff_pixels_altivec(DCTELEM *restrict block, const uint8_t *s1,505static 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
579static void clear_block_altivec(DCTELEM *block) {579static 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);
libavcodec/ppc/dsputil_ppc.c+7−7
@@ -47,7 +47,7 @@ distinguish, and use dcbz (32 bytes) or dcbzl (one cache line) as required. · 46 unmodified lines
47see <http://developer.apple.com/technotes/tn/tn2087.html>47see <http://developer.apple.com/technotes/tn/tn2087.html>
48and <http://developer.apple.com/technotes/tn/tn2086.html>48and <http://developer.apple.com/technotes/tn/tn2086.html>
49*/49*/
50static void clear_blocks_dcbz32_ppc(DCTELEM *blocks)50static 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 line73/* 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_DCBZL75#if HAVE_DCBZL
76static void clear_blocks_dcbz128_ppc(DCTELEM *blocks)76static 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 machines82 // 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 else86 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#else91#else
92static void clear_blocks_dcbz128_ppc(DCTELEM *blocks)92static 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#endif96#endif
97 97
libavcodec/ppc/h264_altivec.c+9−9
@@ -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
318static void ff_h264_idct_add_altivec(uint8_t *dst, DCTELEM *block, int stride)318static 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
432static void ff_h264_idct8_add_altivec( uint8_t *dst, DCTELEM *dct, int stride ) {432static 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
476static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, DCTELEM *block, int stride, int size)476static 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
521static void h264_idct_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride)521static 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
526static void ff_h264_idct8_dc_add_altivec(uint8_t *dst, DCTELEM *block, int stride)526static 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
531static void ff_h264_idct_add16_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){531static 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
542static void ff_h264_idct_add16intra_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){542static 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
550static void ff_h264_idct8_add4_altivec(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){550static 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
561static void ff_h264_idct_add8_altivec(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){561static 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++){
libavcodec/ppc/mpegvideo_altivec.c+1−1
@@ -35,7 +35,7 @@ · 34 unmodified lines
35/* AltiVec version of dct_unquantize_h26335/* AltiVec version of dct_unquantize_h263
36 this code assumes `block' is 16 bytes-aligned */36 this code assumes `block' is 16 bytes-aligned */
37static void dct_unquantize_h263_altivec(MpegEncContext *s,37static 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;
libavcodec/ppc/vc1dsp_altivec.c+2−2
@@ -129,7 +129,7 @@ do { \ · 128 unmodified lines
129 129
130/** Do inverse transform on 8x8 block130/** Do inverse transform on 8x8 block
131*/131*/
132static void vc1_inv_trans_8x8_altivec(DCTELEM block[64])132static 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 block225/** Do inverse transform on 8x4 part of block
226*/226*/
227static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, DCTELEM *block)227static 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;
libavcodec/ppc/vp3dsp_altivec.c+2−2
@@ -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
119static void vp3_idct_put_altivec(uint8_t *dst, int stride, DCTELEM block[64])119static 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_START122 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
148static void vp3_idct_add_altivec(uint8_t *dst, int stride, DCTELEM block[64])148static 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;
libavcodec/proresdec.c+6−5
@@ -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 slice48 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 */
343static inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out,344static 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 */
371static inline void decode_ac_coeffs(GetBitContext *gb, DCTELEM *out,372static 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;
libavcodec/proresdsp.c+4−3
@@ -20,6 +20,7 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * 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 slice36 * Add bias value, clamp and output pixels of a slice
36 */37 */
37static void put_pixels(uint16_t *dst, int stride, const DCTELEM *in)38static 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
50static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const int16_t *qmat)51static 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#endif56#endif
56 57
57#if CONFIG_PRORES_ENCODER58#if CONFIG_PRORES_ENCODER
58static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)59static 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;
libavcodec/proresdsp.h+3−3
@@ -23,7 +23,7 @@ · 22 unmodified lines
23#ifndef AVCODEC_PRORESDSP_H23#ifndef AVCODEC_PRORESDSP_H
24#define AVCODEC_PRORESDSP_H24#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 decoder28#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
39void ff_proresdsp_init(ProresDSPContext *dsp);39void ff_proresdsp_init(ProresDSPContext *dsp);
libavcodec/proresenc.c+9−8
@@ -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 16168#define MAX_STORED_Q 16
168 169
169typedef struct ProresThreadData {170typedef 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
176typedef struct ProresContext {177typedef 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
211static void get_slice_data(ProresContext *ctx, const uint16_t *src,212static 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
317static void encode_dcs(PutBitContext *pb, DCTELEM *blocks,318static 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
343static void encode_acs(PutBitContext *pb, DCTELEM *blocks,344static 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
377static int encode_slice_plane(ProresContext *ctx, PutBitContext *pb,378static 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
481static int estimate_dcs(int *error, DCTELEM *blocks, int blocks_per_slice,482static 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
512static int estimate_acs(int *error, DCTELEM *blocks, int blocks_per_slice,513static 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{
libavcodec/rtjpeg.c+3−3
@@ -44,7 +44,7 @@ · 43 unmodified lines
44 * aligned this could be done faster in a different way, e.g. as it is done44 * 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 */
47static inline int get_block(GetBitContext *gb, DCTELEM *block, const uint8_t *scan,47static 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 block63 // 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 coefficient66 // 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]);
libavcodec/rtjpeg.h+1−1
@@ -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
41void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,41void ff_rtjpeg_decode_init(RTJpegContext *c, DSPContext *dsp,
libavcodec/rv34.c+10−10
@@ -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 */
219static inline void decode_coeff(DCTELEM *dst, int coef, int esc, GetBitContext *gb, VLC* vlc, int q)219static 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 */
239static inline void decode_subblock(DCTELEM *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)239static 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 */
257static inline void decode_subblock1(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc, int q)257static 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
263static inline void decode_subblock3(DCTELEM *dst, int code, GetBitContext *gb, VLC *vlc,263static 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--o282 * o--o
283 */283 */
284 284
285static int rv34_decode_block(DCTELEM *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2)285static 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
1008static void rv34_output_i16x16(RV34DecContext *r, int8_t *intra_types, int cbp)1008static 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_MIX16x161221 // 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];
libavcodec/rv34dsp.c+6−6
@@ -33,7 +33,7 @@ · 32 unmodified lines
33 * @{33 * @{
34 */34 */
35 35
36static av_always_inline void rv34_row_transform(int temp[16], DCTELEM *block)36static 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 reconstruction54 * 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 */
57static void rv34_idct_add_c(uint8_t *dst, ptrdiff_t stride, DCTELEM *block){57static 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 */
85static void rv34_inv_transform_noround_c(DCTELEM *block){85static 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
118static void rv34_inv_transform_dc_noround_c(DCTELEM *block)118static 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)
libavcodec/rv34dsp.h+2−2
@@ -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
37typedef void (*rv34_inv_transform_func)(DCTELEM *block);37typedef void (*rv34_inv_transform_func)(int16_t *block);
38 38
39typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, DCTELEM *block);39typedef void (*rv34_idct_add_func)(uint8_t *dst, ptrdiff_t stride, int16_t *block);
40typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride,40typedef void (*rv34_idct_dc_add_func)(uint8_t *dst, ptrdiff_t stride,
41 int dc);41 int dc);
42 42
libavcodec/sh4/dsputil_sh4.c+4−4
@@ -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
50static void clear_blocks_sh4(DCTELEM *blocks)50static 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
55static void idct_put(uint8_t *dest, int line_size, DCTELEM *block)55static 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}
73static void idct_add(uint8_t *dest, int line_size, DCTELEM *block)73static 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;
libavcodec/sh4/dsputil_sh4.h+1−1
@@ -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
25void ff_idct_sh4(DCTELEM *block);25void ff_idct_sh4(int16_t *block);
26void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx);26void ff_dsputil_init_align(DSPContext* c, AVCodecContext *avctx);
27 27
28#endif /* AVCODEC_SH4_DSPUTIL_SH4_H */28#endif /* AVCODEC_SH4_DSPUTIL_SH4_H */
libavcodec/sh4/idct_sh4.c+1−1
@@ -89,7 +89,7 @@ static const float odd_table[] __attribute__ ((aligned(8))) = { · 88 unmodified lines
89 89
90//optimized90//optimized
91 91
92void ff_idct_sh4(DCTELEM *block)92void ff_idct_sh4(int16_t *block)
93{93{
94 DEFREG;94 DEFREG;
95 95
libavcodec/simple_idct.c+9−9
@@ -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
53static inline void idct4col_put(uint8_t *dest, int line_size, const DCTELEM *col)53static 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 to86/* 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 DV87 compensate the extra butterfly stage - I don't have the full DV
88 specification */88 specification */
89void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block)89void 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)
132static inline void idct4col_add(uint8_t *dest, int line_size, const DCTELEM *col)132static 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 11158#define R_SHIFT 11
159static inline void idct4row(DCTELEM *row)159static 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
177void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block)177void 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
192void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block)192void 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
207void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block)207void 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
222void ff_prores_idct(DCTELEM *block, const int16_t *qmat)222void ff_prores_idct(int16_t *block, const int16_t *qmat)
223{223{
224 int i;224 int i;
225 225
libavcodec/simple_idct.h+11−12
@@ -29,30 +29,29 @@ · 28 unmodified lines
29#define AVCODEC_SIMPLE_IDCT_H29#define AVCODEC_SIMPLE_IDCT_H
30 30
31#include <stdint.h>31#include <stdint.h>
32#include "dsputil.h"
33 32
34void ff_simple_idct_put_8(uint8_t *dest, int line_size, DCTELEM *block);33void ff_simple_idct_put_8(uint8_t *dest, int line_size, int16_t *block);
35void ff_simple_idct_add_8(uint8_t *dest, int line_size, DCTELEM *block);34void ff_simple_idct_add_8(uint8_t *dest, int line_size, int16_t *block);
36void ff_simple_idct_8(DCTELEM *block);35void ff_simple_idct_8(int16_t *block);
37 36
38void ff_simple_idct_put_10(uint8_t *dest, int line_size, DCTELEM *block);37void ff_simple_idct_put_10(uint8_t *dest, int line_size, int16_t *block);
39void ff_simple_idct_add_10(uint8_t *dest, int line_size, DCTELEM *block);38void ff_simple_idct_add_10(uint8_t *dest, int line_size, int16_t *block);
40void ff_simple_idct_10(DCTELEM *block);39void ff_simple_idct_10(int16_t *block);
41/**40/**
42 * Special version of ff_simple_idct_10() which does dequantization41 * Special version of ff_simple_idct_10() which does dequantization
43 * and scales by a factor of 2 more between the two IDCTs to account42 * 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 */
46void ff_prores_idct(DCTELEM *block, const int16_t *qmat);45void ff_prores_idct(int16_t *block, const int16_t *qmat);
47 46
48void ff_simple_idct_mmx(int16_t *block);47void ff_simple_idct_mmx(int16_t *block);
49void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);48void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
50void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);49void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
51 50
52void ff_simple_idct248_put(uint8_t *dest, int line_size, DCTELEM *block);51void ff_simple_idct248_put(uint8_t *dest, int line_size, int16_t *block);
53 52
54void ff_simple_idct84_add(uint8_t *dest, int line_size, DCTELEM *block);53void ff_simple_idct84_add(uint8_t *dest, int line_size, int16_t *block);
55void ff_simple_idct48_add(uint8_t *dest, int line_size, DCTELEM *block);54void ff_simple_idct48_add(uint8_t *dest, int line_size, int16_t *block);
56void ff_simple_idct44_add(uint8_t *dest, int line_size, DCTELEM *block);55void 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 */
libavcodec/simple_idct_template.c+7−7
@@ -85,7 +85,7 @@ · 84 unmodified lines
85 85
86#endif86#endif
87 87
88static inline void FUNC(idctRowCondDC)(DCTELEM *row, int extra_shift)88static 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
223static inline void FUNC(idctSparseColPut)(pixel *dest, int line_size,223static 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
247static inline void FUNC(idctSparseColAdd)(pixel *dest, int line_size,247static 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
271static inline void FUNC(idctSparseCol)(DCTELEM *col)271static 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
287void FUNC(ff_simple_idct_put)(uint8_t *dest_, int line_size, DCTELEM *block)287void 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
301void FUNC(ff_simple_idct_add)(uint8_t *dest_, int line_size, DCTELEM *block)301void 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
315void FUNC(ff_simple_idct)(DCTELEM *block)315void FUNC(ff_simple_idct)(int16_t *block)
316{316{
317 int i;317 int i;
318 318
libavcodec/sparc/dsputil_vis.h+3−4
@@ -20,10 +20,9 @@ · 19 unmodified lines
20#define AVCODEC_SPARC_DSPUTIL_VIS_H20#define AVCODEC_SPARC_DSPUTIL_VIS_H
21 21
22#include <stdint.h>22#include <stdint.h>
23#include "libavcodec/dsputil.h"
24 23
25void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data);24void ff_simple_idct_put_vis(uint8_t *dest, int line_size, int16_t *data);
26void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data);25void ff_simple_idct_add_vis(uint8_t *dest, int line_size, int16_t *data);
27void ff_simple_idct_vis(DCTELEM *data);26void ff_simple_idct_vis(int16_t *data);
28 27
29#endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */28#endif /* AVCODEC_SPARC_DSPUTIL_VIS_H */
libavcodec/sparc/simple_idct_vis.c+3−3
@@ -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
391void ff_simple_idct_vis(DCTELEM *data) {391void 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
431void ff_simple_idct_put_vis(uint8_t *dest, int line_size, DCTELEM *data) {431void 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
481void ff_simple_idct_add_vis(uint8_t *dest, int line_size, DCTELEM *data) {481void 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
libavcodec/svq3.c+3−3
@@ -137,7 +137,7 @@ static const uint32_t svq3_dequant_coeff[32] = { · 136 unmodified lines
137 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533137 61694, 68745, 77615, 89113, 100253, 109366, 126635, 141533
138};138};
139 139
140void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp)140void 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 16143#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 stride173#undef stride
174 174
175void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block,175void 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
213static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,213static 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] =
libavcodec/vc1.h+1−1
@@ -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;
libavcodec/vc1dec.c+5−5
@@ -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 not2538 * @param coded are AC coeffs present or not
2539 * @param codingset set of VLC to decode data2539 * @param codingset set of VLC to decode data
2540 */2540 */
2541static int vc1_decode_i_block(VC1Context *v, DCTELEM block[64], int n,2541static 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 data2701 * @param codingset set of VLC to decode data
2702 * @param mquant quantizer value for this macroblock2702 * @param mquant quantizer value for this macroblock
2703 */2703 */
2704static int vc1_decode_i_block_adv(VC1Context *v, DCTELEM block[64], int n,2704static 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 quantizer2913 * @param mquant block quantizer
2914 * @param codingset set of VLC to decode data2914 * @param codingset set of VLC to decode data
2915 */2915 */
2916static int vc1_decode_intra_block(VC1Context *v, DCTELEM block[64], int n,2916static 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 block3124/** Decode P block
3125 */3125 */
3126static int vc1_decode_p_block(VC1Context *v, DCTELEM block[64], int n,3126static 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;
libavcodec/vc1dsp.c+14−14
@@ -79,7 +79,7 @@ static void vc1_h_overlap_c(uint8_t* src, int stride) · 78 unmodified lines
79 }79 }
80}80}
81 81
82static void vc1_v_s_overlap_c(DCTELEM *top, DCTELEM *bottom)82static 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
108static void vc1_h_s_overlap_c(DCTELEM *left, DCTELEM *right)108static 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 block230/** Do inverse transform on 8x8 block
231*/231*/
232static void vc1_inv_trans_8x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block)232static 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
251static void vc1_inv_trans_8x8_c(DCTELEM block[64])251static 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 block320/** Do inverse transform on 8x4 part of block
321*/321*/
322static void vc1_inv_trans_8x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)322static 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
341static void vc1_inv_trans_8x4_c(uint8_t *dest, int linesize, DCTELEM *block)341static 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 block395/** Do inverse transform on 4x8 parts of block
396*/396*/
397static void vc1_inv_trans_4x8_dc_c(uint8_t *dest, int linesize, DCTELEM *block)397static 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
412static void vc1_inv_trans_4x8_c(uint8_t *dest, int linesize, DCTELEM *block)412static 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 block466/** Do inverse transform on 4x4 part of block
467*/467*/
468static void vc1_inv_trans_4x4_dc_c(uint8_t *dest, int linesize, DCTELEM *block)468static 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
483static void vc1_inv_trans_4x4_c(uint8_t *dest, int linesize, DCTELEM *block)483static 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;
libavcodec/vc1dsp.h+10−10
@@ -32,18 +32,18 @@ · 31 unmodified lines
32 32
33typedef struct VC1DSPContext {33typedef 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);
libavcodec/vp3.c+4−4
@@ -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 order1350 * for the next block in coding order
1351 */1351 */
1352static inline int vp3_dequant(Vp3DecodeContext *s, Vp3Fragment *frag,1352static 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
1459static void render_slice(Vp3DecodeContext *s, int slice)1459static 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;
libavcodec/vp3dsp.c+8−3
@@ -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
216static void vp3_idct_put_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){216static 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
221static void vp3_idct_add_c(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/){223static 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
226static void vp3_idct_dc_add_c(uint8_t *dest/*align 8*/, int line_size,230static 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++){
libavcodec/vp3dsp.h+3−4
@@ -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
26typedef struct VP3DSPContext {25typedef 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
libavcodec/vp56.h+3−3
@@ -67,7 +67,7 @@ typedef struct VP56RangeCoder { · 66 unmodified lines
67typedef struct VP56RefDc {67typedef 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
73typedef struct VP56Macroblock {73typedef 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 */
libavcodec/vp8.c+2−2
@@ -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 decoded760 * @return 0 if no coeffs were decoded
761 * otherwise, the index of the last coeff decoded plus one761 * otherwise, the index of the last coeff decoded plus one
762 */762 */
763static int decode_block_coeffs_internal(VP56RangeCoder *r, DCTELEM block[16],763static 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 one828 * otherwise, the index of the last coeff decoded plus one
829 */829 */
830static av_always_inline830static av_always_inline
831int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16],831int 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{
libavcodec/vp8.h+2−2
@@ -94,8 +94,8 @@ typedef struct VP8Macroblock { · 93 unmodified lines
94} VP8Macroblock;94} VP8Macroblock;
95 95
96typedef struct VP8ThreadData {96typedef 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 coeff100 * 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.
libavcodec/vp8dsp.c+7−7
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#include "libavutil/common.h"29#include "libavutil/common.h"
30 30
31// TODO: Maybe add dequant31// TODO: Maybe add dequant
32static void vp8_luma_dc_wht_c(DCTELEM block[4][4][16], DCTELEM dc[16])32static 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
65static void vp8_luma_dc_wht_dc_c(DCTELEM block[4][4][16], DCTELEM dc[16])65static 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
81static void vp8_idct_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride)81static 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
116static void vp8_idct_dc_add_c(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride)116static 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
130static void vp8_idct_dc_add4uv_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride)130static 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
138static void vp8_idct_dc_add4y_c(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride)138static 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);
libavcodec/vp8dsp.h+8−7
@@ -27,20 +27,21 @@ · 26 unmodified lines
27#ifndef AVCODEC_VP8DSP_H27#ifndef AVCODEC_VP8DSP_H
28#define AVCODEC_VP8DSP_H28#define AVCODEC_VP8DSP_H
29 29
30#include "dsputil.h"30#include <stddef.h>
31#include <stdint.h>
31 32
32typedef void (*vp8_mc_func)(uint8_t *dst/*align 8*/, ptrdiff_t dstStride,33typedef 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
36typedef struct VP8DSPContext {37typedef 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 macroblocks47 // loop filter applied to edges between macroblocks
libavcodec/wmv2.c+2−2
@@ -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
51static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){51static 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
75void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr){75void 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);
libavcodec/wmv2.h+1−1
@@ -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
58void ff_wmv2_common_init(Wmv2Context * w);58void ff_wmv2_common_init(Wmv2Context * w);
libavcodec/wmv2dec.c+2−2
@@ -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
294static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, int cbp){294static 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
334int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64])334int 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;
libavcodec/wmv2dsp.c+3−2
@@ -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 204825#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
94static void wmv2_idct_add_c(uint8_t *dest, int line_size, DCTELEM *block)95static 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
117static void wmv2_idct_put_c(uint8_t *dest, int line_size, DCTELEM *block)118static void wmv2_idct_put_c(uint8_t *dest, int line_size, int16_t *block)
118{119{
119 int i;120 int i;
120 121
libavcodec/wmv2dsp.h+2−3
@@ -20,11 +20,10 @@ · 19 unmodified lines
20#define AVCODEC_WMV2DSP_H20#define AVCODEC_WMV2DSP_H
21 21
22#include <stdint.h>22#include <stdint.h>
23#include "dsputil.h"
24 23
25typedef struct WMV2DSPContext {24typedef 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;
libavcodec/wmv2enc.c+1−1
@@ -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 wants148 * 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. */
150void ff_wmv2_encode_mb(MpegEncContext * s,150void 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;
libavcodec/x86/dnxhdenc.c+1−1
@@ -26,7 +26,7 @@ · 25 unmodified lines
26 26
27#if HAVE_SSE2_INLINE27#if HAVE_SSE2_INLINE
28 28
29static void get_pixels_8x4_sym_sse2(DCTELEM *block, const uint8_t *pixels, int line_size)29static 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"
libavcodec/x86/dsputil_mmx.c+8−8
@@ -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
228void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels,228void 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
303void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels,303void 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
320void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels,320void 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) \
425static void name(DCTELEM *blocks) \425static 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
442CLEAR_BLOCKS(clear_blocks_mmx, 6)442CLEAR_BLOCKS(clear_blocks_mmx, 6)
443CLEAR_BLOCKS(clear_block_mmx, 1)443CLEAR_BLOCKS(clear_block_mmx, 1)
444 444
445static void clear_block_sse(DCTELEM *block)445static 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
462static void clear_blocks_sse(DCTELEM *blocks)462static 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"
libavcodec/x86/dsputil_mmx.h+3−3
@@ -83,9 +83,9 @@ extern const double ff_pd_2[2]; · 82 unmodified lines
83void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);83void ff_dsputilenc_init_mmx(DSPContext* c, AVCodecContext *avctx);
84void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);84void ff_dsputil_init_pix_mmx(DSPContext* c, AVCodecContext *avctx);
85 85
86void ff_add_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);86void ff_add_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
87void ff_put_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);87void ff_put_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
88void ff_put_signed_pixels_clamped_mmx(const DCTELEM *block, uint8_t *pixels, int line_size);88void ff_put_signed_pixels_clamped_mmx(const int16_t *block, uint8_t *pixels, int line_size);
89 89
90void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);90void ff_put_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
91void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);91void ff_avg_cavs_qpel8_mc00_mmxext(uint8_t *dst, uint8_t *src, int stride);
libavcodec/x86/dsputilenc.asm+2−2
@@ -335,7 +335,7 @@ cglobal sse16, 5, 5, 8 · 334 unmodified lines
335 RET335 RET
336 336
337INIT_MMX mmx337INIT_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)
339cglobal get_pixels, 3,4339cglobal get_pixels, 3,4
340 movsxdifnidn r2, r2d340 movsxdifnidn r2, r2d
341 add r0, 128341 add r0, 128
@@ -392,7 +392,7 @@ cglobal get_pixels, 3, 4 · 50 unmodified lines
392 RET392 RET
393 393
394INIT_MMX mmx394INIT_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)
396cglobal diff_pixels, 4,5396cglobal diff_pixels, 4,5
397 movsxdifnidn r3, r3d397 movsxdifnidn r3, r3d
398 pxor m7, m7398 pxor m7, m7
libavcodec/x86/dsputilenc_mmx.c+4−4
@@ -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
33void ff_get_pixels_mmx(DCTELEM *block, const uint8_t *pixels, int line_size);33void ff_get_pixels_mmx(int16_t *block, const uint8_t *pixels, int line_size);
34void ff_get_pixels_sse2(DCTELEM *block, const uint8_t *pixels, int line_size);34void ff_get_pixels_sse2(int16_t *block, const uint8_t *pixels, int line_size);
35void ff_diff_pixels_mmx(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);35void ff_diff_pixels_mmx(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride);
36int ff_pix_sum16_mmx(uint8_t * pix, int line_size);36int ff_pix_sum16_mmx(uint8_t * pix, int line_size);
37int ff_pix_norm1_mmx(uint8_t *pix, int line_size);37int 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) \
800static int sum_abs_dctelem_##cpu(DCTELEM *block){\800static 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\
libavcodec/x86/h264_idct.asm+13−13
@@ -302,7 +302,7 @@ cglobal h264_idct8_dc_add_8, 3, 3, 0 · 301 unmodified lines
302 302
303INIT_MMX mmx303INIT_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])
306cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg306cglobal h264_idct_add16_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
307 xor r5, r5307 xor r5, r5
308%ifdef PIC308%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_RET324 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])
328cglobal h264_idct8_add4_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg328cglobal 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, pad330 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
358INIT_MMX mmxext358INIT_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])
361cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg361cglobal h264_idct_add16_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
362 xor r5, r5362 xor r5, r5
363%ifdef PIC363%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
403INIT_MMX mmx403INIT_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])
406cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg406cglobal h264_idct_add16intra_8, 5, 7 + npicregs, 0, dst, block_offset, block, stride, nnzc, cntr, coeff, picreg
407 xor r5, r5407 xor r5, r5
408%ifdef PIC408%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
427INIT_MMX mmxext427INIT_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])
431cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg431cglobal h264_idct_add16intra_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
432 xor r5, r5432 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_RET469 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])
474cglobal h264_idct8_add4_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg474cglobal 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
531INIT_XMM sse2531INIT_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])
534cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg534cglobal h264_idct8_add4_8, 5, 8 + npicregs, 10, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
535 xor r5, r5535 xor r5, r5
536%ifdef PIC536%ifdef PIC
@@ -605,7 +605,7 @@ h264_idct_add8_mmx_plane: · 68 unmodified lines
605 rep ret605 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])
609cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg609cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
610 mov r5, 16610 mov r5, 16
611 add r2, 512611 add r2, 512
@@ -669,7 +669,7 @@ h264_idct_add8_mmxext_plane: · 57 unmodified lines
669 669
670INIT_MMX mmxext670INIT_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])
673cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg673cglobal h264_idct_add8_8, 5, 8 + npicregs, 0, dst1, block_offset, block, stride, nnzc, cntr, coeff, dst2, picreg
674 mov r5, 16674 mov r5, 16
675 add r2, 512675 add r2, 512
@@ -746,7 +746,7 @@ h264_add8x4_idct_sse2: · 70 unmodified lines
746%endmacro746%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])
750cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8750cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8
751%if ARCH_X86_64751%if ARCH_X86_64
752 mov r5, r0752 mov r5, r0
@@ -793,7 +793,7 @@ cglobal h264_idct_add16_8, 5, 5 + ARCH_X86_64, 8 · 40 unmodified lines
793%endmacro793%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])
797cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8797cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8
798%if ARCH_X86_64798%if ARCH_X86_64
799 mov r7, r0799 mov r7, r0
@@ -844,7 +844,7 @@ cglobal h264_idct_add16intra_8, 5, 7 + ARCH_X86_64, 8 · 44 unmodified lines
844%endmacro844%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])
848cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8848cglobal h264_idct_add8_8, 5, 7 + ARCH_X86_64, 8
849 add r2, 512849 add r2, 512
850%if ARCH_X86_64850%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, 0x64861 add8_sse2_cycle 3, 0x64
862 RET862 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 5866%macro WALSH4_1D 5
867 SUMSUB_BADC w, %4, %3, %2, %1, %5867 SUMSUB_BADC w, %4, %3, %2, %1, %5
libavcodec/x86/h264_intrapred_init.c+1−0
@@ -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) \
libavcodec/x86/h264dsp_init.c+4−4
@@ -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) \
49void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \49void 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
53IDCT_ADD_REP_FUNC(8, 4, 8, mmx)53IDCT_ADD_REP_FUNC(8, 4, 8, mmx)
54IDCT_ADD_REP_FUNC(8, 4, 8, mmxext)54IDCT_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) \
71void ff_h264_idct ## NUM ## _add ## REP ## _ ## DEPTH ## _ ## OPT \71void 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
75IDCT_ADD_REP_FUNC2(, 8, 8, mmx)75IDCT_ADD_REP_FUNC2(, 8, 8, mmx)
76IDCT_ADD_REP_FUNC2(, 8, 8, mmxext)76IDCT_ADD_REP_FUNC2(, 8, 8, mmxext)
@@ -78,8 +78,8 @@ IDCT_ADD_REP_FUNC2(, 8, 8, sse2) · 1 unmodified line
78IDCT_ADD_REP_FUNC2(, 8, 10, sse2)78IDCT_ADD_REP_FUNC2(, 8, 10, sse2)
79IDCT_ADD_REP_FUNC2(, 8, 10, avx)79IDCT_ADD_REP_FUNC2(, 8, 10, avx)
80 80
81void ff_h264_luma_dc_dequant_idct_mmx(DCTELEM *output, DCTELEM *input, int qmul);81void ff_h264_luma_dc_dequant_idct_mmx(int16_t *output, int16_t *input, int qmul);
82void ff_h264_luma_dc_dequant_idct_sse2(DCTELEM *output, DCTELEM *input, int qmul);82void ff_h264_luma_dc_dequant_idct_sse2(int16_t *output, int16_t *input, int qmul);
83 83
84/***********************************/84/***********************************/
85/* deblocking */85/* deblocking */
libavcodec/x86/idct_mmx_xvid.c+4−4
@@ -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
534void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block)534void 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
540void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block)540void 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
546void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block)546void 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
552void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block)552void 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);
libavcodec/x86/idct_xvid.h+4−6
@@ -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
33void ff_idct_xvid_mmx(short *block);31void ff_idct_xvid_mmx(short *block);
34void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block);32void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, int16_t *block);
35void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block);33void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, int16_t *block);
36 34
37void ff_idct_xvid_mmxext(short *block);35void ff_idct_xvid_mmxext(short *block);
38void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, DCTELEM *block);36void ff_idct_xvid_mmxext_put(uint8_t *dest, int line_size, int16_t *block);
39void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, DCTELEM *block);37void ff_idct_xvid_mmxext_add(uint8_t *dest, int line_size, int16_t *block);
40 38
41void ff_idct_xvid_sse2(short *block);39void ff_idct_xvid_sse2(short *block);
42void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block);40void ff_idct_xvid_sse2_put(uint8_t *dest, int line_size, short *block);
libavcodec/x86/mpegvideo.c+8−8
@@ -29,7 +29,7 @@ · 28 unmodified lines
29#if HAVE_INLINE_ASM29#if HAVE_INLINE_ASM
30 30
31static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,31static 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
106static void dct_unquantize_h263_inter_mmx(MpegEncContext *s,106static 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 += tlow1195 high3 += tlow1
196*/196*/
197static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s,197static 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
266static void dct_unquantize_mpeg1_inter_mmx(MpegEncContext *s,266static 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
332static void dct_unquantize_mpeg2_intra_mmx(MpegEncContext *s,332static 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
398static void dct_unquantize_mpeg2_inter_mmx(MpegEncContext *s,398static 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
475static void denoise_dct_mmx(MpegEncContext *s, DCTELEM *block){475static 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
529static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){529static 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];
libavcodec/x86/mpegvideoenc_template.c+1−1
@@ -92,7 +92,7 @@ · 91 unmodified lines
92#endif92#endif
93 93
94static int RENAME(dct_quantize)(MpegEncContext *s,94static 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;
libavcodec/x86/proresdsp.asm+1−1
@@ -327,7 +327,7 @@ section .text align=16 · 326 unmodified lines
327%endmacro327%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 1331%macro idct_put_fn 1
332cglobal prores_idct_put_10, 4, 4, %1332cglobal prores_idct_put_10, 4, 4, %1
333 movsxd r1, r1d333 movsxd r1, r1d
libavcodec/x86/proresdsp_init.c+4−3
@@ -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
26void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,27void 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);
28void ff_prores_idct_put_10_sse4(uint16_t *dst, int linesize,29void 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);
30void ff_prores_idct_put_10_avx (uint16_t *dst, int linesize,31void 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
33void ff_proresdsp_x86_init(ProresDSPContext *dsp)34void ff_proresdsp_x86_init(ProresDSPContext *dsp)
34{35{
libavcodec/x86/rv34dsp.asm+1−1
@@ -133,7 +133,7 @@ cglobal rv34_idct_dc_add, 3, 3 · 132 unmodified lines
133 mova mm5, [pd_512] ; 0x200133 mova mm5, [pd_512] ; 0x200
134%endmacro134%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 4137%macro COL_TRANSFORM 4
138 pshufw mm3, %2, 0xDD ; col. 1,3,1,3138 pshufw mm3, %2, 0xDD ; col. 1,3,1,3
139 pshufw %2, %2, 0x88 ; col. 0,2,0,2139 pshufw %2, %2, 0x88 ; col. 0,2,0,2
libavcodec/x86/rv34dsp_init.c+3−3
@@ -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
28void ff_rv34_idct_dc_mmxext(DCTELEM *block);28void ff_rv34_idct_dc_mmxext(int16_t *block);
29void ff_rv34_idct_dc_noround_mmxext(DCTELEM *block);29void ff_rv34_idct_dc_noround_mmxext(int16_t *block);
30void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc);30void ff_rv34_idct_dc_add_mmx(uint8_t *dst, ptrdiff_t stride, int dc);
31void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc);31void ff_rv34_idct_dc_add_sse4(uint8_t *dst, ptrdiff_t stride, int dc);
32void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, DCTELEM *block);32void ff_rv34_idct_add_mmxext(uint8_t *dst, ptrdiff_t stride, int16_t *block);
33 33
34av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp)34av_cold void ff_rv34dsp_init_x86(RV34DSPContext* c, DSPContext *dsp)
35{35{
libavcodec/x86/simple_idct.c+2−2
@@ -1155,12 +1155,12 @@ void ff_simple_idct_mmx(int16_t *block) · 1154 unmodified lines
1155 1155
1156//FIXME merge add/put into the idct1156//FIXME merge add/put into the idct
1157 1157
1158void ff_simple_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block)1158void 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}
1163void ff_simple_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)1163void 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);
libavcodec/x86/vc1dsp_mmx.c+4−4
@@ -494,7 +494,7 @@ DECLARE_FUNCTION(3, 2) · 493 unmodified lines
494DECLARE_FUNCTION(3, 3)494DECLARE_FUNCTION(3, 3)
495 495
496static void vc1_inv_trans_4x4_dc_mmxext(uint8_t *dest, int linesize,496static 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
535static void vc1_inv_trans_4x8_dc_mmxext(uint8_t *dest, int linesize,535static 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
597static void vc1_inv_trans_8x4_dc_mmxext(uint8_t *dest, int linesize,597static 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
636static void vc1_inv_trans_8x8_dc_mmxext(uint8_t *dest, int linesize,636static 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;
libavcodec/x86/vp3dsp_init.c+6−5
@@ -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
28void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, DCTELEM *block);29void ff_vp3_idct_put_mmx(uint8_t *dest, int line_size, int16_t *block);
29void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block);30void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, int16_t *block);
30 31
31void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, DCTELEM *block);32void ff_vp3_idct_put_sse2(uint8_t *dest, int line_size, int16_t *block);
32void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, DCTELEM *block);33void ff_vp3_idct_add_sse2(uint8_t *dest, int line_size, int16_t *block);
33 34
34void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size,35void ff_vp3_idct_dc_add_mmxext(uint8_t *dest, int line_size,
35 DCTELEM *block);36 int16_t *block);
36 37
37void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,38void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,
38 int *bounding_values);39 int *bounding_values);
libavcodec/x86/vp8dsp.asm+5−5
@@ -899,7 +899,7 @@ cglobal put_vp8_pixels16, 5, 5, 2, dst, dststride, src, srcstride, height · 898 unmodified lines
899 REP_RET899 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 4905%macro ADD_DC 4
@@ -977,7 +977,7 @@ cglobal vp8_idct_dc_add, 3, 3, 6, dst, block, stride · 71 unmodified lines
977 RET977 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_32983%if ARCH_X86_32
@@ -1050,7 +1050,7 @@ cglobal vp8_idct_dc_add4y, 3, 3, 6, dst, block, stride · 66 unmodified lines
1050 RET1050 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
1056INIT_MMX mmx1056INIT_MMX mmx
@@ -1092,7 +1092,7 @@ cglobal vp8_idct_dc_add4uv, 3, 3, 0, dst, block, stride · 35 unmodified lines
1092 RET1092 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
1172VP8_IDCT_ADD1172VP8_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 31178%macro SCATTER_WHT 3
libavcodec/x86/vp8dsp_init.c+9−9
@@ -230,21 +230,21 @@ HVBILIN(ssse3, 8, 4, 8) · 229 unmodified lines
230HVBILIN(ssse3, 8, 8, 16)230HVBILIN(ssse3, 8, 8, 16)
231HVBILIN(ssse3, 8, 16, 16)231HVBILIN(ssse3, 8, 16, 16)
232 232
233extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, DCTELEM block[16],233extern void ff_vp8_idct_dc_add_mmx(uint8_t *dst, int16_t block[16],
234 ptrdiff_t stride);234 ptrdiff_t stride);
235extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, DCTELEM block[16],235extern void ff_vp8_idct_dc_add_sse4(uint8_t *dst, int16_t block[16],
236 ptrdiff_t stride);236 ptrdiff_t stride);
237extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, DCTELEM block[4][16],237extern void ff_vp8_idct_dc_add4y_mmx(uint8_t *dst, int16_t block[4][16],
238 ptrdiff_t stride);238 ptrdiff_t stride);
239extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, DCTELEM block[4][16],239extern void ff_vp8_idct_dc_add4y_sse2(uint8_t *dst, int16_t block[4][16],
240 ptrdiff_t stride);240 ptrdiff_t stride);
241extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, DCTELEM block[2][16],241extern void ff_vp8_idct_dc_add4uv_mmx(uint8_t *dst, int16_t block[2][16],
242 ptrdiff_t stride);242 ptrdiff_t stride);
243extern void ff_vp8_luma_dc_wht_mmx(DCTELEM block[4][4][16], DCTELEM dc[16]);243extern void ff_vp8_luma_dc_wht_mmx(int16_t block[4][4][16], int16_t dc[16]);
244extern void ff_vp8_luma_dc_wht_sse(DCTELEM block[4][4][16], DCTELEM dc[16]);244extern void ff_vp8_luma_dc_wht_sse(int16_t block[4][4][16], int16_t dc[16]);
245extern void ff_vp8_idct_add_mmx(uint8_t *dst, DCTELEM block[16],245extern void ff_vp8_idct_add_mmx(uint8_t *dst, int16_t block[16],
246 ptrdiff_t stride);246 ptrdiff_t stride);
247extern void ff_vp8_idct_add_sse(uint8_t *dst, DCTELEM block[16],247extern 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)\
tools/patcheck+1−1
@@ -173,7 +173,7 @@ vertical align = · 172 unmodified lines
173/* and * align173/* and * align
174arrays fitting in smaller types174arrays fitting in smaller types
175variables written to twice with no interspaced read175variables written to twice with no interspaced read
176memset(block, 0, 6*64*sizeof(DCTELEM)); -> clear_blocks176memset(block, 0, 6*64*sizeof(int16_t)); -> clear_blocks
177check existence of long_name in AVCodec177check existence of long_name in AVCodec
178check that the patch does not touch codec & (de)muxer layer at the same time ->split178check that the patch does not touch codec & (de)muxer layer at the same time ->split
179 179

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t