diff options
author | Tobias Bindhammer <tobias.bindhammer@uni-ulm.de> | 2010-08-26 10:02:59 +0000 |
---|---|---|
committer | Tobias Bindhammer <tobias.bindhammer@uni-ulm.de> | 2010-08-26 10:02:59 +0000 |
commit | 99d8166dafd8a14c9e4796df0ebcc7e172cbec3b (patch) | |
tree | 32381f13fa83371bd95754a1a5033b6fd426aad1 | |
parent | e0ae6c17fea47a4e42ed8d8d9b08ff25ebab9197 (diff) | |
download | ffmpeg-99d8166dafd8a14c9e4796df0ebcc7e172cbec3b.tar.gz |
Setting proper values in extradata for future use in muxer
Originally committed as revision 24939 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/a64multienc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c index 5a91a149b2..df76bd9b9e 100644 --- a/libavcodec/a64multienc.c +++ b/libavcodec/a64multienc.c @@ -199,6 +199,12 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx) c->mc_colram = av_mallocz(CHARSET_CHARS * sizeof(uint8_t)); c->mc_charset = av_malloc (0x800 * (INTERLACED+1) * sizeof(uint8_t)); + /* set up extradata */ + avctx->extradata = av_mallocz(8 * 4 + FF_INPUT_BUFFER_PADDING_SIZE); + avctx->extradata_size = 8 * 4; + AV_WB32(avctx->extradata, c->mc_lifetime); + AV_WB32(avctx->extradata+16, INTERLACED); + avcodec_get_frame_defaults(&c->picture); avctx->coded_frame = &c->picture; avctx->coded_frame->pict_type = FF_I_TYPE; @@ -243,6 +249,10 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, int *meta = c->mc_meta_charset; int *best_cb = c->mc_best_cb; + int charset_size = 0x800 * (INTERLACED + 1); + int screen_size = 0x400; + int colram_size = 0x100 * c->mc_use_5col; + /* no data, means end encoding asap */ if (!data) { /* all done, end encoding */ @@ -314,6 +324,10 @@ static int a64multi_encode_frame(AVCodecContext *avctx, unsigned char *buf, charmap += 1000; } + AV_WB32(avctx->extradata+4, c->mc_frame_counter); + AV_WB32(avctx->extradata+8, charset_size); + AV_WB32(avctx->extradata+12, screen_size + colram_size); + /* reset counter */ c->mc_frame_counter = 0; |