mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-04 14:22:12 +00:00
avcodec/huffyuv: add a field that represents the number of symbols
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8173d1ffc0
commit
534a89478d
@ -68,6 +68,7 @@ typedef struct HYuvContext {
|
||||
int yuy2; //use yuy2 instead of 422P
|
||||
int bgr32; //use bgr32 instead of bgr24
|
||||
int bps;
|
||||
int n; // 1<<bps
|
||||
int alpha;
|
||||
int chroma;
|
||||
int yuv;
|
||||
|
@ -278,6 +278,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
s->version = 0;
|
||||
|
||||
s->bps = 8;
|
||||
s->n = 1<<s->bps;
|
||||
s->chroma = 1;
|
||||
if (s->version >= 2) {
|
||||
int method, interlace;
|
||||
@ -294,6 +295,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
s->bitstream_bpp = avctx->bits_per_coded_sample & ~7;
|
||||
} else {
|
||||
s->bps = (avctx->extradata[1] >> 4) + 1;
|
||||
s->n = 1<<s->bps;
|
||||
s->chroma_h_shift = avctx->extradata[1] & 3;
|
||||
s->chroma_v_shift = (avctx->extradata[1] >> 2) & 3;
|
||||
s->yuv = !!(((uint8_t*)avctx->extradata)[2] & 1);
|
||||
|
@ -228,6 +228,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
av_log(avctx, AV_LOG_ERROR, "format not supported\n");
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
s->n = 1<<s->bps;
|
||||
|
||||
avctx->bits_per_coded_sample = s->bitstream_bpp;
|
||||
s->decorrelate = s->bitstream_bpp >= 24 && !s->yuv && avctx->pix_fmt != AV_PIX_FMT_GBRP;
|
||||
|
Loading…
Reference in New Issue
Block a user