diff options
Diffstat (limited to 'src/libffmpeg/libavcodec/wmv2.c')
-rw-r--r-- | src/libffmpeg/libavcodec/wmv2.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/src/libffmpeg/libavcodec/wmv2.c b/src/libffmpeg/libavcodec/wmv2.c index 6def6f2a8..99780f6f4 100644 --- a/src/libffmpeg/libavcodec/wmv2.c +++ b/src/libffmpeg/libavcodec/wmv2.c @@ -17,6 +17,11 @@ * */ +/** + * @file wmv2.c + * wmv2 codec. + */ + #include "simple_idct.h" #define SKIP_TYPE_NONE 0 @@ -61,7 +66,7 @@ static int encode_ext_header(Wmv2Context *w){ init_put_bits(&pb, s->avctx->extradata, s->avctx->extradata_size, NULL, NULL); - put_bits(&pb, 5, s->frame_rate / FRAME_RATE_BASE); //yes 29.97 -> 29 + put_bits(&pb, 5, s->avctx->frame_rate / s->avctx->frame_rate_base); //yes 29.97 -> 29 put_bits(&pb, 11, FFMIN(s->bit_rate/1024, 2047)); put_bits(&pb, 1, w->mspel_bit=1); @@ -79,6 +84,7 @@ static int encode_ext_header(Wmv2Context *w){ return 0; } +#ifdef CONFIG_ENCODERS static int wmv2_encode_init(AVCodecContext *avctx){ Wmv2Context * const w= avctx->priv_data; @@ -192,7 +198,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s, Wmv2Context * const w= (Wmv2Context*)s; int cbp, coded_cbp, i; int pred_x, pred_y; - UINT8 *coded_block; + uint8_t *coded_block; handle_slices(s); @@ -255,6 +261,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s, msmpeg4_encode_block(s, block[i], i); } } +#endif //CONFIG_ENCODERS static void parse_mb_skip(Wmv2Context * w){ int mb_x, mb_y; @@ -326,7 +333,7 @@ static int decode_ext_header(Wmv2Context *w){ code = get_bits(&gb, 3); if(code==0) return -1; - + s->slice_height = s->mb_height / code; if(s->avctx->debug&FF_DEBUG_PICT_INFO){ @@ -467,7 +474,7 @@ s->picture_number++; //FIXME ? return 0; } -void ff_wmv2_decode_init(MpegEncContext *s){ +static void ff_wmv2_decode_init(MpegEncContext *s){ } static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){ @@ -491,7 +498,7 @@ static inline int wmv2_decode_motion(Wmv2Context *w, int *mx_ptr, int *my_ptr){ static int16_t *wmv2_pred_motion(Wmv2Context *w, int *px, int *py){ MpegEncContext * const s= &w->s; int xy, wrap, diff, type; - INT16 *A, *B, *C, *mot_val; + int16_t *A, *B, *C, *mot_val; wrap = s->block_wrap[0]; xy = s->block_index[0]; @@ -576,12 +583,11 @@ static inline int wmv2_decode_inter_block(Wmv2Context *w, DCTELEM *block, int n, static void wmv2_add_block(Wmv2Context *w, DCTELEM *block1, uint8_t *dst, int stride, int n){ MpegEncContext * const s= &w->s; uint8_t temp[2][64]; - int i; - + switch(w->abt_type_table[n]){ case 0: if (s->block_last_index[n] >= 0) { - s->idct_add (dst, stride, block1); + s->dsp.idct_add (dst, stride, block1); } break; case 1: @@ -614,12 +620,12 @@ void ff_wmv2_add_mb(MpegEncContext *s, DCTELEM block1[6][64], uint8_t *dest_y, u } void ff_mspel_motion(MpegEncContext *s, - UINT8 *dest_y, UINT8 *dest_cb, UINT8 *dest_cr, - UINT8 **ref_picture, op_pixels_func (*pix_op)[4], + 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) { Wmv2Context * const w= (Wmv2Context*)s; - UINT8 *ptr; + uint8_t *ptr; int dxy, offset, mx, my, src_x, src_y, v_edge_pos, linesize, uvlinesize; int emu=0; @@ -700,12 +706,10 @@ static int wmv2_decode_mb(MpegEncContext *s, DCTELEM block[6][64]) { Wmv2Context * const w= (Wmv2Context*)s; int cbp, code, i; - UINT8 *coded_val; + uint8_t *coded_val; if(w->j_type) return 0; - s->error_status_table[s->mb_x + s->mb_y*s->mb_width]= 0; - if (s->pict_type == P_TYPE) { if(s->mb_type[s->mb_y * s->mb_width + s->mb_x]&MB_TYPE_SKIPED){ /* skip mb */ @@ -829,6 +833,7 @@ AVCodec wmv2_decoder = { CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1, }; +#ifdef CONFIG_ENCODERS AVCodec wmv2_encoder = { "wmv2", CODEC_TYPE_VIDEO, @@ -838,4 +843,4 @@ AVCodec wmv2_encoder = { MPV_encode_picture, MPV_encode_end, }; - +#endif |