~ubuntu-branches/ubuntu/lucid/ffmpeg/lucid-security

« back to all changes in this revision

Viewing changes to libavcodec/h264.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2009-03-13 09:18:28 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090313091828-n4ktby5eca487uhv
Tags: 3:0.svn20090303-1ubuntu1+unstripped1
merge from ubuntu.jaunty branch

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 * @author Michael Niedermayer <michaelni@gmx.at>
26
26
 */
27
27
 
 
28
#include "internal.h"
28
29
#include "dsputil.h"
29
30
#include "avcodec.h"
30
31
#include "mpegvideo.h"
96
97
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
97
98
};
98
99
 
99
 
static const int left_block_options[4][8]={
 
100
static const uint8_t left_block_options[4][8]={
100
101
    {0,1,2,3,7,10,8,11},
101
102
    {2,2,3,3,8,11,8,11},
102
103
    {0,0,1,1,7,10,7,10},
111
112
    const int mb_xy= h->mb_xy;
112
113
    int topleft_xy, top_xy, topright_xy, left_xy[2];
113
114
    int topleft_type, top_type, topright_type, left_type[2];
114
 
    const int * left_block;
 
115
    const uint8_t * left_block;
115
116
    int topleft_partition= -1;
116
117
    int i;
117
118
 
1359
1360
    }
1360
1361
}
1361
1362
 
1362
 
/**
1363
 
 * Decodes a network abstraction layer unit.
1364
 
 * @param consumed is the number of bytes used as input
1365
 
 * @param length is the length of the array
1366
 
 * @param dst_length is the number of decoded bytes FIXME here or a decode rbsp tailing?
1367
 
 * @returns decoded bytes, might be src+1 if no escapes
1368
 
 */
1369
 
