diff options
author | Kieran Kunhya <kierank@ob-encoder.com> | 2015-12-09 13:43:29 +0000 |
---|---|---|
committer | Rostislav Pehlivanov <atomnuker@gmail.com> | 2015-12-10 16:52:48 +0000 |
commit | 9553689854d61069ae3467f9b46dac43ee991d96 (patch) | |
tree | 5ffa192587ce0ac4c4d1c31654308bf2150e14aa /libavcodec/dirac.c | |
parent | bd3409f52a05088aee5f9068b7d0ab66191a66b5 (diff) | |
download | ffmpeg-9553689854d61069ae3467f9b46dac43ee991d96.tar.gz |
diracdec: Move strides to bytes, and pointer types to uint8_t.
Start templating functions for move to support 10-bit
Parts of this patch were written by Rostislav Pehlivanov
Diffstat (limited to 'libavcodec/dirac.c')
-rw-r--r-- | libavcodec/dirac.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 07db919be4..aa82dd9854 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -118,7 +118,7 @@ static const enum AVPixelFormat dirac_pix_fmt[2][3] = { /* [DIRAC_STD] 10.3 Parse Source Parameters. * source_parameters(base_video_format) */ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, - dirac_source_params *source) + dirac_source_params *source, int *bit_depth) { AVRational frame_rate = { 0, 0 }; unsigned luma_depth = 8, luma_offset = 16; @@ -239,6 +239,9 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, if (luma_depth > 8) av_log(avctx, AV_LOG_WARNING, "Bitdepth greater than 8\n"); + + *bit_depth = luma_depth; + avctx->pix_fmt = dirac_pix_fmt[!luma_offset][source->chroma_format]; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &chroma_x_shift, &chroma_y_shift); if ((source->width % (1<<chroma_x_shift)) || (source->height % (1<<chroma_y_shift))) { @@ -290,7 +293,8 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, /* [DIRAC_STD] 10. Sequence Header. sequence_header() */ int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, - dirac_source_params *source) + dirac_source_params *source, + int *bit_depth) { unsigned version_major; unsigned video_format, picture_coding_mode; @@ -318,7 +322,7 @@ int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, /* [DIRAC_STD] 10.3 Source Parameters * Override the defaults. */ - if (ret = parse_source_parameters(avctx, gb, source)) + if (ret = parse_source_parameters(avctx, gb, source, bit_depth)) return ret; ret = ff_set_dimensions(avctx, source->width, source->height); |