[FFmpeg-devel] [GSOC][PATCH 1/4] factoring obmc out of snow

Michael Niedermayer michael at niedermayer.cc
Wed Aug 17 21:05:45 EEST 2016


On Wed, Aug 17, 2016 at 07:50:22PM +0200, Michael Niedermayer wrote:
> On Wed, Aug 17, 2016 at 02:07:20PM +0300, Станислав Долганов wrote:
> > Hello,
> > 
> > I'm sending the patch set with implementation of GSoC project -- FFV1 P
> > frame support. The current FFV1 uses the same OBMC code as the Snow codec.
> > Also new median_me_mp function has appeared.
> > 
> > I'm attaching speed&compression report to every patch to proof effectivity
> > of each implemented part.
> > 
> > I'll appreciate feedback
> > 
> > Best regards,
> > Stanislav
> 
> >  b/libavcodec/Makefile      |    8 
> >  b/libavcodec/obmc.c        |   59 +
> >  b/libavcodec/obmc.h        |   30 
> >  b/libavcodec/obme.c        | 1133 ++++++++++++++++++++++++++++++++++++
> >  b/libavcodec/obme.h        |   33 +
> >  b/libavcodec/obmemc.c      |  650 ++++++++++++++++++++
> >  b/libavcodec/obmemc.h      |  522 ++++++++++++++++
> >  b/libavcodec/obmemc_data.h |  132 ++++
> >  b/libavcodec/snow.c        |  571 ------------------
> >  b/libavcodec/snow.h        |  341 ----------
> >  b/libavcodec/snowdec.c     |  217 +-----
> >  b/libavcodec/snowenc.c     | 1411 +++++++--------------------------------------
> >  libavcodec/snowdata.h      |  132 ----
> >  13 files changed, 2890 insertions(+), 2349 deletions(-)
> > 302bd7a57b192a32abc855abc11a86b5b347ceea  0001-factoring-obmc-out-of-snow.patch
> > From 6e16cf2f222a3989db71742511a6cc3250a41980 Mon Sep 17 00:00:00 2001
> > From: Stanislav Dolganov <dolganov at qst.hk>
> > Date: Tue, 16 Aug 2016 15:14:32 +0300
> > Subject: [PATCH 1/4] factoring obmc out of snow
> 
> this causes some crashes with invalid input files, like:
> 
> for example:
> [snow @ 0x10c7b420] pixel format changed
> ==17523== Invalid read of size 1
> ==17523==    at 0xEA57A3: mc_block (obmemc.c:209)
> ==17523==    by 0xEA624D: ff_obmc_pred_block (obmemc.c:304)
> ==17523==    by 0xAA34FF: add_yblock (obmemc.h:283)
> ==17523==    by 0xAA41C5: predict_slice_buffered (obmemc.h:438)
> ==17523==    by 0xAA73B1: decode_frame (snowdec.c:490)
> ==17523==    by 0xAF1EA2: avcodec_decode_video2 (utils.c:2223)
> ==17523==    by 0x431548: decode_video (ffmpeg.c:2087)
> ==17523==    by 0x4326AF: process_input_packet (ffmpeg.c:2340)
> ==17523==    by 0x439A9B: process_input (ffmpeg.c:4016)
> ==17523==    by 0x439DA7: transcode_step (ffmpeg.c:4104)
> ==17523==    by 0x439EEE: transcode (ffmpeg.c:4158)
> ==17523==    by 0x43A61F: main (ffmpeg.c:4353)
> ==17523==  Address 0x17d326ef is 0 bytes after a block of size 1,071 alloc'd
> ==17523==    at 0x4C2A6C5: memalign (vg_replace_malloc.c:727)
> ==17523==    by 0x4C2A760: posix_memalign (vg_replace_malloc.c:876)
> ==17523==    by 0x1034A6F: av_malloc (mem.c:97)
> ==17523==    by 0x10224FB: av_buffer_alloc (buffer.c:71)
> ==17523==    by 0x1022560: av_buffer_allocz (buffer.c:84)
> ==17523==    by 0x1022C76: pool_alloc_buffer (buffer.c:353)
> ==17523==    by 0x1022DA4: av_buffer_pool_get (buffer.c:418)
> ==17523==    by 0xAED00D: video_get_buffer (utils.c:677)
> ==17523==    by 0xAED34A: avcodec_default_get_buffer2 (utils.c:732)
> ==17523==    by 0x433259: get_buffer (ffmpeg.c:2533)
> ==17523==    by 0xAEDB78: get_buffer_internal (utils.c:915)
> ==17523==    by 0xAEDBFA: ff_get_buffer (utils.c:930)
> ==17523==    by 0xEA65E7: ff_obmc_get_buffer (obmemc.c:335)
> ==17523==    by 0xEA759A: ff_obmc_frame_start (obmemc.c:519)
> ==17523==    by 0xE9D1E4: ff_obmc_predecode_frame (obmc.c:47)
> ==17523==    by 0xAA6B50: decode_frame (snowdec.c:391)
> ==17523==    by 0xAF1EA2: avcodec_decode_video2 (utils.c:2223)
> ==17523==    by 0x431548: decode_video (ffmpeg.c:2087)
> ==17523==    by 0x4326AF: process_input_packet (ffmpeg.c:2340)
> ==17523==    by 0x439A9B: process_input (ffmpeg.c:4016)

heres how to reproduce some crash:

zzuf -c -s0:  -r0.01 ./ffmpeg -i snow-chroma-bug.avi -f null -
crashes within seconds
like:
zzuf[s=48,r=0.01]: signal 11 (SIGSEGV)

original sample from: https://samples.mplayerhq.hu/V-codecs/SNOW/

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20160817/3a304c71/attachment.sig>


More information about the ffmpeg-devel mailing list