static const uint8_t *decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length){
 
1363
const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length){
1370
1364
    int i, si, di;
1371
1365
    uint8_t *dst;
1372
1366
    int bufidx;
1385
1379
# if HAVE_FAST_64BIT
1386
1380
#   define RS 7
1387
1381
    for(i=0; i+1<length; i+=9){
1388
 
        if(!((~*(uint64_t*)(src+i) & (*(uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL))
 
1382
        if(!((~*(const uint64_t*)(src+i) & (*(const uint64_t*)(src+i) - 0x0100010001000101ULL)) & 0x8000800080008080ULL))
1389
1383
# else
1390
1384
#   define RS 3
1391
1385
    for(i=0; i+1<length; i+=5){
1392
 
        if(!((~*(uint32_t*)(src+i) & (*(uint32_t*)(src+i) - 0x01000101U)) & 0x80008080U))
 
1386
        if(!((~*(const uint32_t*)(src+i) & (*(const uint32_t*)(src+i) - 0x01000101U)) & 0x80008080U))
1393
1387
# endif
1394
1388
            continue;
1395
1389
        if(i>0 && !src[i]) i--;
1456
1450
    return dst;
1457
1451
}
1458
1452
 
1459
 
/**
1460
 
 * identifies the exact end of the bitstream
1461
 
 * @return the length of the trailing, or 0 if damaged
1462
 
 */
1463
 
static int decode_rbsp_trailing(H264Context *h, const uint8_t *src){
 
1453
int ff_h264_decode_rbsp_trailing(H264Context *h, const uint8_t *src){
1464
1454
    int v= *src;
1465
1455
    int r;
1466
1456
 
2171
2161
    memset(h->pps.scaling_matrix8, 16, 2*64*sizeof(uint8_t));
2172
2162
}
2173
2163
 
 
2164
/**
 
2165
 * Reset SEI values at the beginning of the frame.
 
2166
 *
 
2167
 * @param h H.264 context.
 
2168
 */
 
2169
static void reset_sei(H264Context *h) {
 
2170
    h->sei_recovery_frame_cnt       = -1;
 
2171
    h->sei_dpb_output_delay         =  0;
 
2172
    h->sei_cpb_removal_delay        = -1;
 
2173
    h->sei_buffering_period_present =  0;
 
2174
}
 
2175
 
2174
2176
static av_cold int decode_init(AVCodecContext *avctx){
2175
2177
    H264Context *h= avctx->priv_data;
2176
2178
    MpegEncContext * const s = &h->s;
2186
2188
    // set defaults
2187
2189
//    s->decode_mb= ff_h263_decode_mb;
2188
2190
    s->quarter_sample = 1;
 
2191
    if(!avctx->has_b_frames)
2189
2192
    s->low_delay= 1;
2190
2193
 
2191
 
    if(avctx->codec_id == CODEC_ID_SVQ3)
2192
 
        avctx->pix_fmt= PIX_FMT_YUVJ420P;
2193
 
    else if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
 
2194
    if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
2194
2195
        avctx->pix_fmt= PIX_FMT_VDPAU_H264;
2195
2196
    else
2196
 
        avctx->pix_fmt= PIX_FMT_YUV420P;
 
2197
        avctx->pix_fmt= avctx->get_format(avctx, avctx->codec->pix_fmts);
 
2198
    avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt);
2197
2199
 
2198
2200
    decode_init_vlc();
2199
2201
 
2208
2210
    h->thread_context[0] = h;
2209
2211
    h->outputed_poc = INT_MIN;
2210
2212
    h->prev_poc_msb= 1<<16;
 
2213
    reset_sei(h);
 
2214
    if(avctx->codec_id == CODEC_ID_H264){
 
2215
        if(avctx->ticks_per_frame == 1){
 
2216
            s->avctx->time_base.den *=2;
 
2217
        }
 
2218
        avctx->ticks_per_frame = 2;
 
2219
    }
2211
2220
    return 0;
2212
2221
}
2213
2222
 
2679
2688
    const int mb_type= s->current_picture.mb_type[mb_xy];
2680
2689
    int is_complex = CONFIG_SMALL || h->is_complex || IS_INTRA_PCM(mb_type) || s->qscale == 0;
2681
2690
 
2682
 
    if(CONFIG_H264_ENCODER && !s->decode)
2683
 
        return;
2684
 
 
2685
2691
    if (is_complex)
2686
2692
        hl_decode_mb_complex(h);
2687
2693
    else hl_decode_mb_simple(h);
3048
3054
    int ref0, ref1, i;
3049
3055
    int cur_poc = s->current_picture_ptr->poc;
3050
3056
 
 
3057
    for (i = 0; i < 2; i++) {
 
3058
        h->luma_weight_flag[i]   = 0;
 
3059
        h->chroma_weight_flag[i] = 0;
 
3060
    }
 
3061
 
3051
3062
    if(   h->ref_count[0] == 1 && h->ref_count[1] == 1
3052
3063
       && h->ref_list[0][0].poc + h->ref_list[1][0].poc == 2*cur_poc){
3053
3064
        h->use_weight= 0;
3059
3070
    h->use_weight_chroma= 2;
3060
3071
    h->luma_log2_weight_denom= 5;
3061
3072
    h->chroma_log2_weight_denom= 5;
3062
 
    for (i = 0; i < 2; i++) {
3063
 
        h->luma_weight_flag[i]   = 0;
3064
 
        h->chroma_weight_flag[i] = 0;
3065
 
    }
3066
3073
 
3067
3074
    for(ref0=0; ref0 < h->ref_count[0]; ref0++){
3068
3075
        int poc0 = h->ref_list[0][ref0].poc;
3144
3151
    if(h->s.current_picture_ptr)
3145
3152
        h->s.current_picture_ptr->reference= 0;
3146
3153
    h->s.first_field= 0;
 
3154
    reset_sei(h);
3147
3155
    ff_mpeg_flush(avctx);
3148
3156
}
3149
3157
 
3263
3271
    MpegEncContext * const s = &h->s;
3264
3272
    int i, j;
3265
3273
    int current_ref_assigned=0;
3266
 
    Picture *pic;
 
3274
    Picture *av_uninit(pic);
3267
3275
 
3268
3276
    if((s->avctx->debug&FF_DEBUG_MMCO) && mmco_count==0)
3269
3277
        av_log(h->s.avctx, AV_LOG_DEBUG, "no mmco here\n");
3270
3278
 
3271
3279
    for(i=0; i<mmco_count; i++){
3272
 
        int structure, frame_num;
 
3280
        int structure, av_uninit(frame_num);
3273
3281
        if(s->avctx->debug&FF_DEBUG_MMCO)
3274
3282
            av_log(h->s.avctx, AV_LOG_DEBUG, "mmco:%d %d %d\n", h->mmco[i].opcode, h->mmco[i].short_pic_num, h->mmco[i].long_arg);
3275
3283
 
3768
3776
            s->avctx->sample_aspect_ratio.den = 1;
3769
3777
 
3770
3778
        if(h->sps.timing_info_present_flag){
3771
 
            s->avctx->time_base= (AVRational){h->sps.num_units_in_tick * 2, h->sps.time_scale};
 
3779
            s->avctx->time_base= (AVRational){h->sps.num_units_in_tick, h->sps.time_scale};
3772
3780
            if(h->x264_build > 0 && h->x264_build < 44)
3773
3781
                s->avctx->time_base.den *= 2;
3774
3782
            av_reduce(&s->avctx->time_base.num, &s->avctx->time_base.den,
3797
3805
        while(h->frame_num !=  h->prev_frame_num &&
3798
3806
              h->frame_num != (h->prev_frame_num+1)%(1<<h->sps.log2_max_frame_num)){
3799
3807
            av_log(NULL, AV_LOG_DEBUG, "Frame num gap %d %d\n", h->frame_num, h->prev_frame_num);
3800
 
            frame_start(h);
 
3808
            if (frame_start(h) < 0)
 
3809
                return -1;
3801
3810
            h->prev_frame_num++;
3802
3811
            h->prev_frame_num %= 1<<h->sps.log2_max_frame_num;
3803
3812
            s->current_picture_ptr->frame_num= h->prev_frame_num;
6267
6276
}
6268
6277
 
6269
6278
 
6270
 
static void av_always_inline filter_mb_dir(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int dir) {
 
6279
static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize, int mb_xy, int mb_type, int mvy_limit, int first_vertical_edge_done, int dir) {
6271
6280
    MpegEncContext * const s = &h->s;
6272
6281
    int edge;
6273
6282
    const int mbm_xy = dir == 0 ? mb_xy -1 : h->top_mb_xy;
6605
6614
    s->mb_skip_run= -1;
6606
6615
 
6607
6616
    h->is_complex = FRAME_MBAFF || s->picture_structure != PICT_FRAME || s->codec_id != CODEC_ID_H264 ||
6608
 
                    (CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (CONFIG_H264_ENCODER && s->encoding);
 
6617
                    (CONFIG_GRAY && (s->flags&CODEC_FLAG_GRAY));
6609
6618
 
6610
6619
    if( h->pps.cabac ) {
6611
6620
        int i;
6781
6790
static int decode_picture_timing(H264Context *h){
6782
6791
    MpegEncContext * const s = &h->s;
6783
6792
    if(h->sps.nal_hrd_parameters_present_flag || h->sps.vcl_hrd_parameters_present_flag){
6784
 
        skip_bits(&s->gb, h->sps.cpb_removal_delay_length); /* cpb_removal_delay */
6785
 
        skip_bits(&s->gb, h->sps.dpb_output_delay_length);  /* dpb_output_delay */
 
6793
        h->sei_cpb_removal_delay = get_bits(&s->gb, h->sps.cpb_removal_delay_length);
 
6794
        h->sei_dpb_output_delay = get_bits(&s->gb, h->sps.dpb_output_delay_length);
6786
6795
    }
6787
6796
    if(h->sps.pic_struct_present_flag){
6788
6797
        unsigned int i, num_clock_ts;
6851
6860
    return 0;
6852
6861
}
6853
6862
 
6854
 
static int decode_sei(H264Context *h){
 
6863
static int decode_recovery_point(H264Context *h){
 
6864
    MpegEncContext * const s = &h->s;
 
6865
 
 
6866
    h->sei_recovery_frame_cnt = get_ue_golomb(&s->gb);
 
6867
    skip_bits(&s->gb, 4);       /* 1b exact_match_flag, 1b broken_link_flag, 2b changing_slice_group_idc */
 
6868
 
 
6869
    return 0;
 
6870
}
 
6871
 
 
6872
static int decode_buffering_period(H264Context *h){
 
6873
    MpegEncContext * const s = &h->s;
 
6874
    unsigned int sps_id;
 
6875
    int sched_sel_idx;
 
6876
    SPS *sps;
 
6877
 
 
6878
    sps_id = get_ue_golomb_31(&s->gb);
 
6879
    if(sps_id > 31 || !h->sps_buffers[sps_id]) {
 
6880
        av_log(h->s.avctx, AV_LOG_ERROR, "non-existing SPS %d referenced in buffering period\n", sps_id);
 
6881
        return -1;
 
6882
    }
 
6883
    sps = h->sps_buffers[sps_id];
 
6884
 
 
6885
    // NOTE: This is really so duplicated in the standard... See H.264, D.1.1
 
6886
    if (sps->nal_hrd_parameters_present_flag) {
 
6887
        for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) {
 
6888
            h->initial_cpb_removal_delay[sched_sel_idx] = get_bits(&s->gb, sps->initial_cpb_removal_delay_length);
 
6889
            skip_bits(&s->gb, sps->initial_cpb_removal_delay_length); // initial_cpb_removal_delay_offset
 
6890
        }
 
6891
    }
 
6892
    if (sps->vcl_hrd_parameters_present_flag) {
 
6893
        for (sched_sel_idx = 0; sched_sel_idx < sps->cpb_cnt; sched_sel_idx++) {
 
6894
            h->initial_cpb_removal_delay[sched_sel_idx] = get_bits(&s->gb, sps->initial_cpb_removal_delay_length);
 
6895
            skip_bits(&s->gb, sps->initial_cpb_removal_delay_length); // initial_cpb_removal_delay_offset
 
6896
        }
 
6897
    }
 
6898
 
 
6899
    h->sei_buffering_period_present = 1;
 
6900
    return 0;
 
6901
}
 
6902
 
 
6903
int ff_h264_decode_sei(H264Context *h){
6855
6904
    MpegEncContext * const s = &h->s;
6856
6905
 
6857
6906
    while(get_bits_count(&s->gb) + 16 < s->gb.size_in_bits){
6868
6917
        }while(get_bits(&s->gb, 8) == 255);
6869
6918
 
6870
6919
        switch(type){
6871
 
        case 1: // Picture timing SEI
 
6920
        case SEI_TYPE_PIC_TIMING: // Picture timing SEI
6872
6921
            if(decode_picture_timing(h) < 0)
6873
6922
                return -1;
6874
6923
            break;
6875
 
        case 5:
 
6924
        case SEI_TYPE_USER_DATA_UNREGISTERED:
6876
6925
            if(decode_unregistered_user_data(h, size) < 0)
6877
6926
                return -1;
6878
6927
            break;
 
6928
        case SEI_TYPE_RECOVERY_POINT:
 
6929
            if(decode_recovery_point(h) < 0)
 
6930
                return -1;
 
6931
            break;
 
6932
        case SEI_BUFFERING_PERIOD:
 
6933
            if(decode_buffering_period(h) < 0)
 
6934
                return -1;
 
6935
            break;
6879
6936
        default:
6880
6937
            skip_bits(&s->gb, 8*size);
6881
6938
        }
6904
6961
        get_ue_golomb(&s->gb); /* cpb_size_value_minus1 */
6905
6962
        get_bits1(&s->gb);     /* cbr_flag */
6906
6963
    }
6907
 
    get_bits(&s->gb, 5); /* initial_cpb_removal_delay_length_minus1 */
 
6964
    sps->initial_cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;
6908
6965
    sps->cpb_removal_delay_length = get_bits(&s->gb, 5) + 1;
6909
6966
    sps->dpb_output_delay_length = get_bits(&s->gb, 5) + 1;
6910
6967
    sps->time_offset_length = get_bits(&s->gb, 5);
 
6968
    sps->cpb_cnt = cpb_count;
6911
6969
    return 0;
6912
6970
}
6913
6971
 
7036
7094
    }
7037
7095
}
7038
7096
 
7039
 
static inline int decode_seq_parameter_set(H264Context *h){
 
7097
int ff_h264_decode_seq_parameter_set(H264Context *h){
7040
7098
    MpegEncContext * const s = &h->s;
7041
7099
    int profile_idc, level_idc;
7042
7100
    unsigned int sps_id;
7168
7226
 
7169
7227
    av_free(h->sps_buffers[sps_id]);
7170
7228
    h->sps_buffers[sps_id]= sps;
 
7229
    h->sps = *sps;
7171
7230
    return 0;
7172
7231
fail:
7173
7232
    av_free(sps);
7182
7241
        pps->chroma_qp_table[t][i] = chroma_qp[av_clip(i + index, 0, 51)];
7183
7242
}
7184
7243
 
7185
 
static inline int decode_picture_parameter_set(H264Context *h, int bit_length){
 
7244
int ff_h264_decode_picture_parameter_set(H264Context *h, int bit_length){
7186
7245
    MpegEncContext * const s = &h->s;
7187
7246
    unsigned int pps_id= get_ue_golomb(&s->gb);
7188
7247
    PPS *pps;
7310
7369
    H264Context *hx;
7311
7370
    int i;
7312
7371
 
 
7372
    if (s->avctx->hwaccel)
 
7373
        return;
7313
7374
    if(s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
7314
7375
        return;
7315
7376
    if(context_count == 1) {
7354
7415
        h->current_slice = 0;
7355
7416
        if (!s->first_field)
7356
7417
            s->current_picture_ptr= NULL;
 
7418
        reset_sei(h);
7357
7419
    }
7358
7420
 
7359
7421
    for(;;){
7393
7455
 
7394
7456
        hx = h->thread_context[context_count];
7395
7457
 
7396
 
        ptr= decode_nal(hx, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
 
7458
        ptr= ff_h264_decode_nal(hx, buf + buf_index, &dst_length, &consumed, h->is_avc ? nalsize : buf_size - buf_index);
7397
7459
        if (ptr==NULL || dst_length < 0){
7398
7460
            return -1;
7399
7461
        }
7400
7462
        while(ptr[dst_length - 1] == 0 && dst_length > 0)
7401
7463
            dst_length--;
7402
 
        bit_length= !dst_length ? 0 : (8*dst_length - decode_rbsp_trailing(h, ptr + dst_length - 1));
 
7464
        bit_length= !dst_length ? 0 : (8*dst_length - ff_h264_decode_rbsp_trailing(h, ptr + dst_length - 1));
7403
7465
 
7404
7466
        if(s->avctx->debug&FF_DEBUG_STARTCODE){
7405
7467
            av_log(h->s.avctx, AV_LOG_DEBUG, "NAL %d at %d/%d length %d\n", hx->nal_unit_type, buf_index, buf_size, dst_length);
7406
7468
        }
7407
7469
 
7408
7470
        if (h->is_avc && (nalsize != consumed)){
7409
 
            av_log(h->s.avctx, AV_LOG_ERROR, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
 
7471
            int i, debug_level = AV_LOG_DEBUG;
 
7472
            for (i = consumed; i < nalsize; i++)
 
7473
                if (buf[buf_index+i])
 
7474
                    debug_level = AV_LOG_ERROR;
 
7475
            av_log(h->s.avctx, debug_level, "AVC: Consumed only %d bytes instead of %d\n", consumed, nalsize);
7410
7476
            consumed= nalsize;
7411
7477
        }
7412
7478
 
7434
7500
            if((err = decode_slice_header(hx, h)))
7435
7501
               break;
7436
7502
 
7437
 
            s->current_picture_ptr->key_frame|= (hx->nal_unit_type == NAL_IDR_SLICE);
 
7503
            if (s->avctx->hwaccel && h->current_slice == 1) {
 
7504
                if (s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
 
7505
                    return -1;
 
7506
            }
 
7507
 
 
7508
            s->current_picture_ptr->key_frame |=
 
7509
                    (hx->nal_unit_type == NAL_IDR_SLICE) ||
 
7510
                    (h->sei_recovery_frame_cnt >= 0);
7438
7511
            if(hx->redundant_pic_count==0 && hx->s.hurry_up < 5
7439
7512
               && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
7440
7513
               && (avctx->skip_frame < AVDISCARD_BIDIR  || hx->slice_type_nos!=FF_B_TYPE)
7441
7514
               && (avctx->skip_frame < AVDISCARD_NONKEY || hx->slice_type_nos==FF_I_TYPE)
7442
7515
               && avctx->skip_frame < AVDISCARD_ALL){
 
7516
                if(avctx->hwaccel) {
 
7517
                    if (avctx->hwaccel->decode_slice(avctx, &buf[buf_index - consumed], consumed) < 0)
 
7518
                        return -1;
 
7519
                }else
7443
7520
                if(CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU){
7444
7521
                    static const uint8_t start_code[] = {0x00, 0x00, 0x01};
7445
7522
                    ff_vdpau_add_data_chunk(s, start_code, sizeof(start_code));
7475
7552
            break;
7476
7553
        case NAL_SEI:
7477
7554
            init_get_bits(&s->gb, ptr, bit_length);
7478
 
            decode_sei(h);
 
7555
            ff_h264_decode_sei(h);
7479
7556
            break;
7480
7557
        case NAL_SPS:
7481
7558
            init_get_bits(&s->gb, ptr, bit_length);
7482
 
            decode_seq_parameter_set(h);
 
7559
            ff_h264_decode_seq_parameter_set(h);
7483
7560
 
7484
7561
            if(s->flags& CODEC_FLAG_LOW_DELAY)
7485
7562
                s->low_delay=1;
7490
7567
        case NAL_PPS:
7491
7568
            init_get_bits(&s->gb, ptr, bit_length);
7492
7569
 
7493
 
            decode_picture_parameter_set(h, bit_length);
 
7570
            ff_h264_decode_picture_parameter_set(h, bit_length);
7494
7571
 
7495
7572
            break;
7496
7573
        case NAL_AUD:
7652
7729
        h->prev_frame_num_offset= h->frame_num_offset;
7653
7730
        h->prev_frame_num= h->frame_num;
7654
7731
 
 
7732
        if (avctx->hwaccel) {
 
7733
            if (avctx->hwaccel->end_frame(avctx) < 0)
 
7734
                av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
 
7735
        }
 
7736
 
7655
7737
        if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
7656
7738
            ff_vdpau_h264_picture_complete(s);
7657
7739
 
7973
8055
            return -1;
7974
8056
        }
7975
8057
 
7976
 
        out= decode_nal(&h, nal, &out_length, &consumed, nal_length);
 
8058
        out= ff_h264_decode_nal(&h, nal, &out_length, &consumed, nal_length);
7977
8059
 
7978
8060
        STOP_TIMER("NAL")
7979
8061
 
8038
8120
    /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY,
8039
8121
    .flush= flush_dpb,
8040
8122
    .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
 
8123
    .pix_fmts= ff_hwaccel_pixfmt_list_420,
8041
8124
};
8042
8125
 
8043
8126
#if CONFIG_H264_VDPAU_DECODER