diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-29 13:48:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-29 13:48:38 +0100 |
commit | 14aa358c20c222b991c56d13b4da536dc84763d3 (patch) | |
tree | ef15962a3abc4f45ac6609f0678c77a0f8ef3336 | |
parent | 8265c0f43a441f2ec8eb31b6047297d8f18ebcda (diff) | |
parent | 098eed95bc1a6b2c8ac97f126f62bb74699670cf (diff) | |
download | ffmpeg-14aa358c20c222b991c56d13b4da536dc84763d3.tar.gz |
Merge commit '098eed95bc1a6b2c8ac97f126f62bb74699670cf'
* commit '098eed95bc1a6b2c8ac97f126f62bb74699670cf':
mdec: merge mdec_common_init() into decode_init().
eatgv: use fixed-width types where appropriate.
x86: Simplify some arch conditionals
bfin: Separate VP3 initialization code
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/bfin/Makefile | 4 | ||||
-rw-r--r-- | libavcodec/bfin/dsputil_bfin.c | 8 | ||||
-rw-r--r-- | libavcodec/bfin/dsputil_bfin.h | 3 | ||||
-rw-r--r-- | libavcodec/bfin/vp3_bfin.c | 9 | ||||
-rw-r--r-- | libavcodec/eatgv.c | 16 | ||||
-rw-r--r-- | libavcodec/mdec.c | 12 | ||||
-rw-r--r-- | libavcodec/vp3dsp.c | 2 | ||||
-rw-r--r-- | libavcodec/vp3dsp.h | 1 | ||||
-rw-r--r-- | libavcodec/x86/h264_qpel.c | 2 | ||||
-rw-r--r-- | libavcodec/x86/idct_sse2_xvid.c | 2 |
10 files changed, 27 insertions, 32 deletions
diff --git a/libavcodec/bfin/Makefile b/libavcodec/bfin/Makefile index be81e6c39a..d1b41bc7f4 100644 --- a/libavcodec/bfin/Makefile +++ b/libavcodec/bfin/Makefile @@ -2,7 +2,7 @@ OBJS += bfin/dsputil_bfin.o \ bfin/fdct_bfin.o \ bfin/idct_bfin.o \ bfin/pixels_bfin.o \ - bfin/vp3_bfin.o \ - bfin/vp3_idct_bfin.o \ OBJS-$(CONFIG_MPEGVIDEOENC) += bfin/mpegvideo_bfin.o +OBJS-$(CONFIG_VP3DSP) += bfin/vp3_bfin.o \ + bfin/vp3_idct_bfin.o diff --git a/libavcodec/bfin/dsputil_bfin.c b/libavcodec/bfin/dsputil_bfin.c index 955aea01f6..da6edb5e5e 100644 --- a/libavcodec/bfin/dsputil_bfin.c +++ b/libavcodec/bfin/dsputil_bfin.c @@ -257,13 +257,7 @@ void ff_dsputil_init_bfin( DSPContext* c, AVCodecContext *avctx ) if (avctx->dct_algo == FF_DCT_AUTO) c->fdct = ff_bfin_fdct; - // FIXME convert to VP3DSPContext - if (0) { // avctx->idct_algo == FF_IDCT_VP3) { - c->idct_permutation_type = FF_NO_IDCT_PERM; - c->idct = ff_bfin_vp3_idct; - c->idct_add = ff_bfin_vp3_idct_add; - c->idct_put = ff_bfin_vp3_idct_put; - } else if (avctx->idct_algo == FF_IDCT_AUTO) { + if (avctx->idct_algo == FF_IDCT_AUTO) { c->idct_permutation_type = FF_NO_IDCT_PERM; c->idct = ff_bfin_idct; c->idct_add = bfin_idct_add; diff --git a/libavcodec/bfin/dsputil_bfin.h b/libavcodec/bfin/dsputil_bfin.h index 04f87cc2b8..293092363b 100644 --- a/libavcodec/bfin/dsputil_bfin.h +++ b/libavcodec/bfin/dsputil_bfin.h @@ -38,9 +38,6 @@ 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; diff --git a/libavcodec/bfin/vp3_bfin.c b/libavcodec/bfin/vp3_bfin.c index b6d5d6744c..6b2fc56ec7 100644 --- a/libavcodec/bfin/vp3_bfin.c +++ b/libavcodec/bfin/vp3_bfin.c @@ -21,8 +21,9 @@ #include <string.h> #include "libavcodec/avcodec.h" -#include "libavcodec/dsputil.h" +#include "libavcodec/vp3dsp.h" #include "dsputil_bfin.h" +#include "vp3_bfin.h" /* Intra iDCT offset 128 */ void ff_bfin_vp3_idct_put (uint8_t *dest, int line_size, int16_t *block) @@ -47,3 +48,9 @@ void ff_bfin_vp3_idct_add (uint8_t *dest, int line_size, int16_t *block) memset(block, 0, 128); } + +void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags) +{ + c->idct_add = ff_bfin_vp3_idct_add; + c->idct_put = ff_bfin_vp3_idct_put; +} diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index c75f1f3b80..7092ba679b 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -42,10 +42,10 @@ typedef struct TgvContext { AVFrame frame; AVFrame last_frame; int width,height; - unsigned int palette[AVPALETTE_COUNT]; + uint32_t palette[AVPALETTE_COUNT]; int (*mv_codebook)[2]; - unsigned char (*block_codebook)[16]; + uint8_t (*block_codebook)[16]; int num_mvs; ///< current length of mv_codebook int num_blocks_packed; ///< current length of block_codebook } TgvContext; @@ -66,11 +66,11 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx) * @return 0 on success, -1 on critical buffer underflow */ static int unpack(const uint8_t *src, const uint8_t *src_end, - unsigned char *dst, int width, int height) + uint8_t *dst, int width, int height) { - unsigned char *dst_end = dst + width*height; + uint8_t *dst_end = dst + width*height; int size, size1, size2, offset, run; - unsigned char *dst_start = dst; + uint8_t *dst_start = dst; if (src[0] & 0x01) src += 5; @@ -150,7 +150,7 @@ static int tgv_decode_inter(TgvContext *s, const uint8_t *buf, int i,j,x,y; GetBitContext gb; int mvbits; - const unsigned char *blocks_raw; + const uint8_t *blocks_raw; if(buf_end - buf < 12) return AVERROR_INVALIDDATA; @@ -174,7 +174,7 @@ static int tgv_decode_inter(TgvContext *s, const uint8_t *buf, } if (num_blocks_packed > s->num_blocks_packed) { - s->block_codebook = av_realloc(s->block_codebook, num_blocks_packed*16*sizeof(unsigned char)); + s->block_codebook = av_realloc(s->block_codebook, num_blocks_packed*16); s->num_blocks_packed = num_blocks_packed; } @@ -213,7 +213,7 @@ static int tgv_decode_inter(TgvContext *s, const uint8_t *buf, for (y = 0; y < s->avctx->height / 4; y++) for (x = 0; x < s->avctx->width / 4; x++) { unsigned int vector = get_bits(&gb, vector_bits); - const unsigned char *src; + const uint8_t *src; int src_stride; if (vector < num_mvs) { diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 68e850c60e..a9d29ad2b3 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -211,10 +211,9 @@ static int decode_frame(AVCodecContext *avctx, return (get_bits_count(&a->gb)+31)/32*4; } -static av_cold void mdec_common_init(AVCodecContext *avctx){ +static av_cold int decode_init(AVCodecContext *avctx){ MDECContext * const a = avctx->priv_data; - - ff_dsputil_init(&a->dsp, avctx); + AVFrame *p= &a->picture; a->mb_width = (avctx->coded_width + 15) / 16; a->mb_height = (avctx->coded_height + 15) / 16; @@ -222,13 +221,8 @@ static av_cold void mdec_common_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&a->picture); avctx->coded_frame= &a->picture; a->avctx= avctx; -} -static av_cold int decode_init(AVCodecContext *avctx){ - MDECContext * const a = avctx->priv_data; - AVFrame *p= &a->picture; - - mdec_common_init(avctx); + ff_dsputil_init(&a->dsp, avctx); ff_mpeg12_init_vlcs(); ff_init_scantable(a->dsp.idct_permutation, &a->scantable, ff_zigzag_direct); diff --git a/libavcodec/vp3dsp.c b/libavcodec/vp3dsp.c index 2c22130642..f3f9bd231d 100644 --- a/libavcodec/vp3dsp.c +++ b/libavcodec/vp3dsp.c @@ -310,6 +310,8 @@ av_cold void ff_vp3dsp_init(VP3DSPContext *c, int flags) if (ARCH_ARM) ff_vp3dsp_init_arm(c, flags); + if (ARCH_BFIN) + ff_vp3dsp_init_bfin(c, flags); if (ARCH_PPC) ff_vp3dsp_init_ppc(c, flags); if (ARCH_X86) diff --git a/libavcodec/vp3dsp.h b/libavcodec/vp3dsp.h index 8ffecca780..558077f908 100644 --- a/libavcodec/vp3dsp.h +++ b/libavcodec/vp3dsp.h @@ -49,6 +49,7 @@ typedef struct VP3DSPContext { void ff_vp3dsp_init(VP3DSPContext *c, int flags); void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags); +void ff_vp3dsp_init_bfin(VP3DSPContext *c, int flags); void ff_vp3dsp_init_ppc(VP3DSPContext *c, int flags); void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags); diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c index 01172afbf1..9e959c3850 100644 --- a/libavcodec/x86/h264_qpel.c +++ b/libavcodec/x86/h264_qpel.c @@ -544,7 +544,7 @@ void ff_h264qpel_init_x86(H264QpelContext *c, int bit_depth) SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, mmxext, ); SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, mmxext, ); } else if (bit_depth == 10) { -#if !ARCH_X86_64 +#if ARCH_X86_32 SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 10_mmxext, ff_); SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 10_mmxext, ff_); SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 10_mmxext, ff_); diff --git a/libavcodec/x86/idct_sse2_xvid.c b/libavcodec/x86/idct_sse2_xvid.c index d121b25031..09b9e40364 100644 --- a/libavcodec/x86/idct_sse2_xvid.c +++ b/libavcodec/x86/idct_sse2_xvid.c @@ -376,7 +376,7 @@ inline void ff_idct_xvid_sse2(short *block) JZ("%%esi", "1f") "5: \n\t" iMTX_MULT("7*16(%0)", MANGLE(iTab2), ROUND(walkenIdctRounders+5*16), PUT_ODD(ROW7)) -#if !ARCH_X86_64 +#if ARCH_X86_32 iLLM_HEAD #endif iLLM_PASS("%0") |