diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 12:34:59 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-03-21 12:34:59 +0100 |
commit | 137df692fc28710aa1a21856b1f5b9e157896fef (patch) | |
tree | 89d3f10251855bf0b7ec9519844422a420609bb5 | |
parent | bbc0f6f9789361f9ddd462bc458410e6f0081d57 (diff) | |
parent | 48d0fd2d62a476e1db9298163f1fc0abae26cc67 (diff) | |
download | ffmpeg-137df692fc28710aa1a21856b1f5b9e157896fef.tar.gz |
Merge commit '48d0fd2d62a476e1db9298163f1fc0abae26cc67'
* commit '48d0fd2d62a476e1db9298163f1fc0abae26cc67':
h264: merge common_init() into ff_h264_decode_init.
Conflicts:
libavcodec/h264.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/h264.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 0d31a380eb..02053b56c1 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -1401,36 +1401,6 @@ fail: static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size, int parse_extradata); -static av_cold void common_init(H264Context *h) -{ - - h->width = h->avctx->width; - h->height = h->avctx->height; - - h->bit_depth_luma = 8; - h->chroma_format_idc = 1; - - h->avctx->bits_per_raw_sample = 8; - h->cur_chroma_format_idc = 1; - - ff_h264dsp_init(&h->h264dsp, 8, 1); - av_assert0(h->sps.bit_depth_chroma == 0); - ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma); - ff_h264qpel_init(&h->h264qpel, 8); - ff_h264_pred_init(&h->hpc, h->avctx->codec_id, 8, 1); - - h->dequant_coeff_pps = -1; - - if (CONFIG_ERROR_RESILIENCE) { - /* needed so that IDCT permutation is known early */ - ff_dsputil_init(&h->dsp, h->avctx); - } - ff_videodsp_init(&h->vdsp, 8); - - memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t)); - memset(h->pps.scaling_matrix8, 16, 2 * 64 * sizeof(uint8_t)); -} - int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size) { AVCodecContext *avctx = h->avctx; @@ -1494,7 +1464,32 @@ av_cold int ff_h264_decode_init(AVCodecContext *avctx) int i; h->avctx = avctx; - common_init(h); + + h->width = h->avctx->width; + h->height = h->avctx->height; + + h->bit_depth_luma = 8; + h->chroma_format_idc = 1; + + h->avctx->bits_per_raw_sample = 8; + h->cur_chroma_format_idc = 1; + + ff_h264dsp_init(&h->h264dsp, 8, 1); + av_assert0(h->sps.bit_depth_chroma == 0); + ff_h264chroma_init(&h->h264chroma, h->sps.bit_depth_chroma); + ff_h264qpel_init(&h->h264qpel, 8); + ff_h264_pred_init(&h->hpc, h->avctx->codec_id, 8, 1); + + h->dequant_coeff_pps = -1; + + if (CONFIG_ERROR_RESILIENCE) { + /* needed so that IDCT permutation is known early */ + ff_dsputil_init(&h->dsp, h->avctx); + } + ff_videodsp_init(&h->vdsp, 8); + + memset(h->pps.scaling_matrix4, 16, 6 * 16 * sizeof(uint8_t)); + memset(h->pps.scaling_matrix8, 16, 2 * 64 * sizeof(uint8_t)); h->picture_structure = PICT_FRAME; h->slice_context_count = 1; |