diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-14 20:12:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-14 20:17:24 +0200 |
commit | 7e944159c63c4d4504cf76f90bb668519c3109af (patch) | |
tree | 99c916277e5523ae607f50cdde69030513b70d39 /libavcodec/vcr1.c | |
parent | 281bde27894f994d0982ab9283f15d6073ae352c (diff) | |
parent | 100c70b0481b889d522b4fc2aac5b948ddb05c70 (diff) | |
download | ffmpeg-7e944159c63c4d4504cf76f90bb668519c3109af.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (25 commits)
vcr1: Add vcr1_ prefixes to all static functions with generic names.
vcr1: Fix return type of common_init to match the function pointer signature.
vcr1enc: Replace obsolete get_bit_count by put_bits_count/flush_put_bits.
motion-test: remove disabled code
gxfenc: remove disabled half-implemented MJPEG tag
x86: use more standard construct for setting ASM functions in FFT code
fate: westwood-aud: disable decoding
fate: caf: disable decoding
fate: film-cvid: drop pcm audio and rename test
fate: d-cinema-demux: drop unnecessary flags
fate: split off dpcm-interplay from interplay-mve tests
fate: rename funcom-iss to adpcm-ima-iss
fate: rename cryo-apc to adpcm-ima-apc
fate: rename adpcm-psx-str-v3 to adpcm-xa
fate: split off adpcm-ms-mono test from dxa-feeble
fate: split off adpcm-ima-ws test from vqa-cc
fate: add adpcm-ima-smjpeg test
fate: split off adpcm-ima-amv from amv test
fate: separate bmv audio and video tests
fate: separate delphine-cin audio and video tests
...
Conflicts:
doc/platform.texi
libavcodec/vcr1.c
tests/fate/audio.mak
tests/fate/demux.mak
tests/fate/video.mak
tests/ref/fate/ea-mad-pcm-planar
tests/ref/fate/interplay-mve-16bit
tests/ref/fate/interplay-mve-8bit
tests/ref/fate/mtv
tests/ref/fate/qtrle-1bit
tests/ref/fate/qtrle-2bit
tests/ref/fate/truemotion1-15
tests/ref/fate/truemotion1-24
tests/ref/fate/vqa-cc
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/vcr1.c')
-rw-r--r-- | libavcodec/vcr1.c | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index 13aded9122..a5e1bc6577 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -33,24 +33,26 @@ typedef struct VCR1Context { int offset[4]; } VCR1Context; -static av_cold void common_init(AVCodecContext *avctx) +static av_cold int vcr1_common_init(AVCodecContext *avctx) { VCR1Context *const a = avctx->priv_data; avctx->coded_frame = &a->picture; avcodec_get_frame_defaults(&a->picture); + + return 0; } -static av_cold int decode_init(AVCodecContext *avctx) +static av_cold int vcr1_decode_init(AVCodecContext *avctx) { - common_init(avctx); + vcr1_common_init(avctx); avctx->pix_fmt = PIX_FMT_YUV410P; return 0; } -static av_cold int decode_end(AVCodecContext *avctx) +static av_cold int vcr1_decode_end(AVCodecContext *avctx) { VCR1Context *s = avctx->priv_data; @@ -60,8 +62,8 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -static int decode_frame(AVCodecContext *avctx, void *data, - int *data_size, AVPacket *avpkt) +static int vcr1_decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; @@ -145,9 +147,9 @@ AVCodec ff_vcr1_decoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VCR1, .priv_data_size = sizeof(VCR1Context), - .init = decode_init, - .close = decode_end, - .decode = decode_frame, + .init = vcr1_decode_init, + .close = vcr1_decode_end, + .decode = vcr1_decode_frame, .capabilities = CODEC_CAP_DR1, .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), }; @@ -157,8 +159,11 @@ AVCodec ff_vcr1_decoder = { #define CONFIG_VCR1_ENCODER 0 #if CONFIG_VCR1_ENCODER -static int encode_frame(AVCodecContext *avctx, unsigned char *buf, - int buf_size, void *data) + +#include "put_bits.h" + +static int vcr1_encode_frame(AVCodecContext *avctx, unsigned char *buf, + int buf_size, void *data) { VCR1Context *const a = avctx->priv_data; AVFrame *pict = data; @@ -170,10 +175,9 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, p->key_frame = 1; avpriv_align_put_bits(&a->pb); - while (get_bit_count(&a->pb) & 31) - put_bits(&a->pb, 8, 0); + flush_put_bits(&a->pb); - size = get_bit_count(&a->pb) / 32; + size = put_bits_count(&a->pb) / 32; return size * 4; } @@ -183,8 +187,8 @@ AVCodec ff_vcr1_encoder = { .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VCR1, .priv_data_size = sizeof(VCR1Context), - .init = common_init, - .encode = encode_frame, + .init = vcr1_common_init, + .encode = vcr1_encode_frame, .long_name = NULL_IF_CONFIG_SMALL("ATI VCR1"), }; #endif /* CONFIG_VCR1_ENCODER */ |