comparison h263dec.c @ 9064:ca19176df986 libavcodec

Add HW acceleration hooks for MPEG-4 / H.263 decoding. Patch by Gwenole Beauchesne.
author benoit
date Fri, 27 Feb 2009 08:27:50 +0000
parents bcf716c58be4
children 80f632c55670
comparison
equal deleted inserted replaced
9063:390f5a9721d2 9064:ca19176df986
159 s->resync_mb_x= s->mb_x; 159 s->resync_mb_x= s->mb_x;
160 s->resync_mb_y= s->mb_y; 160 s->resync_mb_y= s->mb_y;
161 161
162 ff_set_qscale(s, s->qscale); 162 ff_set_qscale(s, s->qscale);
163 163
164 if (s->avctx->hwaccel) 164 if (s->avctx->hwaccel) {
165 return 0; 165 const uint8_t *start= s->gb.buffer + get_bits_count(&s->gb)/8;
166 const uint8_t *end = ff_h263_find_resync_marker(start + 1, s->gb.buffer_end);
167 skip_bits_long(&s->gb, 8*(end - start));
168 return s->avctx->hwaccel->decode_slice(s->avctx, start, end - start);
169 }
166 170
167 if(s->partitioned_frame){ 171 if(s->partitioned_frame){
168 const int qscale= s->qscale; 172 const int qscale= s->qscale;
169 173
170 if(s->codec_id==CODEC_ID_MPEG4){ 174 if(s->codec_id==CODEC_ID_MPEG4){
614 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab; 618 s->me.qpel_avg= s->dsp.avg_qpel_pixels_tab;
615 } 619 }
616 620
617 if(MPV_frame_start(s, avctx) < 0) 621 if(MPV_frame_start(s, avctx) < 0)
618 return -1; 622 return -1;
623
624 if (avctx->hwaccel) {
625 if (avctx->hwaccel->start_frame(avctx, buf, buf_size) < 0)
626 return -1;
627 }
619 628
620 #ifdef DEBUG 629 #ifdef DEBUG
621 av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale); 630 av_log(avctx, AV_LOG_DEBUG, "qscale=%d\n", s->qscale);
622 #endif 631 #endif
623 632