Revision 8dbe5856 libavcodec/h264.c

View differences:

libavcodec/h264.c
894 894
    dst->list_counts              = src->list_counts;
895 895

  
896 896
    dst->s.obmc_scratchpad = NULL;
897
    ff_h264_pred_init(&dst->hpc, src->s.codec_id);
897
    ff_h264_pred_init(&dst->hpc, src->s.codec_id, src->sps.bit_depth_luma);
898 898
}
899 899

  
900 900
/**
......
922 922
    s->height = s->avctx->height;
923 923
    s->codec_id= s->avctx->codec->id;
924 924

  
925
    ff_h264dsp_init(&h->h264dsp);
926
    ff_h264_pred_init(&h->hpc, s->codec_id);
925
    ff_h264dsp_init(&h->h264dsp, 8);
926
    ff_h264_pred_init(&h->hpc, s->codec_id, 8);
927 927

  
928 928
    h->dequant_coeff_pps= -1;
929 929
    s->unrestricted_mv=1;
......
1005 1005

  
1006 1006
    ff_h264_decode_init_vlc();
1007 1007

  
1008
    h->sps.bit_depth_luma = 8;
1008
    h->sps.bit_depth_luma = avctx->bits_per_raw_sample = 8;
1009 1009
    h->pixel_size = 1;
1010 1010

  
1011 1011
    h->thread_context[0] = h;
......
3467 3467

  
3468 3468
            if(avctx->has_b_frames < 2)
3469 3469
                avctx->has_b_frames= !s->low_delay;
3470

  
3471
            if (avctx->bits_per_raw_sample != h->sps.bit_depth_luma) {
3472
                if (h->sps.bit_depth_luma >= 8 && h->sps.bit_depth_luma <= 10) {
3473
                    avctx->bits_per_raw_sample = h->sps.bit_depth_luma;
3474
                    h->pixel_size = (h->sps.bit_depth_luma+7)/8;
3475

  
3476
                    ff_h264dsp_init(&h->h264dsp, h->sps.bit_depth_luma);
3477
                    ff_h264_pred_init(&h->hpc, s->codec_id, h->sps.bit_depth_luma);
3478
                    dsputil_init(&s->dsp, s->avctx);
3479
                } else {
3480
                    av_log(avctx, AV_LOG_DEBUG, "Unsupported bit depth: %d\n", h->sps.bit_depth_luma);
3481
                    return -1;
3482
                }
3483
            }
3470 3484
            break;
3471 3485
        case NAL_PPS:
3472 3486
            init_get_bits(&s->gb, ptr, bit_length);

Also available in: Unified diff