[FFmpeg-devel] [PATCH] Make slicify honour the slice direction

Michael Niedermayer michaelni
Sun Dec 6 03:41:15 CET 2009


On Sat, Dec 05, 2009 at 02:23:38AM +0100, Stefano Sabatini wrote:
> On date Wednesday 2009-12-02 00:37:21 +0100, Stefano Sabatini encoded:
> > On date Tuesday 2009-12-01 12:44:10 +0100, Michael Niedermayer encoded:
> > > On Mon, Nov 30, 2009 at 11:41:26PM +0100, Stefano Sabatini wrote:
> > > > Hi, as in subject.
> > > > 
> > > > Without this some combination with the pad filter may issue weird
> > > > behavior.
> 
> Updated.
> 
> This fixes for example:
> 
> ffplay -loglevel debug in.avi -vfilters "scale=100:100, slicify=50, vflip, slicify=10, scale"
> [...]
> start_frame     : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] picref[0xa33aa10 data[0xa5e6f10, 0xa5e9ad0, 0xa5ea750, (nil)] linesize[112, 64, 64, 0] pts:566666 s:100x100]
> draw_slice      : link[0xa30ced0 s:464x348 fmt:yuv420p          ffplay_input    ->scale           ] y:0 h:348 dir:1
> draw_slice      : link[0xa332870 s:100x100 fmt:yuv420p          scale           ->slicify         ] y:0 h:100 dir:1
> draw_slice      : link[0xa333160 s:100x100 fmt:yuv420p          slicify         ->vflip           ] y:0 h:50 dir:1
> draw_slice      : link[0xa333480 s:100x100 fmt:yuv420p          vflip           ->slicify         ] y:50 h:50 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:50 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:100 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:60 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:100 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:70 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:100 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:80 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:100 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:90 h:10 dir:-1
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:90 h:10 dir:-1
> draw_slice      : link[0xa333160 s:100x100 fmt:yuv420p          slicify         ->vflip           ] y:50 h:50 dir:1
> draw_slice      : link[0xa333480 s:100x100 fmt:yuv420p          vflip           ->slicify         ] y:0 h:50 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:0 h:10 dir:-1
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:10 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:10 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:20 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:30 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:0 dir:-1
> draw_slice      : link[0xa333740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:40 h:10 dir:-1
> [swscaler @ 0xa37c760]Slices start in the middle!
> draw_slice      : link[0xa333830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:0 dir:-1
> 
> which becomes with the patch applied:
> start_frame     : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] picref[0x89fe740 data[0x8c5c1e0, 0x8c5eda0, 0x8c5fa20, (nil)] linesize[112, 64, 64, 0] pts:1533333 s:100x100]
> draw_slice      : link[0x8971ed0 s:464x348 fmt:yuv420p          ffplay_input    ->scale           ] y:0 h:348 dir:1
> draw_slice      : link[0x8997870 s:100x100 fmt:yuv420p          scale           ->slicify         ] y:0 h:100 dir:1
> draw_slice      : link[0x8998160 s:100x100 fmt:yuv420p          slicify         ->vflip           ] y:0 h:50 dir:1
> draw_slice      : link[0x8998480 s:100x100 fmt:yuv420p          vflip           ->slicify         ] y:50 h:50 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:90 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:90 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:80 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:80 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:70 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:70 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:60 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:60 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:50 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:50 h:10 dir:-1
> draw_slice      : link[0x8998160 s:100x100 fmt:yuv420p          slicify         ->vflip           ] y:50 h:50 dir:1
> draw_slice      : link[0x8998480 s:100x100 fmt:yuv420p          vflip           ->slicify         ] y:0 h:50 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:40 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:40 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:30 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:30 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:20 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:20 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:10 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:10 h:10 dir:-1
> draw_slice      : link[0x8998740 s:100x100 fmt:yuv420p          slicify         ->scale           ] y:0 h:10 dir:-1
> draw_slice      : link[0x8998830 s:100x100 fmt:yuv420p          scale           ->ffplay_output   ] y:0 h:10 dir:-1
> 
> Regards.
> -- 
> FFmpeg = Faithless Funny Magical Philosofic Enigmatic Governor

>  vf_slicify.c |   16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 46f182cf22315ee4cd11f0d7b04f0ecb2cdd286d  fix-slice-dir-for-slicify.patch
> Index: libavfilter-soc/ffmpeg/libavfilter/vf_slicify.c
> ===================================================================
> --- libavfilter-soc.orig/ffmpeg/libavfilter/vf_slicify.c	2009-12-05 02:18:08.000000000 +0100
> +++ libavfilter-soc/ffmpeg/libavfilter/vf_slicify.c	2009-12-05 02:18:52.000000000 +0100
> @@ -28,6 +28,7 @@
>  typedef struct {
>      int h;          ///< output slice height
>      int vshift;     ///< vertical chroma subsampling shift
> +    int slice_y;    ///< if the slice direction is bottom-up is the bottom y for the next slice
>  } SliceContext;
>  
>  static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)

i see no need for this variable
its also not needed for the other direction

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Avoid a single point of failure, be that a person or equipment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091206/299c8230/attachment.pgp>



More information about the ffmpeg-devel mailing list