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;
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 */
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;