Merge commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f'

* commit '88bd7fdc821aaa0cbcf44cf075c62aaa42121e3f':
  Drop DCTELEM typedef

Conflicts:
	libavcodec/alpha/dsputil_alpha.h
	libavcodec/alpha/motion_est_alpha.c
	libavcodec/arm/dsputil_init_armv6.c
	libavcodec/bfin/dsputil_bfin.h
	libavcodec/bfin/pixels_bfin.S
	libavcodec/cavs.c
	libavcodec/cavsdec.c
	libavcodec/dct-test.c
	libavcodec/dnxhdenc.c
	libavcodec/dsputil.c
	libavcodec/dsputil.h
	libavcodec/dsputil_template.c
	libavcodec/eamad.c
	libavcodec/h264_cavlc.c
	libavcodec/h264idct_template.c
	libavcodec/mpeg12.c
	libavcodec/mpegvideo.c
	libavcodec/mpegvideo.h
	libavcodec/mpegvideo_enc.c
	libavcodec/ppc/dsputil_altivec.c
	libavcodec/proresdsp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
pull/28/head^2
Michael Niedermayer 12 years ago
commit ac8987591f
  1. 2
      doc/optimization.txt
  2. 10
      libavcodec/4xm.c
  3. 12
      libavcodec/alpha/dsputil_alpha.c
  4. 22
      libavcodec/alpha/dsputil_alpha.h
  5. 4
      libavcodec/alpha/dsputil_alpha_asm.S
  6. 6
      libavcodec/alpha/motion_est_alpha.c
  7. 8
      libavcodec/alpha/mpegvideo_alpha.c
  8. 12
      libavcodec/alpha/simple_idct_alpha.c
  9. 18
      libavcodec/arm/dsputil_init_arm.c
  10. 6
      libavcodec/arm/dsputil_init_armv5te.c
  11. 14
      libavcodec/arm/dsputil_init_armv6.c
  12. 16
      libavcodec/arm/dsputil_init_neon.c
  13. 16
      libavcodec/arm/h264dsp_init_arm.c
  14. 2
      libavcodec/arm/jrevdct_arm.S
  15. 4
      libavcodec/arm/mpegvideo_arm.c
  16. 8
      libavcodec/arm/mpegvideo_armv5te.c
  17. 6
      libavcodec/arm/rv34dsp_init_arm.c
  18. 6
      libavcodec/arm/rv34dsp_neon.S
  19. 6
      libavcodec/arm/simple_idct_armv6.S
  20. 6
      libavcodec/arm/simple_idct_neon.S
  21. 6
      libavcodec/arm/vp3dsp_init_arm.c
  22. 2
      libavcodec/arm/vp8.h
  23. 12
      libavcodec/arm/vp8dsp_armv6.S
  24. 12
      libavcodec/arm/vp8dsp_init_armv6.c
  25. 10
      libavcodec/arm/vp8dsp_init_neon.c
  26. 2
      libavcodec/asv.h
  27. 8
      libavcodec/asvdec.c
  28. 8
      libavcodec/asvenc.c
  29. 2
      libavcodec/bfin/config_bfin.h
  30. 6
      libavcodec/bfin/dsputil_bfin.c
  31. 21
      libavcodec/bfin/dsputil_bfin.h
  32. 8
      libavcodec/bfin/fdct_bfin.S
  33. 4
      libavcodec/bfin/idct_bfin.S
  34. 2
      libavcodec/bfin/mpegvideo_bfin.c
  35. 8
      libavcodec/bfin/pixels_bfin.S
  36. 4
      libavcodec/bfin/vp3_bfin.c
  37. 4
      libavcodec/bfin/vp3_idct_bfin.S
  38. 6
      libavcodec/bink.c
  39. 2
      libavcodec/cavs.c
  40. 2
      libavcodec/cavs.h
  41. 8
      libavcodec/cavsdec.c
  42. 4
      libavcodec/cavsdsp.c
  43. 2
      libavcodec/cavsdsp.h
  44. 39
      libavcodec/dct-test.c
  45. 14
      libavcodec/dnxhddec.c
  46. 20
      libavcodec/dnxhdenc.c
  47. 4
      libavcodec/dnxhdenc.h
  48. 55
      libavcodec/dsputil.c
  49. 97
      libavcodec/dsputil.h
  50. 14
      libavcodec/dsputil_template.c
  51. 4
      libavcodec/dv.c
  52. 6
      libavcodec/dvdata.h
  53. 8
      libavcodec/dvdec.c
  54. 6
      libavcodec/eaidct.c
  55. 3
      libavcodec/eaidct.h
  56. 6
      libavcodec/eamad.c
  57. 6
      libavcodec/eatgq.c
  58. 6
      libavcodec/eatqi.c
  59. 6
      libavcodec/faandct.c
  60. 6
      libavcodec/faandct.h
  61. 8
      libavcodec/faanidct.c
  62. 7
      libavcodec/faanidct.h
  63. 4
      libavcodec/h261dec.c
  64. 8
      libavcodec/h261enc.c
  65. 2
      libavcodec/h263.c
  66. 8
      libavcodec/h263.h
  67. 10
      libavcodec/h264.c
  68. 7
      libavcodec/h264.h
  69. 36
      libavcodec/h264_cabac.c
  70. 6
      libavcodec/h264_cavlc.c
  71. 2
      libavcodec/h264_mb_template.c
  72. 24
      libavcodec/h264dsp.h
  73. 32
      libavcodec/h264idct_template.c
  74. 12
      libavcodec/h264pred.h
  75. 20
      libavcodec/h264pred_template.c
  76. 6
      libavcodec/ituh263dec.c
  77. 4
      libavcodec/ituh263enc.c
  78. 18
      libavcodec/jfdctfst.c
  79. 28
      libavcodec/jfdctint_template.c
  80. 50
      libavcodec/jrevdct.c
  81. 8
      libavcodec/mdec.c
  82. 4
      libavcodec/mimic.c
  83. 12
      libavcodec/mjpegdec.c
  84. 4
      libavcodec/mjpegdec.h
  85. 4
      libavcodec/mjpegenc.c
  86. 5
      libavcodec/mjpegenc.h
  87. 20
      libavcodec/mpeg12.c
  88. 2
      libavcodec/mpeg12.h
  89. 8
      libavcodec/mpeg12enc.c
  90. 4
      libavcodec/mpeg4video.h
  91. 8
      libavcodec/mpeg4videodec.c
  92. 16
      libavcodec/mpeg4videoenc.c
  93. 44
      libavcodec/mpegvideo.c
  94. 50
      libavcodec/mpegvideo.h
  95. 34
      libavcodec/mpegvideo_enc.c
  96. 2
      libavcodec/mpegvideo_xvmc.c
  97. 6
      libavcodec/msmpeg4.c
  98. 7
      libavcodec/msmpeg4.h
  99. 4
      libavcodec/msmpeg4enc.c
  100. 6
      libavcodec/ppc/dsputil_altivec.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -148,7 +148,7 @@ Alignment:
Some instructions on some architectures have strict alignment restrictions,
for example most SSE/SSE2 instructions on x86.
The minimum guaranteed alignment is written in the .h files, for example:
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, UINT8 *pixels/*align 8*/, int line_size);
General Tips:

@ -138,7 +138,7 @@ typedef struct FourXContext {
int mv[256];
VLC pre_vlc;
int last_dc;
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
DECLARE_ALIGNED(16, int16_t, block)[6][64];
void *bitstream_buffer;
unsigned int bitstream_buffer_size;
int version;
@ -153,7 +153,7 @@ typedef struct FourXContext {
#define MULTIPLY(var, const) (((var) * (const)) >> 16)
static void idct(DCTELEM block[64])
static void idct(int16_t block[64])
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
@ -471,7 +471,7 @@ static int decode_p_frame(FourXContext *f, const uint8_t *buf, int length)
* decode block and dequantize.
* Note this is almost identical to MJPEG.
*/
static int decode_i_block(FourXContext *f, DCTELEM *block)
static int decode_i_block(FourXContext *f, int16_t *block)
{
int code, i, j, level, val;
@ -521,7 +521,7 @@ static int decode_i_block(FourXContext *f, DCTELEM *block)
static inline void idct_put(FourXContext *f, int x, int y)
{
DCTELEM (*block)[64] = f->block;
int16_t (*block)[64] = f->block;
int stride = f->current_picture->linesize[0] >> 1;
int i;
uint16_t *dst = ((uint16_t*)f->current_picture->data[0]) + y * stride + x;
@ -542,7 +542,7 @@ static inline void idct_put(FourXContext *f, int x, int y)
* cr = (-1b - 4g + 5r) / 14 */
for (y = 0; y < 8; y++) {
for (x = 0; x < 8; x++) {
DCTELEM *temp = block[(x >> 2) + 2 * (y >> 2)] +
int16_t *temp = block[(x >> 2) + 2 * (y >> 2)] +
2 * (x & 3) + 2 * 8 * (y & 3); // FIXME optimize
int cb = block[4][x + 8 * y];
int cr = block[5][x + 8 * y];

@ -23,15 +23,15 @@
#include "dsputil_alpha.h"
#include "asm.h"
void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
#if 0
/* These functions were the base for the optimized assembler routines,
and remain here for documentation purposes. */
static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
static void put_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
int line_size)
{
int i = 8;
@ -55,7 +55,7 @@ static void put_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
} while (--i);
}
void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,
int line_size)
{
int h = 8;
@ -100,9 +100,9 @@ void add_pixels_clamped_mvi(const DCTELEM *block, uint8_t *pixels,
}
#endif
static void clear_blocks_axp(DCTELEM *blocks) {
static void clear_blocks_axp(int16_t *blocks) {
uint64_t *p = (uint64_t *) blocks;
int n = sizeof(DCTELEM) * 6 * 64;
int n = sizeof(int16_t) * 6 * 64;
do {
p[0] = 0;

@ -19,26 +19,26 @@
#ifndef AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#define AVCODEC_ALPHA_DSPUTIL_ALPHA_H
#include "libavcodec/dsputil.h"
#include <stdint.h>
void ff_simple_idct_axp(DCTELEM *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block);
void ff_simple_idct_axp(int16_t *block);
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block);
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block);
void put_pixels_axp_asm(uint8_t *block, const uint8_t *pixels,
int line_size, int h);
void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
int line_size);
extern void (*put_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
extern void (*put_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
extern void (*add_pixels_clamped_axp_p)(const DCTELEM *block, uint8_t *pixels,
extern void (*add_pixels_clamped_axp_p)(const int16_t *block, uint8_t *pixels,
int line_size);
void get_pixels_mvi(DCTELEM *av_restrict block,
const uint8_t *av_restrict pixels, int line_size);
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, int line_size);
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride);
int pix_abs8x8_mvi(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);
int pix_abs16x16_mvi_asm(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h);

@ -135,7 +135,7 @@ $aligned:
.end put_pixels_axp_asm
/************************************************************************
* void put_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* void put_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
* int line_size)
*/
.align 6
@ -185,7 +185,7 @@ put_pixels_clamped_mvi_asm:
.end put_pixels_clamped_mvi_asm
/************************************************************************
* void add_pixels_clamped_mvi_asm(const DCTELEM *block, uint8_t *pixels,
* void add_pixels_clamped_mvi_asm(const int16_t *block, uint8_t *pixels,
* int line_size)
*/
.align 6

@ -23,8 +23,8 @@
#include "dsputil_alpha.h"
#include "asm.h"
void get_pixels_mvi(DCTELEM *av_restrict block,
const uint8_t *av_restrict pixels, int line_size)
void get_pixels_mvi(int16_t *restrict block,
const uint8_t *restrict pixels, int line_size)
{
int h = 8;
@ -40,7 +40,7 @@ void get_pixels_mvi(DCTELEM *av_restrict block,
} while (--h);
}
void diff_pixels_mvi(DCTELEM *block, const uint8_t *s1, const uint8_t *s2,
void diff_pixels_mvi(int16_t *block, const uint8_t *s1, const uint8_t *s2,
int stride) {
int h = 8;
uint64_t mask = 0x4040;

@ -23,7 +23,7 @@
#include "libavcodec/mpegvideo.h"
#include "asm.h"
static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,
static void dct_unquantize_h263_axp(int16_t *block, int n_coeffs,
uint64_t qscale, uint64_t qadd)
{
uint64_t qmul = qscale << 1;
@ -69,12 +69,12 @@ static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,
}
}
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,
static void dct_unquantize_h263_intra_axp(MpegEncContext *s, int16_t *block,
int n, int qscale)
{
int n_coeffs;
uint64_t qadd;
DCTELEM block0 = block[0];
int16_t block0 = block[0];
if (!s->h263_aic) {
if (n < 4)
@ -96,7 +96,7 @@ static void dct_unquantize_h263_intra_axp(MpegEncContext *s, DCTELEM *block,
block[0] = block0;
}
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,
static void dct_unquantize_h263_inter_axp(MpegEncContext *s, int16_t *block,
int n, int qscale)
{
int n_coeffs = s->inter_scantable.raster_end[s->block_last_index[n]];

@ -44,7 +44,7 @@
#define COL_SHIFT 20
/* 0: all entries 0, 1: only first entry nonzero, 2: otherwise */
static inline int idct_row(DCTELEM *row)
static inline int idct_row(int16_t *row)
{
int a0, a1, a2, a3, b0, b1, b2, b3, t;
uint64_t l, r, t2;
@ -152,7 +152,7 @@ static inline int idct_row(DCTELEM *row)
return 2;
}
static inline void idct_col(DCTELEM *col)
static inline void idct_col(int16_t *col)
{
int a0, a1, a2, a3, b0, b1, b2, b3;
@ -229,7 +229,7 @@ static inline void idct_col(DCTELEM *col)
/* If all rows but the first one are zero after row transformation,
all rows will be identical after column transformation. */
static inline void idct_col2(DCTELEM *col)
static inline void idct_col2(int16_t *col)
{
int i;
uint64_t l, r;
@ -251,7 +251,7 @@ static inline void idct_col2(DCTELEM *col)
stq(l, col + 14 * 4); stq(r, col + 15 * 4);
}
void ff_simple_idct_axp(DCTELEM *block)
void ff_simple_idct_axp(int16_t *block)
{
int i;
@ -291,13 +291,13 @@ void ff_simple_idct_axp(DCTELEM *block)
}
}
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, DCTELEM *block)
void ff_simple_idct_put_axp(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_axp(block);
put_pixels_clamped_axp_p(block, dest, line_size);
}
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, DCTELEM *block)
void ff_simple_idct_add_axp(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_axp(block);
add_pixels_clamped_axp_p(block, dest, line_size);

@ -23,12 +23,12 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_j_rev_dct_arm(DCTELEM *data);
void ff_simple_idct_arm(DCTELEM *data);
void ff_j_rev_dct_arm(int16_t *data);
void ff_simple_idct_arm(int16_t *data);
/* XXX: local hack */
static void (*ff_put_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const DCTELEM *block, uint8_t *pixels, int line_size);
static void (*ff_put_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
static void (*ff_add_pixels_clamped)(const int16_t *block, uint8_t *pixels, int line_size);
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, int line_size, int h);
@ -48,27 +48,27 @@ CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
void ff_add_pixels_clamped_arm(const DCTELEM *block, uint8_t *dest,
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
int line_size);
/* XXX: those functions should be suppressed ASAP when all IDCTs are
converted */
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
static void j_rev_dct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
static void j_rev_dct_arm_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_put(uint8_t *dest, int line_size, DCTELEM *block)
static void simple_idct_arm_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_arm (block);
ff_put_pixels_clamped(block, dest, line_size);
}
static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
static void simple_idct_arm_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_simple_idct_arm (block);
ff_add_pixels_clamped(block, dest, line_size);

@ -21,9 +21,9 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_simple_idct_armv5te(DCTELEM *data);
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_armv5te(int16_t *data);
void ff_simple_idct_put_armv5te(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_armv5te(uint8_t *dest, int line_size, int16_t *data);
av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
{

@ -24,9 +24,9 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_simple_idct_armv6(DCTELEM *data);
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_armv6(int16_t *data);
void ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data);
void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, int, int);
void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, int, int);
@ -46,12 +46,12 @@ void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, int, int);
void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, int, int);
void ff_add_pixels_clamped_armv6(const DCTELEM *block,
uint8_t *av_restrict pixels,
void ff_add_pixels_clamped_armv6(const int16_t *block,
uint8_t *restrict pixels,
int line_size);
void ff_get_pixels_armv6(DCTELEM *block, const uint8_t *pixels, int stride);
void ff_diff_pixels_armv6(DCTELEM *block, const uint8_t *s1,
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels, int stride);
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
const uint8_t *s2, int stride);
int ff_pix_abs16_armv6(void *s, uint8_t *blk1, uint8_t *blk2,

@ -25,12 +25,12 @@
#include "libavcodec/dsputil.h"
#include "dsputil_arm.h"
void ff_simple_idct_neon(DCTELEM *data);
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_simple_idct_neon(int16_t *data);
void ff_simple_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_simple_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_clear_block_neon(DCTELEM *block);
void ff_clear_blocks_neon(DCTELEM *blocks);
void ff_clear_block_neon(int16_t *block);
void ff_clear_blocks_neon(int16_t *blocks);
void ff_put_pixels16_neon(uint8_t *, const uint8_t *, int, int);
void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, int, int);
@ -62,9 +62,9 @@ void ff_avg_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
void ff_avg_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
void ff_avg_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, int, int);
void ff_add_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
void ff_put_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
void ff_put_signed_pixels_clamped_neon(const DCTELEM *, uint8_t *, int);
void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, int);
void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, int);
void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, int);
void ff_put_h264_qpel16_mc00_neon(uint8_t *, uint8_t *, int);
void ff_put_h264_qpel16_mc10_neon(uint8_t *, uint8_t *, int);

