mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-29 22:00:58 +02:00
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>
This commit is contained in:
commit
14aa358c20
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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_);
|
||||
|
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user