comparison mpeg12.c @ 9063:390f5a9721d2 libavcodec

Remove superfluous call to mpeg_decode_slice() for hwaccel, this function already contains the needed code. Patch by Gwenole Beauchesne.
author benoit
date Fri, 27 Feb 2009 08:20:45 +0000
parents 3c5920f57063
children 4557a8635262
comparison
equal deleted inserted replaced
9062:2767eb8c227d 9063:390f5a9721d2
1214 return PIX_FMT_VDPAU_MPEG1; 1214 return PIX_FMT_VDPAU_MPEG1;
1215 else 1215 else
1216 return PIX_FMT_VDPAU_MPEG2; 1216 return PIX_FMT_VDPAU_MPEG2;
1217 }else{ 1217 }else{
1218 if(s->chroma_format < 2) 1218 if(s->chroma_format < 2)
1219 return avctx->get_format(avctx,ff_pixfmt_list_420); 1219 return avctx->get_format(avctx,ff_hwaccel_pixfmt_list_420);
1220 else if(s->chroma_format == 2) 1220 else if(s->chroma_format == 2)
1221 return PIX_FMT_YUV422P; 1221 return PIX_FMT_YUV422P;
1222 else 1222 else
1223 return PIX_FMT_YUV444P; 1223 return PIX_FMT_YUV444P;
1224 } 1224 }
1702 skip_bits(&s->gb, 8); 1702 skip_bits(&s->gb, 8);
1703 } 1703 }
1704 1704
1705 s->mb_x=0; 1705 s->mb_x=0;
1706 1706
1707 if (avctx->hwaccel) {
1708 const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
1709 int start_code = -1;
1710 buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
1711 if (buf_end < *buf + buf_size)
1712 buf_end -= 4;
1713 s->mb_y = mb_y;
1714 if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
1715 return DECODE_SLICE_ERROR;
1716 *buf = buf_end;
1717 return DECODE_SLICE_OK;
1718 }
1719
1707 for(;;) { 1720 for(;;) {
1708 int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2); 1721 int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
1709 if (code < 0){ 1722 if (code < 0){
1710 av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n"); 1723 av_log(s->avctx, AV_LOG_ERROR, "first mb_incr damaged\n");
1711 return -1; 1724 return -1;
1919 Mpeg1Context *s1 = avctx->priv_data; 1932 Mpeg1Context *s1 = avctx->priv_data;
1920 MpegEncContext *s = &s1->mpeg_enc_ctx; 1933 MpegEncContext *s = &s1->mpeg_enc_ctx;
1921 1934
1922 if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr) 1935 if (!s1->mpeg_enc_ctx_allocated || !s->current_picture_ptr)
1923 return 0; 1936 return 0;
1937
1938 if (s->avctx->hwaccel) {
1939 if (s->avctx->hwaccel->end_frame(s->avctx) < 0)
1940 av_log(avctx, AV_LOG_ERROR, "hardware accelerator failed to decode picture\n");
1941 }
1924 1942
1925 if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) 1943 if(CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration)
1926 ff_xvmc_field_end(s); 1944 ff_xvmc_field_end(s);
1927 1945
1928 /* end of slice reached */ 1946 /* end of slice reached */