Mercurial > libavcodec.hg
comparison vdpau.c @ 11555:e603f624b03f libavcodec
Set VDPAU H264 picture parameter field_order_cnt and frame_num at the
start of decoding a picture instead of at the end.
Fixes mmco01.264
Patch by Stephen Warren
author | cehoyos |
---|---|
date | Tue, 30 Mar 2010 08:10:29 +0000 |
parents | 30f5bf824f04 |
children |
comparison
equal
deleted
inserted
replaced
11554:30f5bf824f04 | 11555:e603f624b03f |
---|---|
125 render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf; | 125 render->bitstream_buffers[render->bitstream_buffers_used].bitstream = buf; |
126 render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size; | 126 render->bitstream_buffers[render->bitstream_buffers_used].bitstream_bytes = buf_size; |
127 render->bitstream_buffers_used++; | 127 render->bitstream_buffers_used++; |
128 } | 128 } |
129 | 129 |
130 void ff_vdpau_h264_picture_complete(MpegEncContext *s) | 130 void ff_vdpau_h264_picture_start(MpegEncContext *s) |
131 { | 131 { |
132 H264Context *h = s->avctx->priv_data; | 132 H264Context *h = s->avctx->priv_data; |
133 struct vdpau_render_state *render; | 133 struct vdpau_render_state *render; |
134 int i; | 134 int i; |
135 | 135 |
136 render = (struct vdpau_render_state *)s->current_picture_ptr->data[0]; | 136 render = (struct vdpau_render_state *)s->current_picture_ptr->data[0]; |
137 assert(render); | 137 assert(render); |
138 | |
139 render->info.h264.slice_count = h->slice_num; | |
140 if (render->info.h264.slice_count < 1) | |
141 return; | |
142 | 138 |
143 for (i = 0; i < 2; ++i) { | 139 for (i = 0; i < 2; ++i) { |
144 int foc = s->current_picture_ptr->field_poc[i]; | 140 int foc = s->current_picture_ptr->field_poc[i]; |
145 if (foc == INT_MAX) | 141 if (foc == INT_MAX) |
146 foc = 0; | 142 foc = 0; |
147 render->info.h264.field_order_cnt[i] = foc; | 143 render->info.h264.field_order_cnt[i] = foc; |
148 } | 144 } |
149 | 145 |
146 render->info.h264.frame_num = h->frame_num; | |
147 } | |
148 | |
149 void ff_vdpau_h264_picture_complete(MpegEncContext *s) | |
150 { | |
151 H264Context *h = s->avctx->priv_data; | |
152 struct vdpau_render_state *render; | |
153 | |
154 render = (struct vdpau_render_state *)s->current_picture_ptr->data[0]; | |
155 assert(render); | |
156 | |
157 render->info.h264.slice_count = h->slice_num; | |
158 if (render->info.h264.slice_count < 1) | |
159 return; | |
160 | |
150 render->info.h264.is_reference = (s->current_picture_ptr->reference & 3) ? VDP_TRUE : VDP_FALSE; | 161 render->info.h264.is_reference = (s->current_picture_ptr->reference & 3) ? VDP_TRUE : VDP_FALSE; |
151 render->info.h264.frame_num = h->frame_num; | |
152 render->info.h264.field_pic_flag = s->picture_structure != PICT_FRAME; | 162 render->info.h264.field_pic_flag = s->picture_structure != PICT_FRAME; |
153 render->info.h264.bottom_field_flag = s->picture_structure == PICT_BOTTOM_FIELD; | 163 render->info.h264.bottom_field_flag = s->picture_structure == PICT_BOTTOM_FIELD; |
154 render->info.h264.num_ref_frames = h->sps.ref_frame_count; | 164 render->info.h264.num_ref_frames = h->sps.ref_frame_count; |
155 render->info.h264.mb_adaptive_frame_field_flag = h->sps.mb_aff && !render->info.h264.field_pic_flag; | 165 render->info.h264.mb_adaptive_frame_field_flag = h->sps.mb_aff && !render->info.h264.field_pic_flag; |
156 render->info.h264.constrained_intra_pred_flag = h->pps.constrained_intra_pred; | 166 render->info.h264.constrained_intra_pred_flag = h->pps.constrained_intra_pred; |