[Ffmpeg-devel] h264 and slices...

Rich Felker dalias
Sun Sep 11 07:52:05 CEST 2005

On Sat, Sep 10, 2005 at 11:43:19PM -0400, Rich Felker wrote:
> i'd like to be able to play h264 video, but it's way too slow, and the
> main reason seems to be that slices (draw_horiz_band) aren't
> supported. is there a major obstacle to being able to enable slices?
> iirc at one point there was an issue about doing loop filter in a
> separate pass, but i'm disabling loop filter anyway. :)

ok i rtfs'd and apparently the useful slice rendering mode is working
if you just uncomment it. the problem is that broken apps like mplayer
seem to expect slices in display order (which is totally useless, it's
slower than non-sliced), and this mode is hopelessly broken due to
h264's crazy frame dependencies. :(

this could be "fixed" but it wouldn't help performance. the only way
to improve performance is to fix the underlying broken player
architecture that expects slices in nonsensical order.

> it also seems idct skipping doesn't work for h264... and it would be
> really nice if it could be skipped for b frames or nonref frames.. any
> recommendations on where to look to add it? :)

i added it in hl_decode_ml.. is the attached patch (somewhat) correct?


-------------- next part --------------
Index: libavcodec/h264.c
RCS file: /cvsroot/ffmpeg/ffmpeg/libavcodec/h264.c,v
retrieving revision 1.152
diff -u -r1.152 h264.c
--- libavcodec/h264.c	26 Aug 2005 19:05:43 -0000	1.152
+++ libavcodec/h264.c	11 Sep 2005 05:45:59 -0000
@@ -3371,6 +3371,10 @@
                       s->dsp.avg_h264_qpel_pixels_tab, s->dsp.avg_h264_chroma_pixels_tab,
                       s->dsp.weight_h264_pixels_tab, s->dsp.biweight_h264_pixels_tab);
+        if(   s->avctx->skip_idct >= AVDISCARD_ALL
+           ||(s->avctx->skip_idct >= AVDISCARD_NONKEY && h->slice_type != I_TYPE)
+           ||(s->avctx->skip_idct >= AVDISCARD_BIDIR  && h->slice_type == B_TYPE)
+           ||(s->avctx->skip_idct >= AVDISCARD_NONREF && h->nal_ref_idc == 0)) return;

More information about the ffmpeg-devel mailing list