In the loop:
for (i=0; i<dstH; i++) {
int chrI= i*c->chrDstH / dstH;
when i*c->chrDstH > INT_MAX this leads to an integer overflow, which
results in a negative value for chrI and in out-of-buffer reads. The
overflow is avoided by forcing int64_t arithmetic by casting i to
int64_t.
Fix crash, and trac issue #72.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
PPC and x86 code is split off from swscale_template.c. Lots of code is
still duplicated and should be removed later.
Again uniformize the init system to be more similar to the dsputil one.
Unset h*scale_fast in the x86 init in order to make the output
consistent with the previous status. Thanks to Josh for spotting it.
Keep only the plain C code in the main rgb2rgb.c and move the x86
specific optimizations to x86/rgb2rgb.c
Change the initialization pattern a little so some of it can be
factorized to behave more like dsputils.
When HAVE_7REGS was not defined these functions had an empty body
causing the following warnings during compilation.
In file included from libswscale/x86/yuv2rgb_mmx.c:58:
libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_rgb32_MMX’:
libswscale/x86/yuv2rgb_template.c:412: warning: no return statement in function returning non-void
libswscale/x86/yuv2rgb_template.c: In function ‘yuva420_bgr32_MMX’:
libswscale/x86/yuv2rgb_template.c:457: warning: no return statement in function returning non-void
Signed-off-by: Diego Biurrun <diego@biurrun.de>
swscale doesnt ever actually do any runtime detection at all when
runtime cpu detection is enabled, it simply passes whatever is passed
to -sws_flags, which could be nothing at all making swscale default to
the C implementation.
Heres a benchmark
VOFW 5120 VOFW 21504 Note
10438.8 10344.2 timex ffmpeg -y -i tulip2.mp4 tulip2.yuv
25611.9 24256.9 timex ffmpeg -y -itulip2.mp4 -s 1272x724 tulip2.yuv
24485.7 26006.6
28573.1 24291.3
24069.1 26995.9
25684.95 25387.675 average
This is on a Nehalem i7. Despite being a 500 frame, 720p video, the numbers
fluctuate, so I took an average of 4 runs.
Another reason I'd like this change is youtube accepts videos with higher
resolutions than 5120.
16384 is vp8's maximum resolution, so that should keep us amused for a
little longer.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
It is pretty hopeless that other considerable projects will adopt
libavutil alone in other projects. Projects that need small footprint
are better off with more specialized libraries such as gnulib or rather
just copy the necessary parts that they need. With this in mind, nobody
is helped by having libavutil and libavcore split. In order to ease
maintenance inside and around FFmpeg and to reduce confusion where to
put common code, avcore's functionality is merged (back) to avutil.
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
When built with gcc 4.6, the MMX rgb24 to yuv conversion gives
wrong output. The compiler produces this warning:
libswscale/swscale_template.c:1885:5: warning: use of memory input without lvalue in asm operand 4 is deprecated
Changing the memory operand to a register makes it work.
Signed-off-by: Mans Rullgard <mans@mansr.com>
(cherry picked from commit f344903ca5)
When built with gcc 4.6, the MMX rgb24 to yuv conversion gives
wrong output. The compiler produces this warning:
libswscale/swscale_template.c:1885:5: warning: use of memory input without lvalue in asm operand 4 is deprecated
Changing the memory operand to a register makes it work.
Signed-off-by: Mans Rullgard <mans@mansr.com>
rgb32tobgr32() has been removed in favour of shuffle_bytes_2103() in r32190
Originally committed as revision 32676 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
handle_jpeg may update the src/dstFormat variables, this makes sure the
updated version is stored in the context.
This fixes roundup issue 2302.
Patch by Troot, all_crap_goes_here at hotmail
Originally committed as revision 32562 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
but worse it did not set up destination dimensions, thus every user
of it would necessarily fail.
Originally committed as revision 32424 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
scale context. Prevent pointless warnings when using
av_opt_set_defaults() for setting the default values, as in a pending
patch.
Originally committed as revision 32413 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale