mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/jpegtables: Move ff_mjpeg_build_huffman_codes to mjpegenc_common
Since g2meet.c doesn't use it any more, only encoders use it and the place for their common code is mjpegenc_common.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
d26198ada3
commit
6eae9c1d39
@ -122,24 +122,3 @@ const uint8_t avpriv_mjpeg_val_ac_chrominance[] =
|
|||||||
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
0xea, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
|
||||||
0xf9, 0xfa
|
0xf9, 0xfa
|
||||||
};
|
};
|
||||||
|
|
||||||
/* isn't this function nicer than the one in the libjpeg ? */
|
|
||||||
void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
|
|
||||||
const uint8_t *bits_table,
|
|
||||||
const uint8_t *val_table)
|
|
||||||
{
|
|
||||||
int i, j, k,nb, code, sym;
|
|
||||||
|
|
||||||
k = 0;
|
|
||||||
code = 0;
|
|
||||||
for(i=1;i<=16;i++) {
|
|
||||||
nb = bits_table[i];
|
|
||||||
for(j=0;j<nb;j++) {
|
|
||||||
sym = val_table[k++];
|
|
||||||
huff_size[sym] = i;
|
|
||||||
huff_code[sym] = code;
|
|
||||||
code++;
|
|
||||||
}
|
|
||||||
code <<= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -36,8 +36,4 @@ extern av_export_avcodec const uint8_t avpriv_mjpeg_val_ac_luminance[];
|
|||||||
extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_ac_chrominance[];
|
extern av_export_avcodec const uint8_t avpriv_mjpeg_bits_ac_chrominance[];
|
||||||
extern av_export_avcodec const uint8_t avpriv_mjpeg_val_ac_chrominance[];
|
extern av_export_avcodec const uint8_t avpriv_mjpeg_val_ac_chrominance[];
|
||||||
|
|
||||||
void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
|
|
||||||
const uint8_t *bits_table,
|
|
||||||
const uint8_t *val_table);
|
|
||||||
|
|
||||||
#endif /* AVCODEC_JPEGTABLES_H */
|
#endif /* AVCODEC_JPEGTABLES_H */
|
||||||
|
@ -466,6 +466,27 @@ void ff_mjpeg_escape_FF(PutBitContext *pb, int start)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* isn't this function nicer than the one in the libjpeg ? */
|
||||||
|
void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
|
||||||
|
const uint8_t *bits_table,
|
||||||
|
const uint8_t *val_table)
|
||||||
|
{
|
||||||
|
int k, code;
|
||||||
|
|
||||||
|
k = 0;
|
||||||
|
code = 0;
|
||||||
|
for (int i = 1; i <= 16; i++) {
|
||||||
|
int nb = bits_table[i];
|
||||||
|
for (int j = 0; j < nb; j++) {
|
||||||
|
int sym = val_table[k++];
|
||||||
|
huff_size[sym] = i;
|
||||||
|
huff_code[sym] = code;
|
||||||
|
code++;
|
||||||
|
}
|
||||||
|
code <<= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds all 4 optimal Huffman tables.
|
* Builds all 4 optimal Huffman tables.
|
||||||
*
|
*
|
||||||
|
@ -35,6 +35,9 @@ void ff_mjpeg_encode_picture_header(AVCodecContext *avctx, PutBitContext *pb,
|
|||||||
void ff_mjpeg_encode_picture_frame(MpegEncContext *s);
|
void ff_mjpeg_encode_picture_frame(MpegEncContext *s);
|
||||||
void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits);
|
void ff_mjpeg_encode_picture_trailer(PutBitContext *pb, int header_bits);
|
||||||
void ff_mjpeg_escape_FF(PutBitContext *pb, int start);
|
void ff_mjpeg_escape_FF(PutBitContext *pb, int start);
|
||||||
|
void ff_mjpeg_build_huffman_codes(uint8_t *huff_size, uint16_t *huff_code,
|
||||||
|
const uint8_t *bits_table,
|
||||||
|
const uint8_t *val_table);
|
||||||
int ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
int ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
||||||
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4]);
|
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[4], int vsample[4]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user