diff options
author | Anton Khirnov <anton@khirnov.net> | 2013-12-02 00:45:40 +0400 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2013-12-05 16:34:13 +0400 |
commit | 6d70639c7d5fe762c5f18de574eafa817fb53ef7 (patch) | |
tree | 8626a67769a360c4c18993e5413518f8a5cd4f82 | |
parent | e1eaaec765d2e726618633fcbd2e06fded7647a8 (diff) |
mjpegenc: do not pass MpegEncContext to jpeg_table_header()
Pass the three needed fields from it directly.
This will allow to deMpegEncContextize the LJPEG encoder.
-rw-r--r-- | libavcodec/mjpegenc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 0322f8bdd8..7b54e504b0 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -96,9 +96,9 @@ static int put_huffman_table(PutBitContext *p, int table_class, int table_id, return n + 17; } -static void jpeg_table_header(MpegEncContext *s) +static void jpeg_table_header(PutBitContext *p, ScanTable *intra_scantable, + uint16_t intra_matrix[64]) { - PutBitContext *p = &s->pb; int i, j, size; uint8_t *ptr; @@ -108,8 +108,8 @@ static void jpeg_table_header(MpegEncContext *s) put_bits(p, 4, 0); /* 8 bit precision */ put_bits(p, 4, 0); /* table 0 */ for(i=0;i<64;i++) { - j = s->intra_scantable.permutated[i]; - put_bits(p, 8, s->intra_matrix[j]); + j = intra_scantable->permutated[i]; + put_bits(p, 8, intra_matrix[j]); } /* huffman table */ @@ -180,7 +180,7 @@ void ff_mjpeg_encode_picture_header(MpegEncContext *s) jpeg_put_comments(s->avctx, &s->pb); - jpeg_table_header(s); + jpeg_table_header(&s->pb, &s->intra_scantable, s->intra_matrix); switch(s->avctx->codec_id){ case AV_CODEC_ID_MJPEG: put_marker(&s->pb, SOF0 ); break; |