@ -50,22 +50,22 @@ void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
int height, int log2_den, int weightd,
int weights, int offset);
void ff_h264_idct_add_neon(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_idct_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
DCTELEM *block, int stride,
int16_t *block, int stride,
const uint8_t nnzc[6*8]);
void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
DCTELEM *block, int stride,
int16_t *block, int stride,
const uint8_t nnzc[6*8]);
void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
DCTELEM *block, int stride,
int16_t *block, int stride,
const uint8_t nnzc[6*8]);
void ff_h264_idct8_add_neon(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_idct8_dc_add_neon(uint8_t *dst, DCTELEM *block, int stride);
void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
DCTELEM *block, int stride,
int16_t *block, int stride,
const uint8_t nnzc[6*8]);
static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)

@ -66,7 +66,7 @@ row_loop:
ldrsh r2, [lr, # 2] @ r2 = 'd2'
@ Optimization for row that have all items except the first set to 0
@ (this works as the DCTELEMS are always 4-byte aligned)
@ (this works as the int16_t are always 4-byte aligned)
ldr r5, [lr, # 0]
ldr r6, [lr, # 4]
ldr r3, [lr, # 8]

@ -34,9 +34,9 @@ CHK_OFFS(MpegEncContext, inter_scantable.raster_end, INTER_SCANTAB_RASTER_END);
CHK_OFFS(MpegEncContext, h263_aic, H263_AIC);
#endif
void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, DCTELEM *block,
void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
int n, int qscale);
void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block,
void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block,
int n, int qscale);
void ff_MPV_common_init_arm(MpegEncContext *s)

@ -25,7 +25,7 @@
#include "libavcodec/mpegvideo.h"
#include "mpegvideo_arm.h"
void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int count);
void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count);
#ifdef ENABLE_ARM_TESTS
/**
@ -33,7 +33,7 @@ void ff_dct_unquantize_h263_armv5te(DCTELEM *block, int qmul, int qadd, int coun
* have optimized implementations for each architecture. Is also used as a reference
* implementation in regression tests
*/
static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qadd, int count)
static inline void dct_unquantize_h263_helper_c(int16_t *block, int qmul, int qadd, int count)
{
int i, level;
for (i = 0; i < count; i++) {
@ -51,7 +51,7 @@ static inline void dct_unquantize_h263_helper_c(DCTELEM *block, int qmul, int qa
#endif
static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int level, qmul, qadd;
int nCoeffs;
@ -80,7 +80,7 @@ static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
}
static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int qmul, qadd;
int nCoeffs;

@ -24,11 +24,11 @@
#include "libavcodec/rv34dsp.h"
#include "libavutil/arm/cpu.h"
void ff_rv34_inv_transform_noround_neon(DCTELEM *block);
void ff_rv34_inv_transform_noround_neon(int16_t *block);
void ff_rv34_inv_transform_noround_dc_neon(DCTELEM *block);
void ff_rv34_inv_transform_noround_dc_neon(int16_t *block);
void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, DCTELEM *block);
void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block);
void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc);
void ff_rv34dsp_init_arm(RV34DSPContext *c, DSPContext* dsp)

@ -67,7 +67,7 @@
vsub.s32 q15, q14, q9 @ z0 - z3
.endm
/* void rv34_idct_add_c(uint8_t *dst, int stride, DCTELEM *block) */
/* void rv34_idct_add_c(uint8_t *dst, int stride, int16_t *block) */
function ff_rv34_idct_add_neon, export=1
mov r3, r0
rv34_inv_transform r2
@ -97,7 +97,7 @@ function ff_rv34_idct_add_neon, export=1
bx lr
endfunc
/* void rv34_inv_transform_noround_neon(DCTELEM *block); */
/* void rv34_inv_transform_noround_neon(int16_t *block); */
function ff_rv34_inv_transform_noround_neon, export=1
rv34_inv_transform r0
vshl.s32 q11, q2, #1
@ -142,7 +142,7 @@ function ff_rv34_idct_dc_add_neon, export=1
bx lr
endfunc
/* void rv34_inv_transform_dc_noround_c(DCTELEM *block) */
/* void rv34_inv_transform_dc_noround_c(int16_t *block) */
function ff_rv34_inv_transform_noround_dc_neon, export=1
vld1.16 {d28[]}, [r0,:16] @ block[0]
vmov.i16 d4, #251

@ -375,7 +375,7 @@ endfunc
sub r0, r0, #(16*7)
.endm
/* void ff_simple_idct_armv6(DCTELEM *data); */
/* void ff_simple_idct_armv6(int16_t *data); */
function ff_simple_idct_armv6, export=1
push {r4-r11, lr}
sub sp, sp, #128
@ -390,7 +390,7 @@ function ff_simple_idct_armv6, export=1
pop {r4-r11, pc}
endfunc
/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
/* ff_simple_idct_add_armv6(uint8_t *dest, int line_size, int16_t *data); */
function ff_simple_idct_add_armv6, export=1
push {r0, r1, r4-r11, lr}
sub sp, sp, #128
@ -407,7 +407,7 @@ function ff_simple_idct_add_armv6, export=1
pop {r4-r11, pc}
endfunc
/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, DCTELEM *data); */
/* ff_simple_idct_put_armv6(uint8_t *dest, int line_size, int16_t *data); */
function ff_simple_idct_put_armv6, export=1
push {r0, r1, r4-r11, lr}
sub sp, sp, #128

@ -261,7 +261,7 @@ endconst
pop {r4-r7, pc}
.endm
/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, DCTELEM *data); */
/* void ff_simple_idct_put_neon(uint8_t *dst, int line_size, int16_t *data); */
function ff_simple_idct_put_neon, export=1
idct_start r2
@ -316,7 +316,7 @@ function idct_col4_add8_neon
bx lr
endfunc
/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, DCTELEM *data); */
/* void ff_simple_idct_add_neon(uint8_t *dst, int line_size, int16_t *data); */
function ff_simple_idct_add_neon, export=1
idct_start r2
@ -355,7 +355,7 @@ function idct_col4_st16_neon
bx lr
endfunc
/* void ff_simple_idct_neon(DCTELEM *data); */
/* void ff_simple_idct_neon(int16_t *data); */
function ff_simple_idct_neon, export=1
idct_start r0

@ -24,9 +24,9 @@
#include "libavcodec/dsputil.h"
#include "libavcodec/vp3dsp.h"
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, DCTELEM *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const DCTELEM *data);
void ff_vp3_idct_put_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_add_neon(uint8_t *dest, int line_size, int16_t *data);
void ff_vp3_idct_dc_add_neon(uint8_t *dest, int line_size, const int16_t *data);
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);

@ -23,7 +23,7 @@
#if HAVE_ARMV6_EXTERNAL
#define decode_block_coeffs_internal ff_decode_block_coeffs_armv6
int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, DCTELEM block[16],
int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16],
uint8_t probs[8][3][NUM_DCT_TOKENS-1],
int i, uint8_t *token_prob, int16_t qmul[2]);
#endif

@ -56,7 +56,7 @@
@ idct
@ void vp8_luma_dc_wht(DCTELEM block[4][4][16], DCTELEM dc[16])
@ void vp8_luma_dc_wht(int16_t block[4][4][16], int16_t dc[16])
function ff_vp8_luma_dc_wht_armv6, export=1
push {r4-r10, lr}
@ -179,7 +179,7 @@ function ff_vp8_luma_dc_wht_armv6, export=1
pop {r4-r10, pc}
endfunc
@ void vp8_luma_dc_wht_dc(DCTELEM block[4][4][16], DCTELEM dc[16])
@ void vp8_luma_dc_wht_dc(int16_t block[4][4][16], int16_t dc[16])
function ff_vp8_luma_dc_wht_dc_armv6, export=1
ldrsh r2, [r1]
mov r3, #0
@ -192,7 +192,7 @@ function ff_vp8_luma_dc_wht_dc_armv6, export=1
bx lr
endfunc
@ void vp8_idct_add(uint8_t *dst, DCTELEM block[16], int stride)
@ void vp8_idct_add(uint8_t *dst, int16_t block[16], int stride)
function ff_vp8_idct_add_armv6, export=1
push {r4-r12, lr}
sub sp, sp, #32
@ -314,7 +314,7 @@ function ff_vp8_idct_add_armv6, export=1
pop {r4-r12, pc}
endfunc
@ void vp8_idct_dc_add(uint8_t *dst, DCTELEM block[16], int stride)
@ void vp8_idct_dc_add(uint8_t *dst, int16_t block[16], int stride)
function ff_vp8_idct_dc_add_armv6, export=1
push {r4-r6, lr}
add r6, r0, r2, lsl #1
@ -355,7 +355,7 @@ function ff_vp8_idct_dc_add_armv6, export=1
pop {r4-r6, pc}
endfunc
@ void vp8_idct_dc_add4uv(uint8_t *dst, DCTELEM block[4][16], int stride)
@ void vp8_idct_dc_add4uv(uint8_t *dst, int16_t block[4][16], int stride)
function ff_vp8_idct_dc_add4uv_armv6, export=1
push {r4, lr}
@ -371,7 +371,7 @@ function ff_vp8_idct_dc_add4uv_armv6, export=1
pop {r4, pc}
endfunc
@ void vp8_idct_dc_add4y(uint8_t *dst, DCTELEM block[4][16], int stride)
@ void vp8_idct_dc_add4y(uint8_t *dst, int16_t block[4][16], int stride)
function ff_vp8_idct_dc_add4y_armv6, export=1
push {r4, lr}

@ -22,13 +22,13 @@
#include "libavcodec/vp8dsp.h"
#include "vp8dsp.h"
void ff_vp8_luma_dc_wht_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]);
void ff_vp8_luma_dc_wht_dc_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]);
void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]);
void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]);
void ff_vp8_idct_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add_armv6(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);
void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
VP8_LF(armv6);

@ -22,12 +22,12 @@
#include "libavcodec/vp8dsp.h"
#include "vp8dsp.h"
void ff_vp8_luma_dc_wht_neon(DCTELEM block[4][4][16], DCTELEM dc[16]);
void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]);
void ff_vp8_idct_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add_neon(uint8_t *dst, DCTELEM block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, DCTELEM block[4][16], ptrdiff_t stride);
void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
VP8_LF(neon);

