X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fwmv2enc.c;h=256c4e546fd6a30982a80c28d6d61b5e41aa0046;hb=b452d5ae866942cec00aa1432fe29498b38b49fc;hp=84eedf3e4385df171f9f55ca1b282b2b523ad9f1;hpb=fc53b6afee7cdf1b9125d2c5a43f3fe879d85f24;p=ffmpeg diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 84eedf3e438..256c4e546fd 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -1,25 +1,24 @@ /* - * Copyright (c) 2002 The FFmpeg Project + * Copyright (c) 2002 The Libav Project * - * This file is part of FFmpeg. + * This file is part of Libav. * - * FFmpeg is free software; you can redistribute it and/or + * Libav is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * FFmpeg is distributed in the hope that it will be useful, + * Libav is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software + * License along with Libav; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "avcodec.h" -#include "dsputil.h" #include "mpegvideo.h" #include "msmpeg4.h" #include "msmpeg4data.h" @@ -55,7 +54,7 @@ static int encode_ext_header(Wmv2Context *w){ static av_cold int wmv2_encode_init(AVCodecContext *avctx){ Wmv2Context * const w= avctx->priv_data; - if(MPV_encode_init(avctx) < 0) + if(ff_MPV_encode_init(avctx) < 0) return -1; ff_wmv2_common_init(w); @@ -72,7 +71,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) Wmv2Context * const w= (Wmv2Context*)s; put_bits(&s->pb, 1, s->pict_type - 1); - if(s->pict_type == FF_I_TYPE){ + if(s->pict_type == AV_PICTURE_TYPE_I){ put_bits(&s->pb, 7, 0); } put_bits(&s->pb, 5, s->qscale); @@ -87,7 +86,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) assert(s->flipflop_rounding); - if (s->pict_type == FF_I_TYPE) { + if (s->pict_type == AV_PICTURE_TYPE_I) { assert(s->no_rounding==1); if(w->j_type_bit) put_bits(&s->pb, 1, w->j_type); @@ -148,7 +147,7 @@ int ff_wmv2_encode_picture_header(MpegEncContext * s, int picture_number) * useless M$ crap features. It is duplicated here in case someone wants * to add support for these crap features. */ void ff_wmv2_encode_mb(MpegEncContext * s, - DCTELEM block[6][64], + int16_t block[6][64], int motion_x, int motion_y) { Wmv2Context * const w= (Wmv2Context*)s; @@ -167,11 +166,11 @@ void ff_wmv2_encode_mb(MpegEncContext * s, } put_bits(&s->pb, - wmv2_inter_table[w->cbp_table_index][cbp + 64][1], - wmv2_inter_table[w->cbp_table_index][cbp + 64][0]); + ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][1], + ff_wmv2_inter_table[w->cbp_table_index][cbp + 64][0]); /* motion vector */ - h263_pred_motion(s, 0, 0, &pred_x, &pred_y); + ff_h263_pred_motion(s, 0, 0, &pred_x, &pred_y); ff_msmpeg4_encode_motion(s, motion_x - pred_x, motion_y - pred_y); } else { @@ -191,18 +190,18 @@ void ff_wmv2_encode_mb(MpegEncContext * s, coded_cbp |= val << (5 - i); } - if (s->pict_type == FF_I_TYPE) { + if (s->pict_type == AV_PICTURE_TYPE_I) { put_bits(&s->pb, ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); } else { put_bits(&s->pb, - wmv2_inter_table[w->cbp_table_index][cbp][1], - wmv2_inter_table[w->cbp_table_index][cbp][0]); + ff_wmv2_inter_table[w->cbp_table_index][cbp][1], + ff_wmv2_inter_table[w->cbp_table_index][cbp][0]); } put_bits(&s->pb, 1, 0); /* no AC prediction yet */ if(s->inter_intra_pred){ s->h263_aic_dir=0; - put_bits(&s->pb, table_inter_intra[s->h263_aic_dir][1], table_inter_intra[s->h263_aic_dir][0]); + put_bits(&s->pb, ff_table_inter_intra[s->h263_aic_dir][1], ff_table_inter_intra[s->h263_aic_dir][0]); } } @@ -211,14 +210,14 @@ void ff_wmv2_encode_mb(MpegEncContext * s, } } -AVCodec wmv2_encoder = { - "wmv2", - CODEC_TYPE_VIDEO, - CODEC_ID_WMV2, - sizeof(Wmv2Context), - wmv2_encode_init, - MPV_encode_picture, - MPV_encode_end, - .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, - .long_name= NULL_IF_CONFIG_SMALL("Windows Media Video 8"), +AVCodec ff_wmv2_encoder = { + .name = "wmv2", + .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), + .type = AVMEDIA_TYPE_VIDEO, + .id = AV_CODEC_ID_WMV2, + .priv_data_size = sizeof(Wmv2Context), + .init = wmv2_encode_init, + .encode2 = ff_MPV_encode_picture, + .close = ff_MPV_encode_end, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, };