comparison h264.c @ 9066:77cbbce1be94 libavcodec

Add hardware acceleration hooks to H.264. Patch by Gwenol«± Beauchesne.
author benoit
date Fri, 27 Feb 2009 15:45:55 +0000
parents 3dbe483ce6c4
children 8a74ab19d224
comparison
equal deleted inserted replaced
9065:3dbe483ce6c4 9066:77cbbce1be94
7489 hx->s.data_partitioning = 0; 7489 hx->s.data_partitioning = 0;
7490 7490
7491 if((err = decode_slice_header(hx, h))) 7491 if((err = decode_slice_header(hx, h)))
7492 break; 7492 break;
7493 7493
7494 if (s->avctx->hwaccel && h->current_slice == 1) {
7495 if (s->avctx->hwaccel->start_frame(s->avctx, NULL, 0) < 0)
7496 return -1;
7497 }
7498
7494 s->current_picture_ptr->key_frame |= 7499 s->current_picture_ptr->key_frame |=
7495 (hx->nal_unit_type == NAL_IDR_SLICE) || 7500 (hx->nal_unit_type == NAL_IDR_SLICE) ||
7496 (h->sei_recovery_frame_cnt >= 0); 7501 (h->sei_recovery_frame_cnt >= 0);
7497 if(hx->redundant_pic_count==0 && hx->s.hurry_up < 5 7502 if(hx->redundant_pic_count==0 && hx->s.hurry_up < 5
7498 && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc) 7503 && (avctx->skip_frame < AVDISCARD_NONREF || hx->nal_ref_idc)
7712 h->prev_poc_msb= h->poc_msb; 7717 h->prev_poc_msb= h->poc_msb;
7713 h->prev_poc_lsb= h->poc_lsb; 7718 h->prev_poc_lsb= h->poc_lsb;
7714 } 7719 }
7715 h->prev_frame_num_offset= h->frame_num_offset; 7720 h->prev_frame_num_offset= h->frame_num_offset;
7716 h->prev_frame_num= h->frame_num; 7721 h->prev_frame_num= h->frame_num;
7722
7723 if (avctx->hwaccel) {
7724 if (avctx->hwaccel->end_frame(avctx) < 0)
7725 av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
7726 }
7717 7727
7718 if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) 7728 if (CONFIG_H264_VDPAU_DECODER && s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)
7719 ff_vdpau_h264_picture_complete(s); 7729 ff_vdpau_h264_picture_complete(s);
7720 7730
7721 /* 7731 /*
8103 decode_end, 8113 decode_end,
8104 decode_frame, 8114 decode_frame,
8105 /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY, 8115 /*CODEC_CAP_DRAW_HORIZ_BAND |*/ CODEC_CAP_DR1 | CODEC_CAP_DELAY,
8106 .flush= flush_dpb, 8116 .flush= flush_dpb,
8107 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"), 8117 .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10"),
8108 .pix_fmts= ff_pixfmt_list_420, 8118 .pix_fmts= ff_hwaccel_pixfmt_list_420,
8109 }; 8119 };
8110 8120
8111 #if CONFIG_H264_VDPAU_DECODER 8121 #if CONFIG_H264_VDPAU_DECODER
8112 AVCodec h264_vdpau_decoder = { 8122 AVCodec h264_vdpau_decoder = {
8113 "h264_vdpau", 8123 "h264_vdpau",