@ -48,7 +48,7 @@ typedef struct ASV1Context{
int mb_height;
int mb_width2;
int mb_height2;
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
DECLARE_ALIGNED(16, int16_t, block)[6][64];
uint16_t intra_matrix[64];
int q_intra_matrix[64];
uint8_t *bitstream_buffer;

@ -94,7 +94,7 @@ static inline int asv2_get_level(GetBitContext *gb)
return code - 31;
}
static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64])
static inline int asv1_decode_block(ASV1Context *a, int16_t block[64])
{
int i;
@ -125,7 +125,7 @@ static inline int asv1_decode_block(ASV1Context *a, DCTELEM block[64])
return 0;
}
static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64])
static inline int asv2_decode_block(ASV1Context *a, int16_t block[64])
{
int i, count, ccp;
@ -161,7 +161,7 @@ static inline int asv2_decode_block(ASV1Context *a, DCTELEM block[64])
return 0;
}
static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64])
static inline int decode_mb(ASV1Context *a, int16_t block[6][64])
{
int i;
@ -183,7 +183,7 @@ static inline int decode_mb(ASV1Context *a, DCTELEM block[6][64])
static inline void idct_put(ASV1Context *a, int mb_x, int mb_y)
{
DCTELEM (*block)[64] = a->block;
int16_t (*block)[64] = a->block;
int linesize = a->picture.linesize[0];
uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;

@ -56,7 +56,7 @@ static inline void asv2_put_level(PutBitContext *pb, int level){
}
}
static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){
static inline void asv1_encode_block(ASV1Context *a, int16_t block[64]){
int i;
int nc_count=0;
@ -89,7 +89,7 @@ static inline void asv1_encode_block(ASV1Context *a, DCTELEM block[64]){
put_bits(&a->pb, ff_asv_ccp_tab[16][1], ff_asv_ccp_tab[16][0]);
}
static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){
static inline void asv2_encode_block(ASV1Context *a, int16_t block[64]){
int i;
int count=0;
@ -130,7 +130,7 @@ static inline void asv2_encode_block(ASV1Context *a, DCTELEM block[64]){
#define MAX_MB_SIZE (30*16*16*3/2/8)
static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){
static inline int encode_mb(ASV1Context *a, int16_t block[6][64]){
int i;
if (a->pb.buf_end - a->pb.buf - (put_bits_count(&a->pb)>>3) < MAX_MB_SIZE) {
@ -149,7 +149,7 @@ static inline int encode_mb(ASV1Context *a, DCTELEM block[6][64]){
}
static inline void dct_get(ASV1Context *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
int16_t (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
int i;

@ -21,7 +21,7 @@
low level assembler interface wrapper
DEFUN(put_pixels_clamped,mL1,
(DCTELEM *block, uint8_t *dest, int line_size)):
(int16_t *block, uint8_t *dest, int line_size)):
body

@ -27,20 +27,20 @@
int off;
static void bfin_idct_add (uint8_t *dest, int line_size, DCTELEM *block)
static void bfin_idct_add (uint8_t *dest, int line_size, int16_t *block)
{
ff_bfin_idct (block);
ff_bfin_add_pixels_clamped (block, dest, line_size);
}
static void bfin_idct_put (uint8_t *dest, int line_size, DCTELEM *block)
static void bfin_idct_put (uint8_t *dest, int line_size, int16_t *block)
{
ff_bfin_idct (block);
ff_bfin_put_pixels_clamped (block, dest, line_size);
}
static void bfin_clear_blocks (DCTELEM *blocks)
static void bfin_clear_blocks (int16_t *blocks)
{
// This is just a simple memset.
//

@ -24,8 +24,9 @@
#ifndef AVCODEC_BFIN_DSPUTIL_BFIN_H
#define AVCODEC_BFIN_DSPUTIL_BFIN_H
#include <stdint.h>
#include "config.h"
#include "libavcodec/dsputil.h"
#if defined(__FDPIC__) && CONFIG_SRAM
#define attribute_l1_text __attribute__ ((l1_text))
@ -35,15 +36,15 @@
#define attribute_l1_data_b
#endif
void ff_bfin_idct (DCTELEM *block) attribute_l1_text;
void ff_bfin_fdct (DCTELEM *block) attribute_l1_text;
void ff_bfin_vp3_idct (DCTELEM *block);
void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block);
void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block);
void ff_bfin_add_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
void ff_bfin_put_pixels_clamped (const DCTELEM *block, uint8_t *dest, int line_size) attribute_l1_text;
void ff_bfin_diff_pixels (DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;
void ff_bfin_get_pixels (DCTELEM *av_restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
void ff_bfin_idct (int16_t *block) attribute_l1_text;
void ff_bfin_fdct (int16_t *block) attribute_l1_text;
void ff_bfin_vp3_idct (int16_t *block);
void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block);
void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block);
void ff_bfin_add_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
void ff_bfin_put_pixels_clamped (const int16_t *block, uint8_t *dest, int line_size) attribute_l1_text;
void ff_bfin_diff_pixels (int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride) attribute_l1_text;
void ff_bfin_get_pixels (int16_t *restrict block, const uint8_t *pixels, int line_size) attribute_l1_text;
int ff_bfin_pix_norm1 (uint8_t * pix, int line_size) attribute_l1_text;
int ff_bfin_z_sad8x8 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;
int ff_bfin_z_sad16x16 (uint8_t *blk1, uint8_t *blk2, int dsz, int line_size, int h) attribute_l1_text;

@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
void ff_bfin_fdct (DCTELEM *buf);
void ff_bfin_fdct (int16_t *buf);
This implementation works only for 8x8 input. The range of input
must be -256 to 255 i.e. 8bit input represented in a 16bit data
@ -61,9 +61,9 @@ Notation
Other registers used:
I0, I1, I2, I3, B0, B2, B3, M0, M1, L3 registers and LC0.
Input - r0 - pointer to start of DCTELEM *block
Input - r0 - pointer to start of int16_t *block
Output - The DCT output coefficients in the DCTELEM *block
Output - The DCT output coefficients in the int16_t *block
Register constraint:
This code is called from jpeg_encode.
@ -147,7 +147,7 @@ vtmp: .space 128
.text
DEFUN(fdct,mL1,
(DCTELEM *block)):
(int16_t *block)):
[--SP] = (R7:4, P5:3); // Push the registers onto the stack.
b0 = r0;

@ -22,7 +22,7 @@
/*
This blackfin DSP code implements an 8x8 inverse type II DCT.
Prototype : void ff_bfin_idct(DCTELEM *in)
Prototype : void ff_bfin_idct(int16_t *in)
Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
@ -90,7 +90,7 @@ vtmp: .space 256
.text
DEFUN(idct,mL1,
(DCTELEM *block)):
(int16_t *block)):
/********************** Function Prologue *********************************/
link 16;

@ -26,7 +26,7 @@
#include "dsputil_bfin.h"
static int dct_quantize_bfin (MpegEncContext *s,
DCTELEM *block, int n,
int16_t *block, int n,
int qscale, int *overflow)
{
int last_non_zero, q, start_i;

@ -21,7 +21,7 @@
#include "config_bfin.h"
DEFUN(put_pixels_clamped,mL1,
(DCTELEM *block, uint8_t *dest, int line_size)):
(int16_t *block, uint8_t *dest, int line_size)):
[--SP] = (R7:4);
R4 = 0;
R5.l = 0x00ff;
@ -51,7 +51,7 @@ ppc$1: R2 = Max(R0, R4) (V) || [I1++M1] = R6;
DEFUN_END(put_pixels_clamped)
DEFUN(add_pixels_clamped,mL1,
(DCTELEM *block, uint8_t *dest, int line_size)):
(int16_t *block, uint8_t *dest, int line_size)):
[-- SP] = (R7:4);
R4 = 0;
I0 = 0;
@ -442,7 +442,7 @@ LE$8OT: DISALGNEXCPT || R2 =[I1++] || [I3++M2] = R5;
rts;
DEFUN(diff_pixels,mL1,
(DCTELEM *block, uint8_t *s1, uint8_t *s2, int stride)):
(int16_t *block, uint8_t *s1, uint8_t *s2, int stride)):
link 0;
[--sp] = (r7:4);
p0=8;
@ -518,7 +518,7 @@ DEFUN_END(pix_sum)
DEFUN(get_pixels,mL1,
(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size)):
(int16_t *av_restrict block, const uint8_t *pixels, int line_size)):
[--sp] = (r7:4);
i3=r0; // dest
i0=r1; // src0

@ -23,7 +23,7 @@
#include "dsputil_bfin.h"
/* Intra iDCT offset 128 */
void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block)
void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block)
{
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP + 128;
int i,j;
@ -36,7 +36,7 @@ void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, DCTELEM *block)
}
/* Inter iDCT */
void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, DCTELEM *block)
void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block)
{
ff_bfin_vp3_idct (block);
ff_bfin_add_pixels_clamped (block, dest, line_size);

@ -22,7 +22,7 @@
/*
This blackfin DSP code implements an 8x8 inverse type II DCT.
Prototype : void ff_bfin_vp3_idct(DCTELEM *in)
Prototype : void ff_bfin_vp3_idct(int16_t *in)
Registers Used : A0, A1, R0-R7, I0-I3, B0, B2, B3, M0-M2, L0-L3, P0-P5, LC0.
@ -63,7 +63,7 @@ vtmp: .space 256
.text
DEFUN(vp3_idct,mL1,
(DCTELEM *block)):
(int16_t *block)):
/********************** Function Prologue *********************************/
link 16;

@ -700,7 +700,7 @@ static int read_dct_coeffs(GetBitContext *gb, int32_t block[64], const uint8_t *
* @param masks_count number of masks to decode
* @return 0 on success, negative value in other cases
*/
static int read_residue(GetBitContext *gb, DCTELEM block[64], int masks_count)
static int read_residue(GetBitContext *gb, int16_t block[64], int masks_count)
{
int coef_list[128];
int mode_list[128];
@ -804,7 +804,7 @@ static int binkb_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx,
int v, col[2];
const uint8_t *scan;
int xoff, yoff;
LOCAL_ALIGNED_16(DCTELEM, block, [64]);
LOCAL_ALIGNED_16(int16_t, block, [64]);
LOCAL_ALIGNED_16(int32_t, dctblock, [64]);
int coordmap[64];
int ybias = is_key ? -15 : 0;
@ -950,7 +950,7 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx,
int v, col[2];
const uint8_t *scan;
int xoff, yoff;
LOCAL_ALIGNED_16(DCTELEM, block, [64]);
LOCAL_ALIGNED_16(int16_t, block, [64]);
LOCAL_ALIGNED_16(uint8_t, ublock, [64]);
LOCAL_ALIGNED_16(int32_t, dctblock, [64]);
int coordmap[64];

@ -715,7 +715,7 @@ void ff_cavs_init_top_lines(AVSContext *h) {
/* alloc space for co-located MVs and types */
h->col_mv = av_mallocz( h->mb_width*h->mb_height*4*sizeof(cavs_vector));
h->col_type_base = av_mallocz(h->mb_width*h->mb_height);
h->block = av_mallocz(64*sizeof(DCTELEM));
h->block = av_mallocz(64*sizeof(int16_t));
}
av_cold int ff_cavs_init(AVCodecContext *avctx) {

@ -234,7 +234,7 @@ typedef struct AVSContext {
uint8_t *edge_emu_buffer;
int got_keyframe;
DCTELEM *block;
int16_t *block;
} AVSContext;
extern const uint8_t ff_cavs_partition_flags[30];

@ -517,8 +517,8 @@ static inline int get_ue_code(GetBitContext *gb, int order)
return get_ue_golomb(gb);
}
static inline int dequant(AVSContext *h, DCTELEM *level_buf, uint8_t *run_buf,
DCTELEM *dst, int mul, int shift, int coeff_num)
static inline int dequant(AVSContext *h, int16_t *level_buf, uint8_t *run_buf,
int16_t *dst, int mul, int shift, int coeff_num)
{
int round = 1 << (shift - 1);
int pos = -1;
@ -553,9 +553,9 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
{
int i, esc_code, level, mask;
unsigned int level_code, run;
DCTELEM level_buf[65];
int16_t level_buf[65];
uint8_t run_buf[65];
DCTELEM *block = h->block;
int16_t *block = h->block;
for (i = 0; i < 65; i++) {
level_code = get_ue_code(gb, r->golomb_order);

@ -183,9 +183,9 @@ static void cavs_filter_ch_c(uint8_t *d, int stride, int alpha, int beta, int tc
*
****************************************************************************/
static void cavs_idct8_add_c(uint8_t *dst, DCTELEM *block, int stride) {
static void cavs_idct8_add_c(uint8_t *dst, int16_t *block, int stride) {
int i;
DCTELEM (*src)[8] = (DCTELEM(*)[8])block;
int16_t (*src)[8] = (int16_t(*)[8])block;
uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
src[0][0] += 8;

@ -32,7 +32,7 @@ typedef struct CAVSDSPContext {
void (*cavs_filter_lh)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
void (*cavs_filter_cv)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
void (*cavs_filter_ch)(uint8_t *pix, int stride, int alpha, int beta, int tc, int bs1, int bs2);
void (*cavs_idct8_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*cavs_idct8_add)(uint8_t *dst, int16_t *block, int stride);
int idct_perm;
} CAVSDSPContext;

@ -39,6 +39,7 @@
#include "libavutil/lfg.h"
#include "libavutil/time.h"
#include "dsputil.h"
#include "simple_idct.h"
#include "aandcttab.h"
#include "faandct.h"
@ -48,28 +49,28 @@
#undef printf
void ff_mmx_idct(DCTELEM *data);
void ff_mmxext_idct(DCTELEM *data);
void ff_mmx_idct(int16_t *data);
void ff_mmxext_idct(int16_t *data);
// BFIN
void ff_bfin_idct(DCTELEM *block);
void ff_bfin_fdct(DCTELEM *block);
void ff_bfin_idct(int16_t *block);
void ff_bfin_fdct(int16_t *block);
// ALTIVEC
void ff_fdct_altivec(DCTELEM *block);
void ff_fdct_altivec(int16_t *block);
// ARM
void ff_j_rev_dct_arm(DCTELEM *data);
void ff_simple_idct_arm(DCTELEM *data);
void ff_simple_idct_armv5te(DCTELEM *data);
void ff_simple_idct_armv6(DCTELEM *data);
void ff_simple_idct_neon(DCTELEM *data);
void ff_j_rev_dct_arm(int16_t *data);
void ff_simple_idct_arm(int16_t *data);
void ff_simple_idct_armv5te(int16_t *data);
void ff_simple_idct_armv6(int16_t *data);
void ff_simple_idct_neon(int16_t *data);
void ff_simple_idct_axp(DCTELEM *data);
void ff_simple_idct_axp(int16_t *data);
struct algo {
const char *name;
void (*func)(DCTELEM *block);
void (*func)(int16_t *block);
enum formattag { NO_PERM, MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM,
SSE2_PERM, PARTTRANS_PERM, TRANSPOSE_PERM } format;
int mm_support;
@ -103,9 +104,9 @@ static const struct algo fdct_tab[] = {
#if ARCH_X86_64 && HAVE_MMX && HAVE_YASM
void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize,
DCTELEM *block, int16_t *qmat);
int16_t *block, int16_t *qmat);
static void ff_prores_idct_put_10_sse2_wrap(DCTELEM *dst){
static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){
DECLARE_ALIGNED(16, static int16_t, qmat)[64];
DECLARE_ALIGNED(16, static int16_t, tmp)[64];
int i;
@ -193,10 +194,10 @@ static void idct_mmx_init(void)
}
}
DECLARE_ALIGNED(16, static DCTELEM, block)[64];
DECLARE_ALIGNED(8, static DCTELEM, block1)[64];
DECLARE_ALIGNED(16, static int16_t, block)[64];
DECLARE_ALIGNED(8, static int16_t, block1)[64];
static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, int vals)
static void init_block(int16_t block[64], int test, int is_idct, AVLFG *prng, int vals)
{
int i, j;
@ -226,7 +227,7 @@ static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, in
}
}
static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm)
static void permute(int16_t dst[64], const int16_t src[64], int perm)
{
int i;
@ -253,7 +254,7 @@ static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm)
static int dct_error(const struct algo *dct, int test, int is_idct, int speed, const int bits)
{
void (*ref)(DCTELEM *block) = is_idct ? ff_ref_idct : ff_ref_fdct;
void (*ref)(int16_t *block) = is_idct ? ff_ref_idct : ff_ref_fdct;
int it, i, scale;
int err_inf, v;
int64_t err2, ti, ti1, it1, err_sum = 0;

@ -45,11 +45,11 @@ typedef struct DNXHDContext {
VLC ac_vlc, dc_vlc, run_vlc;
int last_dc[3];
DSPContext dsp;
DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
ScanTable scantable;
const CIDEntry *cid_table;
int bit_depth; // 8, 10 or 0 if not initialized at all.
void (*decode_dct_block)(struct DNXHDContext *ctx, DCTELEM *block,
void (*decode_dct_block)(struct DNXHDContext *ctx, int16_t *block,
int n, int qscale);
int last_qscale;
int luma_scale[64];
@ -59,8 +59,8 @@ typedef struct DNXHDContext {
#define DNXHD_VLC_BITS 9
#define DNXHD_DC_VLC_BITS 7
static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block, int n, int qscale);
static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block, int n, int qscale);
static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block, int n, int qscale);
static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block, int n, int qscale);
static av_cold int dnxhd_decode_init(AVCodecContext *avctx)
{
@ -190,7 +190,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
}
static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
DCTELEM *block, int n,
int16_t *block, int n,
int qscale,
int index_bits,
int level_bias,
@ -272,13 +272,13 @@ static av_always_inline void dnxhd_decode_dct_block(DNXHDContext *ctx,
CLOSE_READER(bs, &ctx->gb);
}
static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, DCTELEM *block,
static void dnxhd_decode_dct_block_8(DNXHDContext *ctx, int16_t *block,
int n, int qscale)
{
dnxhd_decode_dct_block(ctx, block, n, qscale, 4, 32, 6);
}
static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, DCTELEM *block,
static void dnxhd_decode_dct_block_10(DNXHDContext *ctx, int16_t *block,
int n, int qscale)
{
dnxhd_decode_dct_block(ctx, block, n, qscale, 6, 8, 4);

@ -51,7 +51,7 @@ static const AVClass class = {
#define LAMBDA_FRAC_BITS 10
static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size)
static void dnxhd_8bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size)
{
int i;
for (i = 0; i < 4; i++) {
@ -68,7 +68,7 @@ static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint
memcpy(block + 24, block - 32, sizeof(*block) * 8);
}
static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size)
static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(int16_t *av_restrict block, const uint8_t *pixels, int line_size)
{
int i;
const uint16_t* pixels16 = (const uint16_t*)pixels;
@ -88,7 +88,7 @@ static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *av_restrict
memcpy(block + 24, block - 32, sizeof(*block) * 8);
}
static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block,
static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, int16_t *block,
int n, int qscale, int *overflow)
{
const uint8_t *scantable= ctx->intra_scantable.scantable;
@ -392,7 +392,7 @@ static av_always_inline void dnxhd_encode_dc(DNXHDEncContext *ctx, int diff)
(ctx->cid_table->dc_codes[nbits]<<nbits) + (diff & ((1 << nbits) - 1)));
}
static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *block, int last_index, int n)
static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t *block, int last_index, int n)
{
int last_non_zero = 0;
int slevel, i, j;
@ -415,7 +415,7 @@ static av_always_inline void dnxhd_encode_block(DNXHDEncContext *ctx, DCTELEM *b
put_bits(&ctx->m.pb, ctx->vlc_bits[0], ctx->vlc_codes[0]); // EOB
}
static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *block, int n, int qscale, int last_index)
static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t *block, int n, int qscale, int last_index)
{
const uint8_t *weight_matrix;
int level;
@ -456,7 +456,7 @@ static av_always_inline void dnxhd_unquantize_c(DNXHDEncContext *ctx, DCTELEM *b
}
}
static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block)
static av_always_inline int dnxhd_ssd_block(int16_t *qblock, int16_t *block)
{
int score = 0;
int i;
@ -465,7 +465,7 @@ static av_always_inline int dnxhd_ssd_block(DCTELEM *qblock, DCTELEM *block)
return score;
}
static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *block, int last_index)
static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t *block, int last_index)
{
int last_non_zero = 0;
int bits = 0;
@ -527,7 +527,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
DNXHDEncContext *ctx = avctx->priv_data;
int mb_y = jobnr, mb_x;
int qscale = ctx->qscale;
LOCAL_ALIGNED_16(DCTELEM, block, [64]);
LOCAL_ALIGNED_16(int16_t, block, [64]);
ctx = ctx->thread[threadnr];
ctx->m.last_dc[0] =
@ -544,7 +544,7 @@ static int dnxhd_calc_bits_thread(AVCodecContext *avctx, void *arg, int jobnr, i
dnxhd_get_blocks(ctx, mb_x, mb_y);
for (i = 0; i < 8; i++) {
DCTELEM *src_block = ctx->blocks[i];
int16_t *src_block = ctx->blocks[i];
int overflow, nbits, diff, last_index;
int n = dnxhd_switch_matrix(ctx, i);
@ -593,7 +593,7 @@ static int dnxhd_encode_thread(AVCodecContext *avctx, void *arg, int jobnr, int
dnxhd_get_blocks(ctx, mb_x, mb_y);
for (i = 0; i < 8; i++) {
DCTELEM *block = ctx->blocks[i];
int16_t *block = ctx->blocks[i];
int overflow, n = dnxhd_switch_matrix(ctx, i);
int last_index = ctx->m.dct_quantize(&ctx->m, block, 4&(2*i), qscale, &overflow);
//START_TIMER;

@ -64,7 +64,7 @@ typedef struct DNXHDEncContext {
int nitris_compat;
unsigned min_padding;
DECLARE_ALIGNED(16, DCTELEM, blocks)[8][64];
DECLARE_ALIGNED(16, int16_t, blocks)[8][64];
int (*qmatrix_c) [64];
int (*qmatrix_l) [64];
@ -90,7 +90,7 @@ typedef struct DNXHDEncContext {
RCCMPEntry *mb_cmp;
RCEntry (*mb_rc)[8160];
void (*get_pixels_8x4_sym)(DCTELEM * /*align 16*/, const uint8_t *, int);
void (*get_pixels_8x4_sym)(int16_t * /*align 16*/, const uint8_t *, int);
} DNXHDEncContext;
void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);

@ -351,7 +351,7 @@ static int sse16_c(void *v, uint8_t *pix1, uint8_t *pix2, int line_size, int h)
return s;
}
static void diff_pixels_c(DCTELEM *av_restrict block, const uint8_t *s1,
static void diff_pixels_c(int16_t *av_restrict block, const uint8_t *s1,
const uint8_t *s2, int stride){
int i;
@ -371,8 +371,7 @@ static void diff_pixels_c(DCTELEM *av_restrict block, const uint8_t *s1,
}
}
static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void put_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -393,7 +392,7 @@ static void put_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixe
}
}
static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void put_pixels_clamped4_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -410,7 +409,7 @@ static void put_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pix
}
}
static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void put_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -425,7 +424,7 @@ static void put_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pix
}
}
static void put_signed_pixels_clamped_c(const DCTELEM *block,
static void put_signed_pixels_clamped_c(const int16_t *block,
uint8_t *av_restrict pixels,
int line_size)
{
@ -446,7 +445,7 @@ static void put_signed_pixels_clamped_c(const DCTELEM *block,
}
}
static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void add_pixels_clamped_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -466,7 +465,7 @@ static void add_pixels_clamped_c(const DCTELEM *block, uint8_t *av_restrict pixe
}
}
static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void add_pixels_clamped4_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -482,7 +481,7 @@ static void add_pixels_clamped4_c(const DCTELEM *block, uint8_t *av_restrict pix
}
}
static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pixels,
static void add_pixels_clamped2_c(const int16_t *block, uint8_t *av_restrict pixels,
int line_size)
{
int i;
@ -496,7 +495,7 @@ static void add_pixels_clamped2_c(const DCTELEM *block, uint8_t *av_restrict pix
}
}
static int sum_abs_dctelem_c(DCTELEM *block)
static int sum_abs_dctelem_c(int16_t *block)
{
int sum=0, i;
for(i=0; i<64; i++)
@ -1834,10 +1833,10 @@ static void add_8x8basis_c(int16_t rem[64], int16_t basis[64], int scale){
* @param scantable the used scantable, this is only used to speed the permutation up, the block is not
* (inverse) permutated to scantable order!
*/
void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last)
void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last)
{
int i;
DCTELEM temp[64];
int16_t temp[64];
if(last<=0) return;
//if(permutation[1]==1) return; //FIXME it is ok but not clean and might fail for some permutations
@ -2160,7 +2159,7 @@ static int hadamard8_intra8x8_c(/*MpegEncContext*/ void *s, uint8_t *src, uint8_
static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
LOCAL_ALIGNED_16(DCTELEM, temp, [64]);
LOCAL_ALIGNED_16(int16_t, temp, [64]);
av_assert2(h==8);
@ -2199,7 +2198,7 @@ static int dct_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2
static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
DCTELEM dct[8][8];
int16_t dct[8][8];
int i;
int sum=0;
@ -2224,7 +2223,7 @@ static int dct264_sad8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
LOCAL_ALIGNED_16(DCTELEM, temp, [64]);
LOCAL_ALIGNED_16(int16_t, temp, [64]);
int sum=0, i;
av_assert2(h==8);
@ -2240,8 +2239,8 @@ static int dct_max8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2
static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
LOCAL_ALIGNED_16(DCTELEM, temp, [64*2]);
DCTELEM * const bak = temp+64;
LOCAL_ALIGNED_16(int16_t, temp, [64*2]);
int16_t * const bak = temp+64;
int sum=0, i;
av_assert2(h==8);
@ -2249,7 +2248,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
s->dsp.diff_pixels(temp, src1, src2, stride);
memcpy(bak, temp, 64*sizeof(DCTELEM));
memcpy(bak, temp, 64*sizeof(int16_t));
s->block_last_index[0/*FIXME*/]= s->fast_dct_quantize(s, temp, 0/*FIXME*/, s->qscale, &i);
s->dct_unquantize_inter(s, temp, 0, s->qscale);
@ -2264,7 +2263,7 @@ static int quant_psnr8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *s
static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
const uint8_t *scantable= s->intra_scantable.permutated;
LOCAL_ALIGNED_16(DCTELEM, temp, [64]);
LOCAL_ALIGNED_16(int16_t, temp, [64]);
LOCAL_ALIGNED_16(uint8_t, lsrc1, [64]);
LOCAL_ALIGNED_16(uint8_t, lsrc2, [64]);
int i, last, run, bits, level, distortion, start_i;
@ -2340,7 +2339,7 @@ static int rd8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int
static int bit8x8_c(/*MpegEncContext*/ void *c, uint8_t *src1, uint8_t *src2, int stride, int h){
MpegEncContext * const s= (MpegEncContext *)c;
const uint8_t *scantable= s->intra_scantable.permutated;
LOCAL_ALIGNED_16(DCTELEM, temp, [64]);
LOCAL_ALIGNED_16(int16_t, temp, [64]);
int i, last, run, bits, level, start_i;
const int esc_length= s->ac_esc_length;
uint8_t * length;
@ -2577,44 +2576,44 @@ static void vector_clip_int32_c(int32_t *dst, const int32_t *src, int32_t min,
} while (len > 0);
}
static void ff_jref_idct_put(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct (block);
put_pixels_clamped_c(block, dest, line_size);
}
static void ff_jref_idct_add(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct (block);
add_pixels_clamped_c(block, dest, line_size);
}
static void ff_jref_idct4_put(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct4_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct4 (block);
put_pixels_clamped4_c(block, dest, line_size);
}
static void ff_jref_idct4_add(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct4_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct4 (block);
add_pixels_clamped4_c(block, dest, line_size);
}
static void ff_jref_idct2_put(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct2_put(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct2 (block);
put_pixels_clamped2_c(block, dest, line_size);
}
static void ff_jref_idct2_add(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct2_add(uint8_t *dest, int line_size, int16_t *block)
{
ff_j_rev_dct2 (block);
add_pixels_clamped2_c(block, dest, line_size);
}
static void ff_jref_idct1_put(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct1_put(uint8_t *dest, int line_size, int16_t *block)
{
dest[0] = av_clip_uint8((block[0] + 4)>>3);
}
static void ff_jref_idct1_add(uint8_t *dest, int line_size, DCTELEM *block)
static void ff_jref_idct1_add(uint8_t *dest, int line_size, int16_t *block)
{
dest[0] = av_clip_uint8(dest[0] + ((block[0] + 4)>>3));
}

@ -36,37 +36,36 @@
//#define DEBUG
/* dct code */
typedef short DCTELEM;
void ff_fdct_ifast (DCTELEM *data);
void ff_fdct_ifast248 (DCTELEM *data);
void ff_jpeg_fdct_islow_8(DCTELEM *data);
void ff_jpeg_fdct_islow_10(DCTELEM *data);
void ff_fdct248_islow_8(DCTELEM *data);
void ff_fdct248_islow_10(DCTELEM *data);
void ff_fdct_ifast(int16_t *data);
void ff_fdct_ifast248(int16_t *data);
void ff_jpeg_fdct_islow_8(int16_t *data);
void ff_jpeg_fdct_islow_10(int16_t *data);
void ff_fdct248_islow_8(int16_t *data);
void ff_fdct248_islow_10(int16_t *data);
void ff_j_rev_dct (DCTELEM *data);
void ff_j_rev_dct4 (DCTELEM *data);
void ff_j_rev_dct2 (DCTELEM *data);
void ff_j_rev_dct1 (DCTELEM *data);
void ff_j_rev_dct(int16_t *data);
void ff_j_rev_dct4(int16_t *data);
void ff_j_rev_dct2(int16_t *data);
void ff_j_rev_dct1(int16_t *data);
void ff_fdct_mmx(DCTELEM *block);
void ff_fdct_mmxext(DCTELEM *block);
void ff_fdct_sse2(DCTELEM *block);
void ff_fdct_mmx(int16_t *block);
void ff_fdct_mmxext(int16_t *block);
void ff_fdct_sse2(int16_t *block);
#define H264_IDCT(depth) \
void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, DCTELEM *block, int stride);\
void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, DCTELEM *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(DCTELEM *output, DCTELEM *input, int qmul);\
void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);\
void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(DCTELEM *block, int qmul);
void ff_h264_idct8_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
void ff_h264_idct_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
void ff_h264_idct8_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
void ff_h264_idct_dc_add_ ## depth ## _c(uint8_t *dst, int16_t *block, int stride);\
void ff_h264_idct_add16_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add16intra_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct8_add4_ ## depth ## _c(uint8_t *dst, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add8_422_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_idct_add8_ ## depth ## _c(uint8_t **dest, const int *blockoffset, int16_t *block, int stride, const uint8_t nnzc[6*8]);\
void ff_h264_luma_dc_dequant_idct_ ## depth ## _c(int16_t *output, int16_t *input, int qmul);\
void ff_h264_chroma422_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);\
void ff_h264_chroma_dc_dequant_idct_ ## depth ## _c(int16_t *block, int qmul);
H264_IDCT( 8)
H264_IDCT( 9)
@ -74,8 +73,8 @@ H264_IDCT(10)
H264_IDCT(12)
H264_IDCT(14)
void ff_svq3_luma_dc_dequant_idct_c(DCTELEM *output, DCTELEM *input, int qp);
void ff_svq3_add_idct_c(uint8_t *dst, DCTELEM *block, int stride, int qp, int dc);
void ff_svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp);
void ff_svq3_add_idct_c(uint8_t *dst, int16_t *block, int stride, int qp, int dc);
/* encoding scans */
extern const uint8_t ff_alternate_horizontal_scan[64];
@ -135,11 +134,11 @@ could be reached easily ...
*/
/*
void get_pixels_c(DCTELEM *block, const uint8_t *pixels, int line_size);
void diff_pixels_c(DCTELEM *block, const uint8_t *s1, const uint8_t *s2, int stride);
void put_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
void add_pixels_clamped_c(const DCTELEM *block, uint8_t *pixels, int line_size);
void clear_blocks_c(DCTELEM *blocks);
void get_pixels_c(int16_t *block, const uint8_t *pixels, int line_size);
void diff_pixels_c(int16_t *block, const uint8_t *s1, const uint8_t *s2, int stride);
void put_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size);
void add_pixels_clamped_c(const int16_t *block, uint8_t *pixels, int line_size);
void clear_blocks_c(int16_t *blocks);
*/
/* add and put pixel (decoding) */
@ -212,14 +211,14 @@ typedef struct DSPContext {
int dct_bits;
/* pixel ops : interface with DCT */
void (*get_pixels)(DCTELEM *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
void (*diff_pixels)(DCTELEM *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
void (*put_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*put_signed_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels_clamped)(const DCTELEM *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels8)(uint8_t *pixels, DCTELEM *block, int line_size);
void (*add_pixels4)(uint8_t *pixels, DCTELEM *block, int line_size);
int (*sum_abs_dctelem)(DCTELEM *block/*align 16*/);
void (*get_pixels)(int16_t *block/*align 16*/, const uint8_t *pixels/*align 8*/, int line_size);
void (*diff_pixels)(int16_t *block/*align 16*/, const uint8_t *s1/*align 8*/, const uint8_t *s2/*align 8*/, int stride);
void (*put_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*put_signed_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels_clamped)(const int16_t *block/*align 16*/, uint8_t *pixels/*align 8*/, int line_size);
void (*add_pixels8)(uint8_t *pixels, int16_t *block, int line_size);
void (*add_pixels4)(uint8_t *pixels, int16_t *block, int line_size);
int (*sum_abs_dctelem)(int16_t *block/*align 16*/);
/**
* translational global motion compensation.
*/
@ -229,8 +228,8 @@ typedef struct DSPContext {
*/
void (*gmc )(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int stride, int h, int ox, int oy,
int dxx, int dxy, int dyx, int dyy, int shift, int r, int width, int height);
void (*clear_block)(DCTELEM *block/*align 16*/);
void (*clear_blocks)(DCTELEM *blocks/*align 16*/);
void (*clear_block)(int16_t *block/*align 16*/);
void (*clear_blocks)(int16_t *blocks/*align 16*/);
int (*pix_sum)(uint8_t * pix, int line_size);
int (*pix_norm1)(uint8_t * pix, int line_size);
// 16x16 8x8 4x4 2x2 16x8 8x4 4x2 8x16 4x8 2x4
@ -362,24 +361,24 @@ typedef struct DSPContext {
void (*vector_clipf)(float *dst /* align 16 */, const float *src /* align 16 */, float min, float max, int len /* align 16 */);
/* (I)DCT */
void (*fdct)(DCTELEM *block/* align 16*/);
void (*fdct248)(DCTELEM *block/* align 16*/);
void (*fdct)(int16_t *block/* align 16*/);
void (*fdct248)(int16_t *block/* align 16*/);
/* IDCT really*/
void (*idct)(DCTELEM *block/* align 16*/);
void (*idct)(int16_t *block/* align 16*/);
/**
* block -> idct -> clip to unsigned 8 bit -> dest.
* (-1392, 0, 0, ...) -> idct -> (-174, -174, ...) -> put -> (0, 0, ...)
* @param line_size size in bytes of a horizontal line of dest
*/
void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
void (*idct_put)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
/**
* block -> idct -> add dest -> clip to unsigned 8 bit -> dest.
* @param line_size size in bytes of a horizontal line of dest
*/
void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, DCTELEM *block/*align 16*/);
void (*idct_add)(uint8_t *dest/*align 8*/, int line_size, int16_t *block/*align 16*/);
/**
* idct input permutation.
@ -470,7 +469,7 @@ int ff_check_alignment(void);
* permute block according to permuatation.
* @param last last non zero element in scantable order
*/
void ff_block_permute(DCTELEM *block, uint8_t *permutation, const uint8_t *scantable, int last);
void ff_block_permute(int16_t *block, uint8_t *permutation, const uint8_t *scantable, int last);
void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);

@ -114,7 +114,7 @@ static void FUNCC(draw_edges)(uint8_t *p_buf, int p_wrap, int width, int height,
}
#define DCTELEM_FUNCS(dctcoef, suffix) \
static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block, \
static void FUNCC(get_pixels ## suffix)(int16_t *av_restrict _block, \
const uint8_t *_pixels, \
int line_size) \
{ \
@ -138,7 +138,7 @@ static void FUNCC(get_pixels ## suffix)(DCTELEM *av_restrict _block, \
} \
\
static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \
DCTELEM *_block, \
int16_t *_block, \
int line_size) \
{ \
int i; \
@ -161,7 +161,7 @@ static void FUNCC(add_pixels8 ## suffix)(uint8_t *av_restrict _pixels, \
} \
\
static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \
DCTELEM *_block, \
int16_t *_block, \
int line_size) \
{ \
int i; \
@ -179,20 +179,20 @@ static void FUNCC(add_pixels4 ## suffix)(uint8_t *av_restrict _pixels, \
} \
} \
\
static void FUNCC(clear_block ## suffix)(DCTELEM *block) \
static void FUNCC(clear_block ## suffix)(int16_t *block) \
{ \
memset(block, 0, sizeof(dctcoef)*64); \
} \
\
/** \
* memset(blocks, 0, sizeof(DCTELEM)*6*64) \
* memset(blocks, 0, sizeof(int16_t)*6*64) \
*/ \
static void FUNCC(clear_blocks ## suffix)(DCTELEM *blocks) \
static void FUNCC(clear_blocks ## suffix)(int16_t *blocks) \
{ \
memset(blocks, 0, sizeof(dctcoef)*6*64); \
}
DCTELEM_FUNCS(DCTELEM, _16)
DCTELEM_FUNCS(int16_t, _16)
#if BIT_DEPTH > 8
DCTELEM_FUNCS(dctcoef, _32)
#endif

@ -417,7 +417,7 @@ typedef struct EncBlockInfo {
int cur_ac;
int cno;
int dct_mode;
DCTELEM mb[64];
int16_t mb[64];
uint8_t next[64];
uint8_t sign[64];
uint8_t partial_bit_count;
@ -506,7 +506,7 @@ static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, i
{
const int *weight;
const uint8_t* zigzag_scan;
LOCAL_ALIGNED_16(DCTELEM, blk, [64]);
LOCAL_ALIGNED_16(int16_t, blk, [64]);
int i, area;
/* We offer two different methods for class number assignment: the
method suggested in SMPTE 314M Table 22, and an improved

@ -40,9 +40,9 @@ typedef struct DVVideoContext {
uint8_t dv_zigzag[2][64];
void (*get_pixels)(DCTELEM *block, const uint8_t *pixels, int line_size);
void (*fdct[2])(DCTELEM *block);
void (*idct_put[2])(uint8_t *dest, int line_size, DCTELEM *block);
void (*get_pixels)(int16_t *block, const uint8_t *pixels, int line_size);
void (*fdct[2])(int16_t *block);
void (*idct_put[2])(uint8_t *dest, int line_size, int16_t *block);
me_cmp_func ildct_cmp;
} DVVideoContext;

@ -49,7 +49,7 @@ typedef struct BlockInfo {
const uint32_t *factor_table;
const uint8_t *scan_table;
uint8_t pos; /* position in block */
void (*idct_put)(uint8_t *dest, int line_size, DCTELEM *block);
void (*idct_put)(uint8_t *dest, int line_size, int16_t *block);
uint8_t partial_bit_count;
uint32_t partial_bit_buffer;
int shift_offset;
@ -58,7 +58,7 @@ typedef struct BlockInfo {
static const int dv_iweight_bits = 14;
/* decode AC coefficients */
static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, int16_t *block)
{
int last_index = gb->size_in_bits;
const uint8_t *scan_table = mb->scan_table;
@ -136,14 +136,14 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
int quant, dc, dct_mode, class1, j;
int mb_index, mb_x, mb_y, last_index;
int y_stride, linesize;
DCTELEM *block, *block1;
int16_t *block, *block1;
int c_offset;
uint8_t *y_ptr;
const uint8_t *buf_ptr;
PutBitContext pb, vs_pb;
GetBitContext gb;
BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
LOCAL_ALIGNED_16(DCTELEM, sblock, [5*DV_MAX_BPM], [64]);
LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]);
LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [ 80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]); /* allow some slack */
const int log2_blocksize = 3-s->avctx->lowres;

@ -64,7 +64,7 @@
#define MUNGE_8BIT(x) av_clip_uint8((x)>>4)
#define IDCT_ROW(dest,src) IDCT_TRANSFORM(dest,0,1,2,3,4,5,6,7,0,1,2,3,4,5,6,7,MUNGE_8BIT,src)
static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) {
static inline void ea_idct_col(int16_t *dest, const int16_t *src) {
if ((src[8]|src[16]|src[24]|src[32]|src[40]|src[48]|src[56])==0) {
dest[0] =
dest[8] =
@ -78,9 +78,9 @@ static inline void ea_idct_col(DCTELEM *dest, const DCTELEM *src) {
IDCT_COL(dest, src);
}
void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block) {
void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block) {
int i;
DCTELEM temp[64];
int16_t temp[64];
block[0] += 4;
for (i=0; i<8; i++)
ea_idct_col(&temp[i], &block[i]);

@ -20,8 +20,7 @@
#define AVCODEC_EAIDCT_H
#include <stdint.h>
#include "dsputil.h"
void ff_ea_idct_put_c(uint8_t *dest, int linesize, DCTELEM *block);
void ff_ea_idct_put_c(uint8_t *dest, int linesize, int16_t *block);
#endif /* AVCODEC_EAIDCT_H */

@ -51,7 +51,7 @@ typedef struct MadContext {
GetBitContext gb;
void *bitstream_buf;
unsigned int bitstream_buf_size;
DECLARE_ALIGNED(16, DCTELEM, block)[64];
DECLARE_ALIGNED(16, int16_t, block)[64];
ScanTable scantable;
uint16_t quant_matrix[64];
int mb_x;
@ -102,7 +102,7 @@ static inline void comp_block(MadContext *t, int mb_x, int mb_y,
}
}
static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, int j)
static inline void idct_put(MadContext *t, int16_t *block, int mb_x, int mb_y, int j)
{
if (j < 4) {
ff_ea_idct_put_c(
@ -116,7 +116,7 @@ static inline void idct_put(MadContext *t, DCTELEM *block, int mb_x, int mb_y, i
}
}
static inline int decode_block_intra(MadContext *s, DCTELEM * block)
static inline int decode_block_intra(MadContext *s, int16_t * block)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;

@ -43,7 +43,7 @@ typedef struct TgqContext {
int width,height;
ScanTable scantable;
int qtable[64];
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
DECLARE_ALIGNED(16, int16_t, block)[6][64];
GetByteContext gb;
} TgqContext;
@ -58,7 +58,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){
return 0;
}
static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb){
static void tgq_decode_block(TgqContext *s, int16_t block[64], GetBitContext *gb){
uint8_t *perm = s->scantable.permutated;
int i,j,value;
block[0] = get_sbits(gb,8) * s->qtable[0];
@ -103,7 +103,7 @@ static void tgq_decode_block(TgqContext *s, DCTELEM block[64], GetBitContext *gb
block[0] += 128<<4;
}
static void tgq_idct_put_mb(TgqContext *s, DCTELEM (*block)[64], int mb_x, int mb_y){
static void tgq_idct_put_mb(TgqContext *s, int16_t (*block)[64], int mb_x, int mb_y){
int linesize= s->frame.linesize[0];
uint8_t *dest_y = s->frame.data[0] + (mb_y * 16* linesize ) + mb_x * 16;
uint8_t *dest_cb = s->frame.data[1] + (mb_y * 8 * s->frame.linesize[1]) + mb_x * 8;

@ -40,7 +40,7 @@ typedef struct TqiContext {
AVFrame frame;
void *bitstream_buf;
unsigned int bitstream_buf_size;
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
DECLARE_ALIGNED(16, int16_t, block)[6][64];
} TqiContext;
static av_cold int tqi_decode_init(AVCodecContext *avctx)
@ -58,7 +58,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
return 0;
}
static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
static int tqi_decode_mb(MpegEncContext *s, int16_t (*block)[64])
{
int n;
s->dsp.clear_blocks(block[0]);
@ -69,7 +69,7 @@ static int tqi_decode_mb(MpegEncContext *s, DCTELEM (*block)[64])
return 0;
}
static inline void tqi_idct_put(TqiContext *t, DCTELEM (*block)[64])
static inline void tqi_idct_put(TqiContext *t, int16_t (*block)[64])
{
MpegEncContext *s = &t->s;
int linesize= t->frame.linesize[0];

@ -64,7 +64,7 @@ B6*B0, B6*B1, B6*B2, B6*B3, B6*B4, B6*B5, B6*B6, B6*B7,
B7*B0, B7*B1, B7*B2, B7*B3, B7*B4, B7*B5, B7*B6, B7*B7,
};
static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data)
static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data)
{
FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
FLOAT tmp10, tmp11, tmp12, tmp13;
@ -119,7 +119,7 @@ static av_always_inline void row_fdct(FLOAT temp[64], DCTELEM * data)
}
}
void ff_faandct(DCTELEM * data)
void ff_faandct(int16_t *data)
{
FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
FLOAT tmp10, tmp11, tmp12, tmp13;
@ -179,7 +179,7 @@ void ff_faandct(DCTELEM * data)
}
}
void ff_faandct248(DCTELEM * data)
void ff_faandct248(int16_t *data)
{
FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
FLOAT tmp10, tmp11, tmp12, tmp13;

@ -29,9 +29,9 @@
#ifndef AVCODEC_FAANDCT_H
#define AVCODEC_FAANDCT_H
#include "dsputil.h"
#include <stdint.h>
void ff_faandct(DCTELEM * data);
void ff_faandct248(DCTELEM * data);
void ff_faandct(int16_t *data);
void ff_faandct248(int16_t *data);
#endif /* AVCODEC_FAANDCT_H */

@ -47,7 +47,7 @@ B6*B0/8, B6*B1/8, B6*B2/8, B6*B3/8, B6*B4/8, B6*B5/8, B6*B6/8, B6*B7/8,
B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8,
};
static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){
static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){
int i;
FLOAT av_unused tmp0;
FLOAT s04, d04, s17, d17, s26, d26, s53, d53;
@ -129,7 +129,7 @@ static inline void p8idct(DCTELEM data[64], FLOAT temp[64], uint8_t *dest, int s
}
}
void ff_faanidct(DCTELEM block[64]){
void ff_faanidct(int16_t block[64]){
FLOAT temp[64];
int i;
@ -142,7 +142,7 @@ void ff_faanidct(DCTELEM block[64]){
p8idct(block, temp, NULL, 0, 8, 1, 1);
}
void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){
void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]){
FLOAT temp[64];
int i;
@ -155,7 +155,7 @@ void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]){
p8idct(NULL , temp, dest, line_size, 8, 1, 2);
}
void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]){
void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]){
FLOAT temp[64];
int i;

@ -23,10 +23,9 @@
#define AVCODEC_FAANIDCT_H
#include <stdint.h>
#include "dsputil.h"
void ff_faanidct(DCTELEM block[64]);
void ff_faanidct_add(uint8_t *dest, int line_size, DCTELEM block[64]);
void ff_faanidct_put(uint8_t *dest, int line_size, DCTELEM block[64]);
void ff_faanidct(int16_t block[64]);
void ff_faanidct_add(uint8_t *dest, int line_size, int16_t block[64]);
void ff_faanidct_put(uint8_t *dest, int line_size, int16_t block[64]);
#endif /* AVCODEC_FAANIDCT_H */

@ -48,7 +48,7 @@ static VLC h261_mtype_vlc;
static VLC h261_mv_vlc;
static VLC h261_cbp_vlc;
static int h261_decode_block(H261Context * h, DCTELEM * block, int n, int coded);
static int h261_decode_block(H261Context * h, int16_t * block, int n, int coded);
static av_cold void h261_decode_init_vlc(H261Context *h){
static int done = 0;
@ -366,7 +366,7 @@ intra:
* Decode a macroblock.
* @return <0 if an error occurred
*/
static int h261_decode_block(H261Context * h, DCTELEM * block,
static int h261_decode_block(H261Context * h, int16_t * block,
int n, int coded)
{
MpegEncContext * const s = &h->s;

@ -35,7 +35,7 @@
extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
static void h261_encode_block(H261Context * h, DCTELEM * block,
static void h261_encode_block(H261Context * h, int16_t * block,
int n);
int ff_h261_get_picture_format(int width, int height){
@ -144,7 +144,7 @@ static void h261_encode_motion(H261Context * h, int val){
}
static inline int get_cbp(MpegEncContext * s,
DCTELEM block[6][64])
int16_t block[6][64])
{
int i, cbp;
cbp= 0;
@ -155,7 +155,7 @@ static inline int get_cbp(MpegEncContext * s,
return cbp;
}
void ff_h261_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y)
{
H261Context * h = (H261Context *)s;
@ -256,7 +256,7 @@ void ff_h261_encode_init(MpegEncContext *s){
* @param block the 8x8 block
* @param n block index (0-3 are luma, 4-5 are chroma)
*/
static void h261_encode_block(H261Context * h, DCTELEM * block, int n){
static void h261_encode_block(H261Context * h, int16_t * block, int n){
MpegEncContext * const s = &h->s;
int level, run, i, j, last_index, last_non_zero, sign, slevel, code;
RLTable *rl;

@ -226,7 +226,7 @@ void ff_h263_loop_filter(MpegEncContext * s){
}
}
void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n)
void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n)
{
int x, y, wrap, a, c, pred_dc, scale, i;
int16_t *dc_val, *ac_val, *ac_val1;

@ -73,7 +73,7 @@ int ff_h263_decode_frame(AVCodecContext *avctx,
AVPacket *avpkt);
int ff_h263_decode_end(AVCodecContext *avctx);
void ff_h263_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
void ff_h263_encode_picture_header(MpegEncContext *s, int picture_number);
void ff_h263_encode_gob_header(MpegEncContext * s, int mb_line);
@ -89,7 +89,7 @@ int ff_h263_decode_mba(MpegEncContext *s);
void ff_h263_encode_mba(MpegEncContext *s);
void ff_init_qscale_tab(MpegEncContext *s);
int ff_h263_pred_dc(MpegEncContext * s, int n, int16_t **dc_val_ptr);
void ff_h263_pred_acdc(MpegEncContext * s, DCTELEM *block, int n);
void ff_h263_pred_acdc(MpegEncContext * s, int16_t *block, int n);
/**
@ -99,7 +99,7 @@ void ff_h263_show_pict_info(MpegEncContext *s);
int ff_intel_h263_decode_picture_header(MpegEncContext *s);
int ff_h263_decode_mb(MpegEncContext *s,
DCTELEM block[6][64]);
int16_t block[6][64]);
/**
* Return the value of the 3bit "source format" syntax element.
@ -144,7 +144,7 @@ static inline void ff_h263_encode_motion_vector(MpegEncContext * s, int x, int y
}
static inline int get_p_cbp(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y){
int cbp, i;

@ -1769,7 +1769,7 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
}
}
static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth,
static av_always_inline int dctcoef_get(int16_t *mb, int high_bit_depth,
int index)
{
if (high_bit_depth) {
@ -1778,7 +1778,7 @@ static av_always_inline int dctcoef_get(DCTELEM *mb, int high_bit_depth,
return AV_RN16A(mb + index);
}
static av_always_inline void dctcoef_set(DCTELEM *mb, int high_bit_depth,
static av_always_inline void dctcoef_set(int16_t *mb, int high_bit_depth,
int index, int value)
{
if (high_bit_depth) {
@ -1797,8 +1797,8 @@ static av_always_inline void hl_decode_mb_predict_luma(H264Context *h,
uint8_t *dest_y, int p)
{
MpegEncContext *const s = &h->s;
void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*idct_dc_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
void (*idct_dc_add)(uint8_t *dst, int16_t *block, int stride);
int i;
int qscale = p == 0 ? s->qscale : h->chroma_qp[p - 1];
block_offset += 16 * p;
@ -1914,7 +1914,7 @@ static av_always_inline void hl_decode_mb_idct_luma(H264Context *h, int mb_type,
uint8_t *dest_y, int p)
{
MpegEncContext *const s = &h->s;
void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
int i;
block_offset += 16 * p;
if (!IS_INTRA4x4(mb_type)) {

@ -29,7 +29,6 @@
#define AVCODEC_H264_H
#include "libavutil/intreadwrite.h"
#include "dsputil.h"
#include "cabac.h"
#include "mpegvideo.h"
#include "h264dsp.h"
@ -390,9 +389,9 @@ typedef struct H264Context {
GetBitContext *intra_gb_ptr;
GetBitContext *inter_gb_ptr;
DECLARE_ALIGNED(16, DCTELEM, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
DECLARE_ALIGNED(16, DCTELEM, mb_luma_dc)[3][16 * 2];
DCTELEM mb_padding[256 * 2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb
DECLARE_ALIGNED(16, int16_t, mb)[16 * 48 * 2]; ///< as a dct coeffecient is int32_t in high depth, we need to reserve twice the space.
DECLARE_ALIGNED(16, int16_t, mb_luma_dc)[3][16 * 2];
int16_t mb_padding[256 * 2]; ///< as mb is addressed by scantable[i] and scantable is uint8_t we can either check that i is not too large or ensure that there is some unused stuff after mb
/**
* Cabac

@ -1560,7 +1560,7 @@ static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx,
}
static av_always_inline void
decode_cabac_residual_internal(H264Context *h, DCTELEM *block,
decode_cabac_residual_internal(H264Context *h, int16_t *block,
int cat, int n, const uint8_t *scantable,
const uint32_t *qmul, int max_coeff,
int is_dc, int chroma422)
@ -1744,18 +1744,27 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block,
}
static void decode_cabac_residual_dc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) {
static void decode_cabac_residual_dc_internal(H264Context *h, int16_t *block,
int cat, int n,
const uint8_t *scantable,
int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 0);
}
static void decode_cabac_residual_dc_internal_422(H264Context *h, DCTELEM *block,
static void decode_cabac_residual_dc_internal_422(H264Context *h, int16_t *block,
int cat, int n, const uint8_t *scantable,
int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, NULL, max_coeff, 1, 1);
}
static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) {
static void decode_cabac_residual_nondc_internal(H264Context *h, int16_t *block,
int cat, int n,
const uint8_t *scantable,
const uint32_t *qmul,
int max_coeff)
{
decode_cabac_residual_internal(h, block, cat, n, scantable, qmul, max_coeff, 0, 0);
}
@ -1771,7 +1780,12 @@ static void decode_cabac_residual_nondc_internal( H264Context *h, DCTELEM *block
* because it allows improved constant propagation into get_cabac_cbf_ctx,
* as well as because most blocks have zero CBFs. */
static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, int max_coeff ) {
static av_always_inline void decode_cabac_residual_dc(H264Context *h,
int16_t *block,
int cat, int n,
const uint8_t *scantable,
int max_coeff)
{
/* read coded block flag */
if( get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 1 ) ] ) == 0 ) {
h->non_zero_count_cache[scan8[n]] = 0;
@ -1781,7 +1795,7 @@ static av_always_inline void decode_cabac_residual_dc( H264Context *h, DCTELEM *
}
static av_always_inline void
decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block,
decode_cabac_residual_dc_422(H264Context *h, int16_t *block,
int cat, int n, const uint8_t *scantable,
int max_coeff)
{
@ -1793,7 +1807,13 @@ decode_cabac_residual_dc_422(H264Context *h, DCTELEM *block,
decode_cabac_residual_dc_internal_422(h, block, cat, n, scantable, max_coeff);
}
static av_always_inline void decode_cabac_residual_nondc( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff ) {
static av_always_inline void decode_cabac_residual_nondc(H264Context *h,
int16_t *block,
int cat, int n,
const uint8_t *scantable,
const uint32_t *qmul,
int max_coeff)
{
/* read coded block flag */
if( (cat != 5 || CHROMA444) && get_cabac( &h->cabac, &h->cabac_state[get_cabac_cbf_ctx( h, cat, n, max_coeff, 0 ) ] ) == 0 ) {
if( max_coeff == 64 ) {
@ -2361,7 +2381,7 @@ decode_intra_mb:
if( cbp&0x20 ) {
int c, i, i8x8;
for( c = 0; c < 2; c++ ) {
DCTELEM *mb = h->mb + (16*(16 + 16*c) << pixel_shift);
int16_t *mb = h->mb + (16*(16 + 16*c) << pixel_shift);
qmul = h->dequant4_coeff[c+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[c]];
for (i8x8 = 0; i8x8 < 2; i8x8++) {
for (i = 0; i < 4; i++) {

@ -442,7 +442,7 @@ static inline int get_level_prefix(GetBitContext *gb){
* @param max_coeff number of coefficients in the block
* @return <0 if an error occurred
*/
static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
static int decode_residual(H264Context *h, GetBitContext *gb, int16_t *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff){
MpegEncContext * const s = &h->s;
static const int coeff_token_table_index[17]= {0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3};
int level[16];
@ -662,7 +662,7 @@ static av_always_inline int decode_luma_residual(H264Context *h, GetBitContext *
for(i8x8=0; i8x8<4; i8x8++){
if(cbp & (1<<i8x8)){
if(IS_8x8DCT(mb_type)){
DCTELEM *buf = &h->mb[64*i8x8+256*p << pixel_shift];
int16_t *buf = &h->mb[64*i8x8+256*p << pixel_shift];
uint8_t *nnz;
for(i4x4=0; i4x4<4; i4x4++){
const int index= i4x4 + 4*i8x8 + p*16;
@ -1143,7 +1143,7 @@ decode_intra_mb:
if(cbp&0x20){
for(chroma_idx=0; chroma_idx<2; chroma_idx++){
const uint32_t *qmul = h->dequant4_coeff[chroma_idx+1+(IS_INTRA( mb_type ) ? 0:3)][h->chroma_qp[chroma_idx]];
DCTELEM *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift);
int16_t *mb = h->mb + (16*(16 + 16*chroma_idx) << pixel_shift);
for (i8x8=0; i8x8<num_c8x8; i8x8++) {
for (i4x4=0; i4x4<4; i4x4++) {
const int index= 16 + 16*chroma_idx + 8*i8x8 + i4x4;

@ -52,7 +52,7 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h)
const int transform_bypass = !SIMPLE && (s->qscale == 0 && h->sps.transform_bypass);
/* is_h264 should always be true if SVQ3 is disabled. */
const int is_h264 = !CONFIG_SVQ3_DECODER || SIMPLE || s->codec_id == AV_CODEC_ID_H264;
void (*idct_add)(uint8_t *dst, DCTELEM *block, int stride);
void (*idct_add)(uint8_t *dst, int16_t *block, int stride);
const int block_h = 16 >> s->chroma_y_shift;
const int chroma422 = CHROMA422;

@ -29,8 +29,6 @@
#include <stdint.h>
#include "dsputil.h"
typedef void (*h264_weight_func)(uint8_t *block, int stride, int height,
int log2_denom, int weight, int offset);
typedef void (*h264_biweight_func)(uint8_t *dst, uint8_t *src,
@ -80,29 +78,29 @@ typedef struct H264DSPContext {
/* IDCT */
void (*h264_idct_add)(uint8_t *dst /*align 4*/,
DCTELEM *block /*align 16*/, int stride);
int16_t *block /*align 16*/, int stride);
void (*h264_idct8_add)(uint8_t *dst /*align 8*/,
DCTELEM *block /*align 16*/, int stride);
int16_t *block /*align 16*/, int stride);
void (*h264_idct_dc_add)(uint8_t *dst /*align 4*/,
DCTELEM *block /*align 16*/, int stride);
int16_t *block /*align 16*/, int stride);
void (*h264_idct8_dc_add)(uint8_t *dst /*align 8*/,
DCTELEM *block /*align 16*/, int stride);
int16_t *block /*align 16*/, int stride);
void (*h264_idct_add16)(uint8_t *dst /*align 16*/, const int *blockoffset,
DCTELEM *block /*align 16*/, int stride,
int16_t *block /*align 16*/, int stride,
const uint8_t nnzc[15 * 8]);
void (*h264_idct8_add4)(uint8_t *dst /*align 16*/, const int *blockoffset,
DCTELEM *block /*align 16*/, int stride,
int16_t *block /*align 16*/, int stride,
const uint8_t nnzc[15 * 8]);
void (*h264_idct_add8)(uint8_t **dst /*align 16*/, const int *blockoffset,
DCTELEM *block /*align 16*/, int stride,
int16_t *block /*align 16*/, int stride,
const uint8_t nnzc[15 * 8]);
void (*h264_idct_add16intra)(uint8_t *dst /*align 16*/, const int *blockoffset,
DCTELEM *block /*align 16*/,
int16_t *block /*align 16*/,
int stride, const uint8_t nnzc[15 * 8]);
void (*h264_luma_dc_dequant_idct)(DCTELEM *output,
DCTELEM *input /*align 16*/, int qmul);
void (*h264_chroma_dc_dequant_idct)(DCTELEM *block, int qmul);
void (*h264_luma_dc_dequant_idct)(int16_t *output,
int16_t *input /*align 16*/, int qmul);
void (*h264_chroma_dc_dequant_idct)(int16_t *block, int qmul);
} H264DSPContext;
void ff_h264dsp_init(H264DSPContext *c, const int bit_depth,

@ -47,7 +47,7 @@ static const uint8_t scan8[16*3]={
};
#endif
void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride)
void FUNCC(ff_h264_idct_add)(uint8_t *_dst, int16_t *_block, int stride)
{
int i;
pixel *dst = (pixel*)_dst;
@ -81,7 +81,7 @@ void FUNCC(ff_h264_idct_add)(uint8_t *_dst, DCTELEM *_block, int stride)
}
}
void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){
void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, int16_t *_block, int stride){
int i;
pixel *dst = (pixel*)_dst;
dctcoef *block = (dctcoef*)_block;
@ -154,10 +154,10 @@ void FUNCC(ff_h264_idct8_add)(uint8_t *_dst, DCTELEM *_block, int stride){
}
// assumes all AC coefs are 0
void FUNCC(ff_h264_idct_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){
void FUNCC(ff_h264_idct_dc_add)(uint8_t *_dst, int16_t *block, int stride){
int i, j;
int dc = (((dctcoef*)block)[0] + 32) >> 6;
pixel *dst = (pixel*)p_dst;
pixel *dst = (pixel*)_dst;
stride >>= sizeof(pixel)-1;
for( j = 0; j < 4; j++ )
{
@ -167,10 +167,10 @@ void FUNCC(ff_h264_idct_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){
}
}
void FUNCC(ff_h264_idct8_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){
void FUNCC(ff_h264_idct8_dc_add)(uint8_t *_dst, int16_t *block, int stride){
int i, j;
int dc = (((dctcoef*)block)[0] + 32) >> 6;
pixel *dst = (pixel*)p_dst;
pixel *dst = (pixel*)_dst;
stride >>= sizeof(pixel)-1;
for( j = 0; j < 8; j++ )
{
@ -180,7 +180,7 @@ void FUNCC(ff_h264_idct8_dc_add)(uint8_t *p_dst, DCTELEM *block, int stride){
}
}
void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){
void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
int i;
for(i=0; i<16; i++){
int nnz = nnzc[ scan8[i] ];
@ -191,7 +191,7 @@ void FUNCC(ff_h264_idct_add16)(uint8_t *dst, const int *block_offset, DCTELEM *b
}
}
void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){
void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
int i;
for(i=0; i<16; i++){
if(nnzc[ scan8[i] ]) FUNCC(ff_h264_idct_add )(dst + block_offset[i], block + i*16*sizeof(pixel), stride);
@ -199,7 +199,7 @@ void FUNCC(ff_h264_idct_add16intra)(uint8_t *dst, const int *block_offset, DCTEL
}
}
void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){
void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
int i;
for(i=0; i<16; i+=4){
int nnz = nnzc[ scan8[i] ];
@ -210,7 +210,7 @@ void FUNCC(ff_h264_idct8_add4)(uint8_t *dst, const int *block_offset, DCTELEM *b
}
}
void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){
void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
int i, j;
for(j=1; j<3; j++){
for(i=j*16; i<j*16+4; i++){
@ -222,7 +222,7 @@ void FUNCC(ff_h264_idct_add8)(uint8_t **dest, const int *block_offset, DCTELEM *
}
}
void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTELEM *block, int stride, const uint8_t nnzc[15*8]){
void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, int16_t *block, int stride, const uint8_t nnzc[15*8]){
int i, j;
for(j=1; j<3; j++){
@ -248,13 +248,13 @@ void FUNCC(ff_h264_idct_add8_422)(uint8_t **dest, const int *block_offset, DCTEL
* IDCT transforms the 16 dc values and dequantizes them.
* @param qmul quantization parameter
*/
void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, int qmul){
void FUNCC(ff_h264_luma_dc_dequant_idct)(int16_t *_output, int16_t *_input, int qmul){
#define stride 16
int i;
int temp[16];
static const uint8_t x_offset[4]={0, 2*stride, 8*stride, 10*stride};
dctcoef *input = (dctcoef*)p_input;
dctcoef *output = (dctcoef*)p_output;
dctcoef *input = (dctcoef*)_input;
dctcoef *output = (dctcoef*)_output;
for(i=0; i<4; i++){
const int z0= input[4*i+0] + input[4*i+1];
@ -283,7 +283,7 @@ void FUNCC(ff_h264_luma_dc_dequant_idct)(DCTELEM *p_output, DCTELEM *p_input, in
#undef stride
}
void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){
void FUNCC(ff_h264_chroma422_dc_dequant_idct)(int16_t *_block, int qmul){
const int stride= 16*2;
const int xStride= 16;
int i;
@ -310,7 +310,7 @@ void FUNCC(ff_h264_chroma422_dc_dequant_idct)(DCTELEM *_block, int qmul){
}
}
void FUNCC(ff_h264_chroma_dc_dequant_idct)(DCTELEM *_block, int qmul){
void FUNCC(ff_h264_chroma_dc_dequant_idct)(int16_t *_block, int qmul){
const int stride= 16*2;
const int xStride= 16;
int a,b,c,d,e;

@ -28,8 +28,8 @@
#ifndef AVCODEC_H264PRED_H
#define AVCODEC_H264PRED_H
#include "libavutil/common.h"
#include "dsputil.h"
#include <stddef.h>
#include <stdint.h>
/**
* Prediction types
@ -98,15 +98,15 @@ typedef struct H264PredContext {
void(*pred16x16[4 + 3 + 2])(uint8_t *src, ptrdiff_t stride);
void(*pred4x4_add[2])(uint8_t *pix /*align 4*/,
const DCTELEM *block /*align 16*/, ptrdiff_t stride);
const int16_t *block /*align 16*/, ptrdiff_t stride);
void(*pred8x8l_add[2])(uint8_t *pix /*align 8*/,
const DCTELEM *block /*align 16*/, ptrdiff_t stride);
const int16_t *block /*align 16*/, ptrdiff_t stride);
void(*pred8x8_add[3])(uint8_t *pix /*align 8*/,
const int *block_offset,
const DCTELEM *block /*align 16*/, ptrdiff_t stride);
const int16_t *block /*align 16*/, ptrdiff_t stride);
void(*pred16x16_add[3])(uint8_t *pix /*align 16*/,
const int *block_offset,
const DCTELEM *block /*align 16*/, ptrdiff_t stride);
const int16_t *block /*align 16*/, ptrdiff_t stride);
} H264PredContext;
void ff_h264_pred_init(H264PredContext *h, int codec_id,

@ -1132,7 +1132,7 @@ static void FUNCC(pred8x8l_horizontal_up)(uint8_t *_src, int has_topleft,
#undef PL
#undef SRC
static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
@ -1151,7 +1151,7 @@ static void FUNCC(pred4x4_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
}
}
static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
@ -1169,7 +1169,7 @@ static void FUNCC(pred4x4_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
}
}
static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
@ -1192,7 +1192,7 @@ static void FUNCC(pred8x8l_vertical_add)(uint8_t *_pix, const DCTELEM *_block,
}
}
static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const int16_t *_block,
ptrdiff_t stride)
{
int i;
@ -1215,7 +1215,7 @@ static void FUNCC(pred8x8l_horizontal_add)(uint8_t *_pix, const DCTELEM *_block,
}
static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset,
const DCTELEM *block,
const int16_t *block,
ptrdiff_t stride)
{
int i;
@ -1225,7 +1225,7 @@ static void FUNCC(pred16x16_vertical_add)(uint8_t *pix, const int *block_offset,
static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix,
const int *block_offset,
const DCTELEM *block,
const int16_t *block,
ptrdiff_t stride)
{
int i;
@ -1234,7 +1234,7 @@ static void FUNCC(pred16x16_horizontal_add)(uint8_t *pix,
}
static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset,
const DCTELEM *block, ptrdiff_t stride)
const int16_t *block, ptrdiff_t stride)
{
int i;
for(i=0; i<4; i++)
@ -1242,7 +1242,7 @@ static void FUNCC(pred8x8_vertical_add)(uint8_t *pix, const int *block_offset,
}
static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
const DCTELEM *block, ptrdiff_t stride)
const int16_t *block, ptrdiff_t stride)
{
int i;
for(i=0; i<4; i++)
@ -1252,7 +1252,7 @@ static void FUNCC(pred8x16_vertical_add)(uint8_t *pix, const int *block_offset,
}
static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
const DCTELEM *block,
const int16_t *block,
ptrdiff_t stride)
{
int i;
@ -1262,7 +1262,7 @@ static void FUNCC(pred8x8_horizontal_add)(uint8_t *pix, const int *block_offset,
static void FUNCC(pred8x16_horizontal_add)(uint8_t *pix,
const int *block_offset,
const DCTELEM *block, ptrdiff_t stride)
const int16_t *block, ptrdiff_t stride)
{
int i;
for(i=0; i<4; i++)

@ -439,7 +439,7 @@ static void h263_decode_dquant(MpegEncContext *s){
ff_set_qscale(s, s->qscale);
}
static int h263_decode_block(MpegEncContext * s, DCTELEM * block,
static int h263_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded)
{
int code, level, i, j, last, run;
@ -564,7 +564,7 @@ not_coded:
static int h263_skip_b_part(MpegEncContext *s, int cbp)
{
LOCAL_ALIGNED_16(DCTELEM, dblock, [64]);
LOCAL_ALIGNED_16(int16_t, dblock, [64]);
int i, mbi;
int bli[6];
@ -603,7 +603,7 @@ static int h263_get_modb(GetBitContext *gb, int pb_frame, int *cbpb)
}
int ff_h263_decode_mb(MpegEncContext *s,
DCTELEM block[6][64])
int16_t block[6][64])
{
int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
int16_t *mot_val;

@ -303,7 +303,7 @@ static const int dquant_code[5]= {1,0,9,2,3};
* @param block the 8x8 block
* @param n block index (0-3 are luma, 4-5 are chroma)
*/
static void h263_encode_block(MpegEncContext * s, DCTELEM * block, int n)
static void h263_encode_block(MpegEncContext * s, int16_t * block, int n)
{
int level, run, last, i, j, last_index, last_non_zero, sign, slevel, code;
RLTable *rl;
@ -452,7 +452,7 @@ static void h263p_encode_umotion(MpegEncContext * s, int val)
}
void ff_h263_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y)
{
int cbpc, cbpy, i, cbp, pred_x, pred_y;

@ -136,17 +136,17 @@
#endif
/* Multiply a DCTELEM variable by an int32_t constant, and immediately
* descale to yield a DCTELEM result.
/* Multiply a int16_t variable by an int32_t constant, and immediately
* descale to yield a int16_t result.
*/
#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
#define MULTIPLY(var,const) ((int16_t) DESCALE((var) * (const), CONST_BITS))
static av_always_inline void row_fdct(DCTELEM * data){
static av_always_inline void row_fdct(int16_t * data){
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
/* Pass 1: process rows. */
@ -205,12 +205,12 @@ static av_always_inline void row_fdct(DCTELEM * data){
*/
GLOBAL(void)
ff_fdct_ifast (DCTELEM * data)
ff_fdct_ifast (int16_t * data)
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
row_fdct(data);
@ -271,12 +271,12 @@ ff_fdct_ifast (DCTELEM * data)
*/
GLOBAL(void)
ff_fdct_ifast248 (DCTELEM * data)
ff_fdct_ifast248 (int16_t * data)
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
row_fdct(data);

@ -184,12 +184,12 @@
#endif
static av_always_inline void FUNC(row_fdct)(DCTELEM *data)
static av_always_inline void FUNC(row_fdct)(int16_t *data)
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
/* Pass 1: process rows. */
@ -216,13 +216,13 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data)
tmp11 = tmp1 + tmp2;
tmp12 = tmp1 - tmp2;
dataptr[0] = (DCTELEM) ((tmp10 + tmp11) << PASS1_BITS);
dataptr[4] = (DCTELEM) ((tmp10 - tmp11) << PASS1_BITS);
dataptr[0] = (int16_t) ((tmp10 + tmp11) << PASS1_BITS);
dataptr[4] = (int16_t) ((tmp10 - tmp11) << PASS1_BITS);
z1 = MULTIPLY(tmp12 + tmp13, FIX_0_541196100);
dataptr[2] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
dataptr[2] = (int16_t) DESCALE(z1 + MULTIPLY(tmp13, FIX_0_765366865),
CONST_BITS-PASS1_BITS);
dataptr[6] = (DCTELEM) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
dataptr[6] = (int16_t) DESCALE(z1 + MULTIPLY(tmp12, - FIX_1_847759065),
CONST_BITS-PASS1_BITS);
/* Odd part per figure 8 --- note paper omits factor of sqrt(2).
@ -248,10 +248,10 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data)
z3 += z5;
z4 += z5;
dataptr[7] = (DCTELEM) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
dataptr[5] = (DCTELEM) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
dataptr[3] = (DCTELEM) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
dataptr[1] = (DCTELEM) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
dataptr[7] = (int16_t) DESCALE(tmp4 + z1 + z3, CONST_BITS-PASS1_BITS);
dataptr[5] = (int16_t) DESCALE(tmp5 + z2 + z4, CONST_BITS-PASS1_BITS);
dataptr[3] = (int16_t) DESCALE(tmp6 + z2 + z3, CONST_BITS-PASS1_BITS);
dataptr[1] = (int16_t) DESCALE(tmp7 + z1 + z4, CONST_BITS-PASS1_BITS);
dataptr += DCTSIZE; /* advance pointer to next row */
}
@ -262,12 +262,12 @@ static av_always_inline void FUNC(row_fdct)(DCTELEM *data)
*/
GLOBAL(void)
FUNC(ff_jpeg_fdct_islow)(DCTELEM *data)
FUNC(ff_jpeg_fdct_islow)(int16_t *data)
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
FUNC(row_fdct)(data);
@ -344,12 +344,12 @@ FUNC(ff_jpeg_fdct_islow)(DCTELEM *data)
* you do even part two times.
*/
GLOBAL(void)
FUNC(ff_fdct248_islow)(DCTELEM *data)
FUNC(ff_fdct248_islow)(int16_t *data)
{
int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
int tmp10, tmp11, tmp12, tmp13;
int z1;
DCTELEM *dataptr;
int16_t *dataptr;
int ctr;
FUNC(row_fdct)(data);

@ -74,7 +74,7 @@
#define RIGHT_SHIFT(x, n) ((x) >> (n))
typedef DCTELEM DCTBLOCK[DCTSIZE2];
typedef int16_t DCTBLOCK[DCTSIZE2];
#define CONST_BITS 13
@ -213,7 +213,7 @@ void ff_j_rev_dct(DCTBLOCK data)
int32_t tmp10, tmp11, tmp12, tmp13;
int32_t z1, z2, z3, z4, z5;
int32_t d0, d1, d2, d3, d4, d5, d6, d7;
register DCTELEM *dataptr;
register int16_t *dataptr;
int rowctr;
/* Pass 1: process rows. */
@ -249,7 +249,7 @@ void ff_j_rev_dct(DCTBLOCK data)
/* AC terms all zero */
if (d0) {
/* Compute a 32 bit value to assign. */
DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
int16_t dcval = (int16_t) (d0 << PASS1_BITS);
register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
idataptr[0] = v;
@ -574,14 +574,14 @@ void ff_j_rev_dct(DCTBLOCK data)
}
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
dataptr[0] = (DCTELEM) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
dataptr[7] = (DCTELEM) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
dataptr[1] = (DCTELEM) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
dataptr[6] = (DCTELEM) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
dataptr[2] = (DCTELEM) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
dataptr[5] = (DCTELEM) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
dataptr[3] = (DCTELEM) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
dataptr[4] = (DCTELEM) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
dataptr[0] = (int16_t) DESCALE(tmp10 + tmp3, CONST_BITS-PASS1_BITS);
dataptr[7] = (int16_t) DESCALE(tmp10 - tmp3, CONST_BITS-PASS1_BITS);
dataptr[1] = (int16_t) DESCALE(tmp11 + tmp2, CONST_BITS-PASS1_BITS);
dataptr[6] = (int16_t) DESCALE(tmp11 - tmp2, CONST_BITS-PASS1_BITS);
dataptr[2] = (int16_t) DESCALE(tmp12 + tmp1, CONST_BITS-PASS1_BITS);
dataptr[5] = (int16_t) DESCALE(tmp12 - tmp1, CONST_BITS-PASS1_BITS);
dataptr[3] = (int16_t) DESCALE(tmp13 + tmp0, CONST_BITS-PASS1_BITS);
dataptr[4] = (int16_t) DESCALE(tmp13 - tmp0, CONST_BITS-PASS1_BITS);
dataptr += DCTSIZE; /* advance pointer to next row */
}
@ -920,21 +920,21 @@ void ff_j_rev_dct(DCTBLOCK data)
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
dataptr[DCTSIZE*0] = (DCTELEM) DESCALE(tmp10 + tmp3,
dataptr[DCTSIZE*0] = (int16_t) DESCALE(tmp10 + tmp3,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*7] = (DCTELEM) DESCALE(tmp10 - tmp3,
dataptr[DCTSIZE*7] = (int16_t) DESCALE(tmp10 - tmp3,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*1] = (DCTELEM) DESCALE(tmp11 + tmp2,
dataptr[DCTSIZE*1] = (int16_t) DESCALE(tmp11 + tmp2,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*6] = (DCTELEM) DESCALE(tmp11 - tmp2,
dataptr[DCTSIZE*6] = (int16_t) DESCALE(tmp11 - tmp2,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*2] = (DCTELEM) DESCALE(tmp12 + tmp1,
dataptr[DCTSIZE*2] = (int16_t) DESCALE(tmp12 + tmp1,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*5] = (DCTELEM) DESCALE(tmp12 - tmp1,
dataptr[DCTSIZE*5] = (int16_t) DESCALE(tmp12 - tmp1,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*3] = (DCTELEM) DESCALE(tmp13 + tmp0,
dataptr[DCTSIZE*3] = (int16_t) DESCALE(tmp13 + tmp0,
CONST_BITS+PASS1_BITS+3);
dataptr[DCTSIZE*4] = (DCTELEM) DESCALE(tmp13 - tmp0,
dataptr[DCTSIZE*4] = (int16_t) DESCALE(tmp13 - tmp0,
CONST_BITS+PASS1_BITS+3);
dataptr++; /* advance pointer to next column */
@ -951,7 +951,7 @@ void ff_j_rev_dct4(DCTBLOCK data)
int32_t tmp10, tmp11, tmp12, tmp13;
int32_t z1;
int32_t d0, d2, d4, d6;
register DCTELEM *dataptr;
register int16_t *dataptr;
int rowctr;
/* Pass 1: process rows. */
@ -983,7 +983,7 @@ void ff_j_rev_dct4(DCTBLOCK data)
/* AC terms all zero */
if (d0) {
/* Compute a 32 bit value to assign. */
DCTELEM dcval = (DCTELEM) (d0 << PASS1_BITS);
int16_t dcval = (int16_t) (d0 << PASS1_BITS);
register int v = (dcval & 0xffff) | ((dcval << 16) & 0xffff0000);
idataptr[0] = v;
@ -1045,10 +1045,10 @@ void ff_j_rev_dct4(DCTBLOCK data)
/* Final output stage: inputs are tmp10..tmp13, tmp0..tmp3 */
dataptr[0] = (DCTELEM) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
dataptr[1] = (DCTELEM) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
dataptr[2] = (DCTELEM) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
dataptr[3] = (DCTELEM) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
dataptr[0] = (int16_t) DESCALE(tmp10, CONST_BITS-PASS1_BITS);
dataptr[1] = (int16_t) DESCALE(tmp11, CONST_BITS-PASS1_BITS);
dataptr[2] = (int16_t) DESCALE(tmp12, CONST_BITS-PASS1_BITS);
dataptr[3] = (int16_t) DESCALE(tmp13, CONST_BITS-PASS1_BITS);
dataptr += DCTSTRIDE; /* advance pointer to next row */
}

@ -45,14 +45,14 @@ typedef struct MDECContext{
int mb_width;
int mb_height;
int mb_x, mb_y;
DECLARE_ALIGNED(16, DCTELEM, block)[6][64];
DECLARE_ALIGNED(16, int16_t, block)[6][64];
uint8_t *bitstream_buffer;
unsigned int bitstream_buffer_size;
int block_last_index[6];
} MDECContext;
//very similar to MPEG-1
static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n)
static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
{
int level, diff, i, j, run;
int component;
@ -119,7 +119,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, DCTELEM *block, int n)
return 0;
}
static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){
static inline int decode_mb(MDECContext *a, int16_t block[6][64]){
int i;
const int block_index[6]= {5,4,0,1,2,3};
@ -134,7 +134,7 @@ static inline int decode_mb(MDECContext *a, DCTELEM block[6][64]){
}
static inline void idct_put(MDECContext *a, int mb_x, int mb_y){
DCTELEM (*block)[64]= a->block;
int16_t (*block)[64]= a->block;
int linesize= a->picture.linesize[0];
uint8_t *dest_y = a->picture.data[0] + (mb_y * 16* linesize ) + mb_x * 16;

@ -47,7 +47,7 @@ typedef struct {
AVFrame buf_ptrs [16];
AVPicture flipped_ptrs[16];
DECLARE_ALIGNED(16, DCTELEM, dct_block)[64];
DECLARE_ALIGNED(16, int16_t, dct_block)[64];
GetBitContext gb;
ScanTable scantable;
@ -183,7 +183,7 @@ static const int8_t vlcdec_lookup[9][64] = {
static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale)
{
DCTELEM *block = ctx->dct_block;
int16_t *block = ctx->dct_block;
unsigned int pos;
ctx->dsp.clear_block(block);

@ -498,7 +498,7 @@ static inline int mjpeg_decode_dc(MJpegDecodeContext *s, int dc_index)
}
/* decode block and dequantize */
static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component,
static int decode_block(MJpegDecodeContext *s, int16_t *block, int component,
int dc_index, int ac_index, int16_t *quant_matrix)
{
int code, i, j, level, val;
@ -546,7 +546,7 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block, int component,
return 0;
}
static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block,
static int decode_dc_progressive(MJpegDecodeContext *s, int16_t *block,
int component, int dc_index,
int16_t *quant_matrix, int Al)
{
@ -564,7 +564,7 @@ static int decode_dc_progressive(MJpegDecodeContext *s, DCTELEM *block,
}
/* decode block and dequantize - progressive JPEG version */
static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block,
static int decode_block_progressive(MJpegDecodeContext *s, int16_t *block,
uint8_t *last_nnz, int ac_index,
int16_t *quant_matrix,
int ss, int se, int Al, int *EOBRUN)
@ -662,7 +662,7 @@ for (; ; i++) { \
}
/* decode block and dequantize - progressive JPEG refinement pass */
static int decode_block_refinement(MJpegDecodeContext *s, DCTELEM *block,
static int decode_block_refinement(MJpegDecodeContext *s, int16_t *block,
uint8_t *last_nnz,
int ac_index, int16_t *quant_matrix,
int ss, int se, int Al, int *EOBRUN)
@ -1081,7 +1081,7 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
} else {
int block_idx = s->block_stride[c] * (v * mb_y + y) +
(h * mb_x + x);
DCTELEM *block = s->blocks[c][block_idx];
int16_t *block = s->blocks[c][block_idx];
if (Ah)
block[0] += get_bits1(&s->gb) *
s->quant_matrixes[s->quant_index[c]][0] << Al;
@ -1139,7 +1139,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
int block_idx = mb_y * s->block_stride[c];
DCTELEM (*block)[64] = &s->blocks[c][block_idx];
int16_t (*block)[64] = &s->blocks[c][block_idx];
uint8_t *last_nnz = &s->last_nnz[c][block_idx];
for (mb_x = 0; mb_x < s->mb_width; mb_x++, block++, last_nnz++) {
int ret;

@ -91,8 +91,8 @@ typedef struct MJpegDecodeContext {
int got_picture; ///< we found a SOF and picture is valid, too.
int linesize[MAX_COMPONENTS]; ///< linesize << interlaced
int8_t *qscale_table;
DECLARE_ALIGNED(16, DCTELEM, block)[64];
DCTELEM (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode)
DECLARE_ALIGNED(16, int16_t, block)[64];
int16_t (*blocks[MAX_COMPONENTS])[64]; ///< intermediate sums (progressive mode)
uint8_t *last_nnz[MAX_COMPONENTS];
uint64_t coefs_finished[MAX_COMPONENTS]; ///< bitmask of which coefs have been completely decoded (progressive mode)
ScanTable scantable;

@ -397,7 +397,7 @@ void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
}
}
static void encode_block(MpegEncContext *s, DCTELEM *block, int n)
static void encode_block(MpegEncContext *s, int16_t *block, int n)
{
int mant, nbits, code, i, j;
int component, dc, run, last_index, val;
@ -455,7 +455,7 @@ static void encode_block(MpegEncContext *s, DCTELEM *block, int n)
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
}
void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64])
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
{
int i;
if (s->chroma_format == CHROMA_444) {

@ -33,7 +33,8 @@
#ifndef AVCODEC_MJPEGENC_H
#define AVCODEC_MJPEGENC_H
#include "dsputil.h"
#include <stdint.h>
#include "mpegvideo.h"
typedef struct MJpegContext {
@ -55,6 +56,6 @@ void ff_mjpeg_encode_picture_trailer(MpegEncContext *s);
void ff_mjpeg_encode_stuffing(MpegEncContext *s);
void ff_mjpeg_encode_dc(MpegEncContext *s, int val,
uint8_t *huff_size, uint16_t *huff_code);
void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]);
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
#endif /* AVCODEC_MJPEGENC_H */

@ -81,7 +81,7 @@ static int mpeg_decode_motion(MpegEncContext *s, int fcode, int pred)
return sign_extend(val, 5 + shift);
}
static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, dc, diff, i, j, run;
int component;
@ -152,12 +152,12 @@ static inline int mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, in
return 0;
}
int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)
int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
return mpeg1_decode_block_intra(s, block, n);
}
static inline int mpeg1_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg1_decode_block_inter(MpegEncContext *s, int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
@ -237,7 +237,7 @@ end:
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg1_fast_decode_block_inter(MpegEncContext *s, int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
@ -309,7 +309,7 @@ end:
}
static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg2_decode_block_non_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
@ -394,7 +394,7 @@ end:
* Do not use "fast" flag if you need the code to be robust.
*/
static inline int mpeg2_fast_decode_block_non_intra(MpegEncContext *s,
DCTELEM *block, int n)
int16_t *block, int n)
{
int level, i, j, run;
RLTable *rl = &ff_rl_mpeg1;
@ -455,7 +455,7 @@ end:
}
static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg2_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, dc, diff, i, j, run;
int component;
@ -538,7 +538,7 @@ static inline int mpeg2_decode_block_intra(MpegEncContext *s, DCTELEM *block, in
* Changing this would eat up any speed benefits it has.
* Do not use "fast" flag if you need the code to be robust.
*/
static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n)
static inline int mpeg2_fast_decode_block_intra(MpegEncContext *s, int16_t *block, int n)
{
int level, dc, diff, j, run;
int component;
@ -737,7 +737,7 @@ static inline int get_qscale(MpegEncContext *s)
static void exchange_uv(MpegEncContext *s)
{
DCTELEM (*tmp)[64];
int16_t (*tmp)[64];
tmp = s->pblocks[4];
s->pblocks[4] = s->pblocks[5];
@ -750,7 +750,7 @@ static void exchange_uv(MpegEncContext *s)
#define MT_16X8 2
#define MT_DMV 3
static int mpeg_decode_mb(MpegEncContext *s, DCTELEM block[12][64])
static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
{
int i, j, k, cbp, val, mb_type, motion_type;
const int mb_block_count = 4 + (1 << s->chroma_format);

@ -71,6 +71,6 @@ static inline int decode_dc(GetBitContext *gb, int component)
return diff;
}
extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, DCTELEM *block, int n);
extern int ff_mpeg1_decode_block_intra(MpegEncContext *s, int16_t *block, int n);
#endif /* AVCODEC_MPEG12_H */

@ -52,7 +52,7 @@ static const uint8_t svcd_scan_offset_placeholder[14] = {
};
static void mpeg1_encode_block(MpegEncContext *s,
DCTELEM *block,
int16_t *block,
int component);
static void mpeg1_encode_motion(MpegEncContext *s, int val, int f_or_b_code); // RAL: f_code parameter added
@ -471,7 +471,7 @@ static inline void put_mb_modes(MpegEncContext *s, int n, int bits,
}
static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y,
int mb_block_count)
{
@ -695,7 +695,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
}
}
void ff_mpeg1_encode_mb(MpegEncContext *s, DCTELEM block[6][64], int motion_x, int motion_y)
void ff_mpeg1_encode_mb(MpegEncContext *s, int16_t block[6][64], int motion_x, int motion_y)
{
if (s->chroma_format == CHROMA_420) mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 6);
else mpeg1_encode_mb_internal(s, block, motion_x, motion_y, 8);
@ -878,7 +878,7 @@ static inline void encode_dc(MpegEncContext *s, int diff, int component)
}
static void mpeg1_encode_block(MpegEncContext *s,
DCTELEM *block,
int16_t *block,
int n)
{
int alevel, level, last_non_zero, dc, diff, i, j, run, last_index, sign;

@ -83,9 +83,9 @@ extern const uint16_t ff_mpeg4_resync_prefix[8];
extern const uint8_t ff_mpeg4_dc_threshold[8];
void ff_mpeg4_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n,
int dir);
void ff_set_mpeg4_time(MpegEncContext * s);
void ff_mpeg4_encode_picture_header(MpegEncContext *s, int picture_number);

@ -53,7 +53,7 @@ static const int mb_type_b_map[4]= {
* @param n block index (0-3 are luma, 4-5 are chroma)
* @param dir the ac prediction direction
*/
void ff_mpeg4_pred_ac(MpegEncContext * s, DCTELEM *block, int n,
void ff_mpeg4_pred_ac(MpegEncContext * s, int16_t *block, int n,
int dir)
{
int i;
@ -843,7 +843,7 @@ int ff_mpeg4_decode_partitions(MpegEncContext *s)
* Decode a block.
* @return <0 if an error occurred
*/
static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
static inline int mpeg4_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded, int intra, int rvlc)
{
int level, i, last, run;
@ -1089,7 +1089,7 @@ static inline int mpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
* decode partition C of one MB.
* @return <0 if an error occurred
*/
static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
{
int cbp, mb_type;
const int xy= s->mb_x + s->mb_y*s->mb_stride;
@ -1172,7 +1172,7 @@ static int mpeg4_decode_partitioned_mb(MpegEncContext *s, DCTELEM block[6][64])
}
static int mpeg4_decode_mb(MpegEncContext *s,
DCTELEM block[6][64])
int16_t block[6][64])
{
int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
int16_t *mot_val;

@ -59,7 +59,7 @@ max run: 29/41
* Return the number of bits that encoding the 8x8 block in block would need.
* @param[in] block_last_index last index in scantable order that refers to a non zero element in block.
*/
static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int block_last_index, uint8_t scantable[64]){
static inline int get_block_rate(MpegEncContext * s, int16_t block[64], int block_last_index, uint8_t scantable[64]){
int last=0;
int j;
int rate=0;
@ -91,7 +91,7 @@ static inline int get_block_rate(MpegEncContext * s, DCTELEM block[64], int bloc
* @param[out] st scantable for each 8x8 block
* @param[in] zigzag_last_index index referring to the last non zero coefficient in zigzag order
*/
static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], const int zigzag_last_index[6])
static inline void restore_ac_coeffs(MpegEncContext * s, int16_t block[6][64], const int dir[6], uint8_t *st[6], const int zigzag_last_index[6])
{
int i, n;
memcpy(s->block_last_index, zigzag_last_index, sizeof(int)*6);
@ -122,7 +122,7 @@ static inline void restore_ac_coeffs(MpegEncContext * s, DCTELEM block[6][64], c
* @param[out] st scantable for each 8x8 block
* @param[out] zigzag_last_index index referring to the last non zero coefficient in zigzag order
*/
static inline int decide_ac_pred(MpegEncContext * s, DCTELEM block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6])
static inline int decide_ac_pred(MpegEncContext * s, int16_t block[6][64], const int dir[6], uint8_t *st[6], int zigzag_last_index[6])
{
int score= 0;
int i, n;
@ -294,7 +294,7 @@ static inline int mpeg4_get_dc_length(int level, int n){
* Encode an 8x8 block.
* @param n block index (0-3 are luma, 4-5 are chroma)
*/
static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
static inline void mpeg4_encode_block(MpegEncContext * s, int16_t * block, int n, int intra_dc,
uint8_t *scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb)
{
int i, last_non_zero;
@ -345,7 +345,7 @@ static inline void mpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n
}
}
static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, int intra_dc,
static int mpeg4_get_block_length(MpegEncContext * s, int16_t * block, int n, int intra_dc,
uint8_t *scan_table)
{
int i, last_non_zero;
@ -396,7 +396,7 @@ static int mpeg4_get_block_length(MpegEncContext * s, DCTELEM * block, int n, in
return len;
}
static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64], int intra_dc[6],
static inline void mpeg4_encode_blocks(MpegEncContext * s, int16_t block[6][64], int intra_dc[6],
uint8_t **scan_table, PutBitContext *dc_pb, PutBitContext *ac_pb){
int i;
@ -425,7 +425,7 @@ static inline void mpeg4_encode_blocks(MpegEncContext * s, DCTELEM block[6][64],
}
}
static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],
static inline int get_b_cbp(MpegEncContext * s, int16_t block[6][64],
int motion_x, int motion_y, int mb_type)
{
int cbp = 0, i;
@ -469,7 +469,7 @@ static inline int get_b_cbp(MpegEncContext * s, DCTELEM block[6][64],
static const int dquant_code[5]= {1,0,9,2,3};
void ff_mpeg4_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y)
{
int cbpc, cbpy, pred_x, pred_y;

@ -43,19 +43,19 @@
//#include <assert.h>
static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_h263_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
static void dct_unquantize_h263_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale);
int16_t *block, int n, int qscale);
//#define DEBUG
@ -392,7 +392,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared)
}
if (s->avctx->debug&FF_DEBUG_DCT_COEFF) {
FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.dct_coeff,
64 * mb_array_size * sizeof(DCTELEM) * 6, fail)
64 * mb_array_size * sizeof(int16_t) * 6, fail)
}
pic->f.qstride = s->mb_stride;
FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.pan_scan,
@ -469,7 +469,7 @@ static int init_duplicate_context(MpegEncContext *s, MpegEncContext *base)
2 * 64 * sizeof(int), fail)
}
}
FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(DCTELEM), fail)
FF_ALLOCZ_OR_GOTO(s->avctx, s->blocks, 64 * 12 * 2 * sizeof(int16_t), fail)
s->block = s->blocks[0];
for (i = 0; i < 12; i++) {
@ -2434,7 +2434,7 @@ unhandled:
/* put block[] to dest[] */
static inline void put_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
{
s->dct_unquantize_intra(s, block, i, qscale);
s->dsp.idct_put (dest, line_size, block);
@ -2442,7 +2442,7 @@ static inline void put_dct(MpegEncContext *s,
/* add block[] to dest[] */
static inline void add_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size)
int16_t *block, int i, uint8_t *dest, int line_size)
{
if (s->block_last_index[i] >= 0) {
s->dsp.idct_add (dest, line_size, block);
@ -2450,7 +2450,7 @@ static inline void add_dct(MpegEncContext *s,
}
static inline void add_dequant_dct(MpegEncContext *s,
DCTELEM *block, int i, uint8_t *dest, int line_size, int qscale)
int16_t *block, int i, uint8_t *dest, int line_size, int qscale)
{
if (s->block_last_index[i] >= 0) {
s->dct_unquantize_inter(s, block, i, qscale);
@ -2503,7 +2503,7 @@ void ff_clean_intra_table_entries(MpegEncContext *s)
s->interlaced_dct : true if interlaced dct used (mpeg2)
*/
static av_always_inline
void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
void MPV_decode_mb_internal(MpegEncContext *s, int16_t block[12][64],
int lowres_flag, int is_mpeg12)
{
const int mb_xy = s->mb_y * s->mb_stride + s->mb_x;
@ -2515,7 +2515,7 @@ void MPV_decode_mb_internal(MpegEncContext *s, DCTELEM block[12][64],
if(s->avctx->debug&FF_DEBUG_DCT_COEFF) {
/* save DCT coefficients */
int i,j;
DCTELEM *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6];
int16_t *dct = &s->current_picture.f.dct_coeff[mb_xy * 64 * 6];
av_log(s->avctx, AV_LOG_DEBUG, "DCT coeffs of MB at %dx%d:\n", s->mb_x, s->mb_y);
for(i=0; i<6; i++){
for(j=0; j<64; j++){
@ -2746,7 +2746,7 @@ skip_idct:
}
}
void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]){
void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]){
#if !CONFIG_SMALL
if(s->out_format == FMT_MPEG1) {
if(s->avctx->lowres) MPV_decode_mb_internal(s, block, 1, 1);
@ -2888,7 +2888,7 @@ void ff_mpeg_flush(AVCodecContext *avctx){
}
static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
@ -2917,7 +2917,7 @@ static void dct_unquantize_mpeg1_intra_c(MpegEncContext *s,
}
static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
@ -2946,7 +2946,7 @@ static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s,
}
static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
@ -2973,7 +2973,7 @@ static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s,
}
static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
@ -3004,7 +3004,7 @@ static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s,
}
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, nCoeffs;
const uint16_t *quant_matrix;
@ -3035,7 +3035,7 @@ static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s,
}
static void dct_unquantize_h263_intra_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, qmul, qadd;
int nCoeffs;
@ -3069,7 +3069,7 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s,
}
static void dct_unquantize_h263_inter_c(MpegEncContext *s,
DCTELEM *block, int n, int qscale)
int16_t *block, int n, int qscale)
{
int i, level, qmul, qadd;
int nCoeffs;

@ -681,39 +681,39 @@ typedef struct MpegEncContext {
uint8_t *ptr_lastgob;
int swap_uv; //vcr2 codec is an MPEG-2 variant with U and V swapped
DCTELEM (*pblocks[12])[64];
int16_t (*pblocks[12])[64];
DCTELEM (*block)[64]; ///< points to one of the following blocks
DCTELEM (*blocks)[12][64]; // for HQ mode we need to keep the best block
int (*decode_mb)(struct MpegEncContext *s, DCTELEM block[6][64]); // used by some codecs to avoid a switch()
int16_t (*block)[64]; ///< points to one of the following blocks
int16_t (*blocks)[12][64]; // for HQ mode we need to keep the best block
int (*decode_mb)(struct MpegEncContext *s, int16_t block[6][64]); // used by some codecs to avoid a switch()
#define SLICE_OK 0
#define SLICE_ERROR -1
#define SLICE_END -2 ///<end marker found
#define SLICE_NOEND -3 ///<no end marker or error found but mb count exceeded
void (*dct_unquantize_mpeg1_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_mpeg1_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_mpeg2_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_mpeg2_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_h263_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_h263_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_h261_intra)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_h261_inter)(struct MpegEncContext *s,
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_intra)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
DCTELEM *block/*align 16*/, int n, int qscale);
int16_t *block/*align 16*/, int n, int qscale);
void (*dct_unquantize_inter)(struct MpegEncContext *s, // unquantizer to use (mpeg4 can use both)
DCTELEM *block/*align 16*/, int n, int qscale);
int (*dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
int (*fast_dct_quantize)(struct MpegEncContext *s, DCTELEM *block/*align 16*/, int n, int qscale, int *overflow);
void (*denoise_dct)(struct MpegEncContext *s, DCTELEM *block);
int16_t *block/*align 16*/, int n, int qscale);
int (*dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
int (*fast_dct_quantize)(struct MpegEncContext *s, int16_t *block/*align 16*/, int n, int qscale, int *overflow);
void (*denoise_dct)(struct MpegEncContext *s, int16_t *block);
int mpv_flags; ///< flags set by private options
int quantizer_noise_shaping;
@ -776,7 +776,7 @@ int ff_MPV_common_init(MpegEncContext *s);
int ff_mpv_frame_size_alloc(MpegEncContext *s, int linesize);
int ff_MPV_common_frame_size_change(MpegEncContext *s);
void ff_MPV_common_end(MpegEncContext *s);
void ff_MPV_decode_mb(MpegEncContext *s, DCTELEM block[12][64]);
void ff_MPV_decode_mb(MpegEncContext *s, int16_t block[12][64]);
int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx);
void ff_MPV_frame_end(MpegEncContext *s);
int ff_MPV_encode_init(AVCodecContext *avctx);
@ -796,7 +796,7 @@ void ff_print_debug_info(MpegEncContext *s, AVFrame *pict);
void ff_write_quant_matrix(PutBitContext *pb, uint16_t *matrix);
void ff_release_unused_pictures(MpegEncContext *s, int remove_current);
int ff_find_unused_picture(MpegEncContext *s, int shared);
void ff_denoise_dct(MpegEncContext *s, DCTELEM *block);
void ff_denoise_dct(MpegEncContext *s, int16_t *block);
int ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src);
int ff_MPV_lowest_referenced_row(MpegEncContext *s, int dir);
void ff_MPV_report_decode_progress(MpegEncContext *s);
@ -812,7 +812,7 @@ int ff_dct_common_init(MpegEncContext *s);
int ff_dct_encode_init(MpegEncContext *s);
void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64], uint16_t (*qmat16)[2][64],
const uint16_t *quant_matrix, int bias, int qmin, int qmax, int intra);
int ff_dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
int ff_dct_quantize_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
void ff_init_block_index(MpegEncContext *s);
void ff_copy_picture(Picture *dst, Picture *src);
@ -887,7 +887,7 @@ extern const uint8_t * const ff_mpeg2_dc_scale_table[4];
void ff_mpeg1_encode_picture_header(MpegEncContext *s, int picture_number);
void ff_mpeg1_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
void ff_mpeg1_encode_init(MpegEncContext *s);
void ff_mpeg1_encode_slice_header(MpegEncContext *s);
@ -902,7 +902,7 @@ extern const uint8_t ff_h263_loop_filter_strength[32];
void ff_h261_loop_filter(MpegEncContext *s);
void ff_h261_reorder_mb_index(MpegEncContext* s);
void ff_h261_encode_mb(MpegEncContext *s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number);
void ff_h261_encode_init(MpegEncContext *s);
@ -919,7 +919,7 @@ void ff_rv20_encode_picture_header(MpegEncContext *s, int picture_number);
void ff_msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number);
void ff_msmpeg4_encode_ext_header(MpegEncContext * s);
void ff_msmpeg4_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
int ff_msmpeg4_decode_picture_header(MpegEncContext * s);
int ff_msmpeg4_decode_ext_header(MpegEncContext * s, int buf_size);
@ -927,14 +927,14 @@ int ff_msmpeg4_decode_init(AVCodecContext *avctx);
void ff_msmpeg4_encode_init(MpegEncContext *s);
int ff_wmv2_decode_picture_header(MpegEncContext * s);
int ff_wmv2_decode_secondary_picture_header(MpegEncContext * s);
void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
void ff_wmv2_add_mb(MpegEncContext *s, int16_t block[6][64], uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr);
void ff_mspel_motion(MpegEncContext *s,
uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
int motion_x, int motion_y, int h);
int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number);
void ff_wmv2_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y);
#endif /* AVCODEC_MPEGVIDEO_H */

@ -52,10 +52,10 @@
//#include <assert.h>
static int encode_picture(MpegEncContext *s, int picture_number);
static int dct_quantize_refine(MpegEncContext *s, DCTELEM *block, int16_t *weight, DCTELEM *orig, int n, int qscale);
static int dct_quantize_refine(MpegEncContext *s, int16_t *block, int16_t *weight, int16_t *orig, int n, int qscale);
static int sse_mb(MpegEncContext *s);
static void denoise_dct_c(MpegEncContext *s, DCTELEM *block);
static int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
static void denoise_dct_c(MpegEncContext *s, int16_t *block);
static int dct_quantize_trellis_c(MpegEncContext *s, int16_t *block, int n, int qscale, int *overflow);
//#define DEBUG
@ -1727,7 +1727,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s,
int score = 0;
int run = 0;
int i;
DCTELEM *block = s->block[n];
int16_t *block = s->block[n];
const int last_index = s->block_last_index[n];
int skip_dc;
@ -1767,7 +1767,7 @@ static inline void dct_single_coeff_elimination(MpegEncContext *s,
s->block_last_index[n] = -1;
}
static inline void clip_coeffs(MpegEncContext *s, DCTELEM *block,
static inline void clip_coeffs(MpegEncContext *s, int16_t *block,
int last_index)
{
int i;
@ -1832,7 +1832,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
int mb_block_count)
{
int16_t weight[12][64];
DCTELEM orig[12][64];
int16_t orig[12][64];
const int mb_x = s->mb_x;
const int mb_y = s->mb_y;
int i;
@ -2093,7 +2093,7 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s,
get_visual_weight(weight[7], ptr_cr + uv_dct_offset,
wrap_c);
}
memcpy(orig[0], s->block[0], sizeof(DCTELEM) * 64 * mb_block_count);
memcpy(orig[0], s->block[0], sizeof(int16_t) * 64 * mb_block_count);
}
/* DCT & quantize */
@ -2839,7 +2839,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(best_s.mv_type==MV_TYPE_16X16){ //FIXME move 4mv after QPRD
const int last_qp= backup_s.qscale;
int qpi, qp, dc[6];
DCTELEM ac[6][16];
int16_t ac[6][16];
const int mvdir= (best_s.mv_dir&MV_DIR_BACKWARD) ? 1 : 0;
static const int dquant_tab[4]={-1,1,-2,2};
@ -2864,7 +2864,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->mb_intra && s->dc_val[0]){
for(i=0; i<6; i++){
dc[i]= s->dc_val[0][ s->block_index[i] ];
memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(DCTELEM)*16);
memcpy(ac[i], s->ac_val[0][s->block_index[i]], sizeof(int16_t)*16);
}
}
@ -2874,7 +2874,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
if(s->mb_intra && s->dc_val[0]){
for(i=0; i<6; i++){
s->dc_val[0][ s->block_index[i] ]= dc[i];
memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(DCTELEM)*16);
memcpy(s->ac_val[0][s->block_index[i]], ac[i], sizeof(int16_t)*16);
}
}
}
@ -3479,7 +3479,7 @@ static int encode_picture(MpegEncContext *s, int picture_number)
return 0;
}
static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){
static void denoise_dct_c(MpegEncContext *s, int16_t *block){
const int intra= s->mb_intra;
int i;
@ -3504,7 +3504,7 @@ static void denoise_dct_c(MpegEncContext *s, DCTELEM *block){
}
static int dct_quantize_trellis_c(MpegEncContext *s,
DCTELEM *block, int n,
int16_t *block, int n,
int qscale, int *overflow){
const int *qmat;
const uint8_t *scantable= s->intra_scantable.scantable;
@ -3611,7 +3611,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
*overflow= s->max_qcoeff < max; //overflow might have happened
if(last_non_zero < start_i){
memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
memset(block + start_i, 0, (64-start_i)*sizeof(int16_t));
return last_non_zero;
}
@ -3743,7 +3743,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
dc= FFABS(block[0]);
last_non_zero= last_i - 1;
memset(block + start_i, 0, (64-start_i)*sizeof(DCTELEM));
memset(block + start_i, 0, (64-start_i)*sizeof(int16_t));
if(last_non_zero < start_i)
return last_non_zero;
@ -3818,10 +3818,10 @@ static void build_basis(uint8_t *perm){
}
static int dct_quantize_refine(MpegEncContext *s, //FIXME breaks denoise?
DCTELEM *block, int16_t *weight, DCTELEM *orig,
int16_t *block, int16_t *weight, int16_t *orig,
int n, int qscale){
int16_t rem[64];
LOCAL_ALIGNED_16(DCTELEM, d1, [64]);
LOCAL_ALIGNED_16(int16_t, d1, [64]);
const uint8_t *scantable= s->intra_scantable.scantable;
const uint8_t *perm_scantable= s->intra_scantable.permutated;
// unsigned int threshold1, threshold2;
@ -4191,7 +4191,7 @@ STOP_TIMER("iterative search")
}
int ff_dct_quantize_c(MpegEncContext *s,
DCTELEM *block, int n,
int16_t *block, int n,
int qscale, int *overflow)
{
int i, j, level, last_non_zero, q, start_i;

@ -44,7 +44,7 @@ void ff_xvmc_init_block(MpegEncContext *s)
struct xvmc_pix_fmt *render = (struct xvmc_pix_fmt*)s->current_picture.f.data[2];
assert(render && render->xvmc_id == AV_XVMC_ID);
s->block = (DCTELEM (*)[64])(render->data_blocks + render->next_free_data_block_num * 64);
s->block = (int16_t (*)[64])(render->data_blocks + render->next_free_data_block_num * 64);
}
/**

@ -404,7 +404,7 @@ static int msmpeg4v2_decode_motion(MpegEncContext * s, int pred, int f_code)
return val;
}
static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
static int msmpeg4v12_decode_mb(MpegEncContext *s, int16_t block[6][64])
{
int cbp, code, i;
uint32_t * const mb_type_ptr = &s->current_picture.f.mb_type[s->mb_x + s->mb_y*s->mb_stride];
@ -494,7 +494,7 @@ static int msmpeg4v12_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
return 0;
}
static int msmpeg4v34_decode_mb(MpegEncContext *s, DCTELEM block[6][64])
static int msmpeg4v34_decode_mb(MpegEncContext *s, int16_t block[6][64])
{
int cbp, code, i;
uint8_t *coded_val;
@ -938,7 +938,7 @@ static int msmpeg4_decode_dc(MpegEncContext * s, int n, int *dir_ptr)
}
//#define ERROR_DETAILS
int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded, const uint8_t *scan_table)
{
int level, i, last, run, run_diff;

@ -26,7 +26,6 @@
#include "config.h"
#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "msmpeg4data.h"
#include "put_bits.h"
@ -45,17 +44,17 @@ extern VLC ff_inter_intra_vlc;
void ff_msmpeg4_code012(PutBitContext *pb, int n);
void ff_msmpeg4_common_init(MpegEncContext *s);
void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n);
void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n);
void ff_msmpeg4_handle_slices(MpegEncContext *s);
void ff_msmpeg4_encode_motion(MpegEncContext * s, int mx, int my);
int ff_msmpeg4_coded_block_pred(MpegEncContext * s, int n,
uint8_t **coded_block_ptr);
int ff_msmpeg4_decode_motion(MpegEncContext * s, int *mx_ptr, int *my_ptr);
int ff_msmpeg4_decode_block(MpegEncContext * s, DCTELEM * block,
int ff_msmpeg4_decode_block(MpegEncContext * s, int16_t * block,
int n, int coded, const uint8_t *scan_table);
int ff_msmpeg4_pred_dc(MpegEncContext *s, int n,
int16_t **dc_val_ptr, int *dir_ptr);
int ff_wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]);
int ff_wmv2_decode_mb(MpegEncContext *s, int16_t block[6][64]);
#define CONFIG_MSMPEG4_DECODER (CONFIG_MSMPEG4V1_DECODER || \
CONFIG_MSMPEG4V2_DECODER || \

@ -369,7 +369,7 @@ static void msmpeg4v2_encode_motion(MpegEncContext * s, int val)
}
void ff_msmpeg4_encode_mb(MpegEncContext * s,
DCTELEM block[6][64],
int16_t block[6][64],
int motion_x, int motion_y)
{
int cbp, coded_cbp, i;
@ -570,7 +570,7 @@ static void msmpeg4_encode_dc(MpegEncContext * s, int level, int n, int *dir_ptr
/* Encoding of a block. Very similar to MPEG4 except for a different
escape coding (same as H263) and more vlc tables.
*/
void ff_msmpeg4_encode_block(MpegEncContext * s, DCTELEM * block, int n)
void ff_msmpeg4_encode_block(MpegEncContext * s, int16_t * block, int n)
{
int level, run, last, i, j, last_index;
int last_non_zero, sign, slevel;

@ -476,7 +476,7 @@ static int pix_sum_altivec(uint8_t * pix, int line_size)
return s;
}
static void get_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *pixels, int line_size)
static void get_pixels_altivec(int16_t *restrict block, const uint8_t *pixels, int line_size)
{
int i;
vector unsigned char perm = vec_lvsl(0, pixels);
@ -502,7 +502,7 @@ static void get_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *pixels
}
}
static void diff_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *s1,
static void diff_pixels_altivec(int16_t *restrict block, const uint8_t *s1,
const uint8_t *s2, int stride)
{
int i;
@ -576,7 +576,7 @@ static void diff_pixels_altivec(DCTELEM *av_restrict block, const uint8_t *s1,
}
static void clear_block_altivec(DCTELEM *block) {
static void clear_block_altivec(int16_t *block) {
LOAD_ZERO;
vec_st(zero_s16v, 0, block);
vec_st(zero_s16v, 16, block);

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save