diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-07-05 02:55:56 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-07-05 02:55:56 +0300 |
commit | 8ea134bd23022afbe1a06c0241c0c2c6ea2618f8 (patch) | |
tree | 9e9fcbd8af8e82dd189beebc7bd4ed1e52b1fd87 | |
parent | 7de350c673e1c0ae52d655e322a072f2f6b624b0 (diff) | |
parent | 6d14167f28b453a4410701cfeb87f7d9c18f869a (diff) | |
download | mpv-8ea134bd23022afbe1a06c0241c0c2c6ea2618f8.tar.bz2 mpv-8ea134bd23022afbe1a06c0241c0c2c6ea2618f8.tar.xz |
Merge svn changes up to r27202
-rw-r--r-- | DOCS/man/de/mplayer.1 | 6 | ||||
-rw-r--r-- | Makefile | 31 | ||||
-rw-r--r-- | libmpcodecs/ad_imaadpcm.c | 1 | ||||
-rw-r--r-- | libmpdemux/demux_mov.c | 4 | ||||
-rw-r--r-- | libswscale/internal_bfin.S | 89 | ||||
-rw-r--r-- | libswscale/rgb2rgb.c | 32 | ||||
-rw-r--r-- | libswscale/rgb2rgb.h | 44 | ||||
-rw-r--r-- | libswscale/rgb2rgb_template.c | 58 | ||||
-rw-r--r-- | libswscale/swscale_altivec_template.c | 16 | ||||
-rw-r--r-- | libswscale/swscale_bfin.c | 2 | ||||
-rw-r--r-- | libswscale/swscale_internal.h | 6 | ||||
-rw-r--r-- | libswscale/swscale_template.c | 41 | ||||
-rw-r--r-- | libswscale/yuv2rgb.c | 8 | ||||
-rw-r--r-- | libswscale/yuv2rgb_altivec.c | 125 | ||||
-rw-r--r-- | libswscale/yuv2rgb_bfin.c | 7 | ||||
-rw-r--r-- | libswscale/yuv2rgb_mlib.c | 3 | ||||
-rw-r--r-- | libswscale/yuv2rgb_template.c | 32 | ||||
-rw-r--r-- | libvo/vo_gl.c | 7 | ||||
-rw-r--r-- | stream/stream_dvd.c | 43 | ||||
-rw-r--r-- | stream/stream_live555.c (renamed from stream/stream_livedotcom.c) | 0 |
20 files changed, 286 insertions, 269 deletions
diff --git a/DOCS/man/de/mplayer.1 b/DOCS/man/de/mplayer.1 index 24003aa2b6..45515082d3 100644 --- a/DOCS/man/de/mplayer.1 +++ b/DOCS/man/de/mplayer.1 @@ -3,7 +3,7 @@ .\" Tobias Diedrich gepflegt. .\" Encoding: iso-8859-1 .\" -.\" In sync with r27169 +.\" In sync with r27182 . .\" -------------------------------------------------------------------------- .\" Makrodefinitionen @@ -916,7 +916,7 @@ Momentan funktionieren die folgenden Treiber mit \-fixed\-vo: gl, gl2, mga, svga, x11, xmga, xv, xvidix und dfbmga. . .TP -.B \-framedrop (siehe auch \-hardframedrop, experimentell ohne \-no\-correct\-pts) +.B \-framedrop (siehe auch \-hardframedrop, experimentell ohne \-nocorrect\-pts) Verwirft einige Frames, ohne sie anzuzeigen, um auf langsamen Systemen die A/\:V-Synchronisation beizubehalten. Videofilter werden auf diese Frames nicht angewendet. @@ -934,7 +934,7 @@ Funktioniert nicht als Option in einer Konfigurationsdatei. Zeigt eine kurze Zusammenfassung der Optionen an. . .TP -.B \-hardframedrop (experimentell ohne \-no\-correct\-pts) +.B \-hardframedrop (experimentell ohne \-nocorrect\-pts) Noch rabiateres Verwerfen von Frames (verhindert evtl. korrekte Decodierung). Führt zu Bildstörungen! @@ -434,7 +434,7 @@ SRCS_COMMON-$(SPEEX) += libmpcodecs/ad_speex.c SRCS_COMMON-$(STREAM_CACHE) += stream/cache2.c SRCS_COMMON-$(STREAMING_LIVE555) += libmpdemux/demux_rtp.cpp \ libmpdemux/demux_rtp_codec.cpp \ - stream/stream_livedotcom.c \ + stream/stream_live555.c \ SRCS_COMMON-$(TREMOR_INTERNAL) += tremor/bitwise.c \ tremor/block.c \ @@ -773,6 +773,8 @@ version.h: osdep/mplayer-rc.o: osdep/mplayer.rc version.h $(WINDRES) -I. $< $@ +%(EXESUF): %.c + ###### dependency declarations / specific CFLAGS ###### @@ -888,24 +890,25 @@ codecs2html$(EXESUF): codec-cfg.c $(TEST_OBJS) codec-cfg-test$(EXESUF): codec-cfg.c codecs.conf.h codec-cfg.h $(TEST_OBJS) $(CC) -I. -DTESTING -o $@ $^ -liba52/test$(EXESUF): liba52/test.c cpudetect.o $(filter liba52/%,$(SRCS_COMMON:.c=.o)) +liba52/test$(EXESUF): cpudetect.o $(filter liba52/%,$(SRCS_COMMON:.c=.o)) -lm -libvo/aspecttest$(EXESUF): libvo/aspecttest.c libvo/aspect.o libvo/geometry.o $(TEST_OBJS) +libvo/aspecttest$(EXESUF): libvo/aspect.o libvo/geometry.o $(TEST_OBJS) LOADER_TEST_OBJS = $(filter loader/%,$(SRCS_COMMON:.c=.o)) libmpdemux/aviprint.o osdep/mmap_anon.o cpudetect.o $(TEST_OBJS) loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): CFLAGS += -g -loader/qtx/list$(EXESUF): loader/qtx/list.c $(LOADER_TEST_OBJS) -loader/qtx/qtxload$(EXESUF): loader/qtx/qtxload.c $(LOADER_TEST_OBJS) +loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF): $(LOADER_TEST_OBJS) -mp3lib/test$(EXESUF): mp3lib/test.c $(filter mp3lib/%,$(SRCS_COMMON:.c=.o)) libvo/aclib.o cpudetect.o $(TEST_OBJS) -mp3lib/test2$(EXESUF): mp3lib/test2.c $(filter mp3lib/%,$(SRCS_COMMON:.c=.o)) libvo/aclib.o cpudetect.o $(TEST_OBJS) +mp3lib/test$(EXESUF) mp3lib/test2$(EXESUF): $(filter mp3lib/%,$(SRCS_COMMON:.c=.o)) libvo/aclib.o cpudetect.o $(TEST_OBJS) TESTS = codecs2html$(EXESUF) codec-cfg-test$(EXESUF) \ liba52/test$(EXESUF) libvo/aspecttest$(EXESUF) \ - loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF) \ mp3lib/test$(EXESUF) mp3lib/test2$(EXESUF) +ifdef ARCH_X86 +TESTS += loader/qtx/list$(EXESUF) loader/qtx/qtxload$(EXESUF) +endif + tests: $(TESTS) testsclean: @@ -936,20 +939,20 @@ alltools: $(ALLTOOLS) toolsclean: rm -f $(ALLTOOLS) TOOLS/fastmem*-* TOOLS/realcodecs/*.so.6.0 -TOOLS/bmovl-test$(EXESUF): TOOLS/bmovl-test.c -lSDL_image +TOOLS/bmovl-test$(EXESUF): -lSDL_image -TOOLS/subrip$(EXESUF): TOOLS/subrip.c vobsub.o spudec.o unrar_exec.o \ +TOOLS/subrip$(EXESUF): vobsub.o spudec.o unrar_exec.o \ libvo/aclib.o libswscale/libswscale.a libavutil/libavutil.a \ $(TEST_OBJS) -TOOLS/vfw2menc$(EXESUF): TOOLS/vfw2menc.c -lwinmm -lole32 +TOOLS/vfw2menc$(EXESUF): -lwinmm -lole32 mplayer-nomain.o: mplayer.c $(CC) $(CFLAGS) -DDISABLE_MAIN -c -o $@ $< -TOOLS/netstream$(EXESUF): TOOLS/netstream.c $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS) -TOOLS/vivodump$(EXESUF): TOOLS/vivodump.c $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS) -TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): +TOOLS/netstream$(EXESUF): TOOLS/netstream.c +TOOLS/vivodump$(EXESUF): TOOLS/vivodump.c +TOOLS/netstream$(EXESUF) TOOLS/vivodump$(EXESUF): $(subst mplayer.o,mplayer-nomain.o,$(OBJS_MPLAYER)) $(filter-out %mencoder.o,$(OBJS_MENCODER)) $(OBJS_COMMON) $(COMMON_LIBS) $(CC) $(CFLAGS) -o $@ $^ $(EXTRALIBS_MPLAYER) $(EXTRALIBS_MENCODER) $(COMMON_LDFLAGS) fastmemcpybench: TOOLS/fastmemcpybench.c diff --git a/libmpcodecs/ad_imaadpcm.c b/libmpcodecs/ad_imaadpcm.c index 01f9479d38..c2b7379db7 100644 --- a/libmpcodecs/ad_imaadpcm.c +++ b/libmpcodecs/ad_imaadpcm.c @@ -131,7 +131,6 @@ static void decode_nibbles(unsigned short *output, int predictor[2], int index[2]) { int step[2]; - int diff; int i; int sign; int delta; diff --git a/libmpdemux/demux_mov.c b/libmpdemux/demux_mov.c index 37de8b9558..be23ba479c 100644 --- a/libmpdemux/demux_mov.c +++ b/libmpdemux/demux_mov.c @@ -657,6 +657,10 @@ static int gen_sh_audio(sh_audio_t* sh, mov_track_t* trak, int timescale) { // 36 char[] atom data (len=size-8) // TODO: fix parsing for files using version 2. + if (trak->stdata_len < 26) { + mp_msg(MSGT_DEMUX, MSGL_WARN, "MOV: broken (too small) sound atom!\n"); + return 0; + } version=char2short(trak->stdata,8); if (version > 1) mp_msg(MSGT_DEMUX, MSGL_WARN, "MOV: version %d sound atom may not parse correctly!\n", version); diff --git a/libswscale/internal_bfin.S b/libswscale/internal_bfin.S index 2d5c61a14a..fb7bda7e12 100644 --- a/libswscale/internal_bfin.S +++ b/libswscale/internal_bfin.S @@ -2,8 +2,8 @@ * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com> * April 20, 2007 * - * Blackfin Video Color Space Converters Operations - * convert I420 YV12 to RGB in various formats, + * Blackfin video color space converter operations + * convert I420 YV12 to RGB in various formats * * This file is part of FFmpeg. * @@ -24,74 +24,73 @@ /* - YUV420 to RGB565 conversion. This routine takes a YUV 420 planar macroblock - and converts it to RGB565. R:5 bits, G:6 bits, B:5 bits.. packed into shorts +YUV420 to RGB565 conversion. This routine takes a YUV 420 planar macroblock +and converts it to RGB565. R:5 bits, G:6 bits, B:5 bits.. packed into shorts. - The following calculation is used for the conversion: +The following calculation is used for the conversion: - r = clipz((y-oy)*cy + crv*(v-128)) - g = clipz((y-oy)*cy + cgv*(v-128) + cgu*(u-128)) - b = clipz((y-oy)*cy + cbu*(u-128)) + r = clipz((y-oy)*cy + crv*(v-128)) + g = clipz((y-oy)*cy + cgv*(v-128) + cgu*(u-128)) + b = clipz((y-oy)*cy + cbu*(u-128)) - y,u,v are pre scaled by a factor of 4 i.e. left shifted to gain precision. +y,u,v are prescaled by a factor of 4 i.e. left-shifted to gain precision. - New factorization to eliminate the truncation error which was - occuring due to the byteop3p. +New factorization to eliminate the truncation error which was +occurring due to the byteop3p. - 1) use the bytop16m to subtract quad bytes we use this in U8 this - then so the offsets need to be renormalized to 8bits. +1) Use the bytop16m to subtract quad bytes we use this in U8 this + then so the offsets need to be renormalized to 8bits. - 2) scale operands up by a factor of 4 not 8 because Blackfin - multiplies include a shift. +2) Scale operands up by a factor of 4 not 8 because Blackfin + multiplies include a shift. - 3) compute into the accumulators cy*yx0, cy*yx1 +3) Compute into the accumulators cy*yx0, cy*yx1. - 4) compute each of the linear equations - r = clipz((y-oy)*cy + crv*(v-128)) +4) Compute each of the linear equations: + r = clipz((y - oy) * cy + crv * (v - 128)) - g = clipz((y-oy)*cy + cgv*(v-128) + cgu*(u-128)) + g = clipz((y - oy) * cy + cgv * (v - 128) + cgu * (u - 128)) - b = clipz((y-oy)*cy + cbu*(u-128)) + b = clipz((y - oy) * cy + cbu * (u - 128)) - reuse of the accumulators requires that we actually multiply - twice once with addition and the second time with a subtaction. + Reuse of the accumulators requires that we actually multiply + twice once with addition and the second time with a subtraction. - because of this we need to compute the equations in the order R B - then G saving the writes for B in the case of 24/32 bit color - formats. + Because of this we need to compute the equations in the order R B + then G saving the writes for B in the case of 24/32 bit color + formats. - api: yuv2rgb_kind (uint8_t *Y, uint8_t *U, uint8_t *V, int *out, - int dW, uint32_t *coeffs); + API: yuv2rgb_kind (uint8_t *Y, uint8_t *U, uint8_t *V, int *out, + int dW, uint32_t *coeffs); - A B - --- --- - i2 = cb i3 = cr - i1 = coeff i0 = y + A B + --- --- + i2 = cb i3 = cr + i1 = coeff i0 = y - Where coeffs have the following layout in memory. +Where coeffs have the following layout in memory. - uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv; +uint32_t oy,oc,zero,cy,crv,rmask,cbu,bmask,cgu,cgv; - coeffs is a pointer to oy. +coeffs is a pointer to oy. - the {rgb} masks are only utilized by the 565 packing algorithm. Note the data - replication is used to simplify the internal algorithms for the dual mac architecture - of BlackFin. +The {rgb} masks are only utilized by the 565 packing algorithm. Note the data +replication is used to simplify the internal algorithms for the dual Mac +architecture of BlackFin. - All routines are exported with _ff_bfin_ as a symbol prefix +All routines are exported with _ff_bfin_ as a symbol prefix. - rough performance gain compared against -O3: +Rough performance gain compared against -O3: - 2779809/1484290 187.28% - - which translates to ~33c/pel to ~57c/pel for the reference vs 17.5 - c/pel for the optimized implementations. Not sure why there is such a - huge variation on the reference codes on Blackfin I guess it must have - to do with the memory system. +2779809/1484290 187.28% +which translates to ~33c/pel to ~57c/pel for the reference vs 17.5 +c/pel for the optimized implementations. Not sure why there is such a +huge variation on the reference codes on Blackfin I guess it must have +to do with the memory system. */ #define mL3 .text diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c index ce0e0ee31a..14c40700ce 100644 --- a/libswscale/rgb2rgb.c +++ b/libswscale/rgb2rgb.c @@ -1,10 +1,10 @@ /* - * rgb2rgb.c, Software RGB to RGB convertor - * pluralize by Software PAL8 to RGB convertor - * Software YUV to YUV convertor - * Software YUV to RGB convertor - * Written by Nick Kurshev. - * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) + * software RGB to RGB converter + * pluralize by software PAL8 to RGB converter + * software YUV to YUV converter + * software YUV to RGB converter + * Written by Nick Kurshev. + * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) * * This file is part of FFmpeg. * @@ -22,8 +22,8 @@ * along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * the C code (not assembly, mmx, ...) of this file can be used - * under the LGPL license too + * The C code (not assembly, MMX, ...) of this file can be used + * under the LGPL license. */ #include <inttypes.h> #include "config.h" @@ -33,7 +33,7 @@ #include "swscale.h" #include "swscale_internal.h" -#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit +#define FAST_BGR2YV12 // use 7-bit instead of 15-bit coefficients void (*rgb24to32)(const uint8_t *src, uint8_t *dst, long src_size); void (*rgb24to16)(const uint8_t *src, uint8_t *dst, long src_size); @@ -149,8 +149,8 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={ #define RV ((int)( 0.439*(1<<RGB2YUV_SHIFT)+0.5)) #define RU ((int)(-0.148*(1<<RGB2YUV_SHIFT)+0.5)) -//Note: we have C, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one -//Plain C versions +//Note: We have C, MMX, MMX2, 3DNOW versions, there is no 3DNOW + MMX2 one. +//plain C versions #undef HAVE_MMX #undef HAVE_MMX2 #undef HAVE_3DNOW @@ -190,10 +190,10 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={ #endif //ARCH_X86 || ARCH_X86_64 /* - rgb15->rgb16 Original by Strepto/Astral + RGB15->RGB16 original by Strepto/Astral ported to gcc & bugfixed : A'rpi MMX2, 3DNOW optimization by Nick Kurshev - 32bit c version, and and&add trick by Michael Niedermayer + 32-bit C version, and and&add trick by Michael Niedermayer */ void sws_rgb2rgb_init(int flags){ @@ -266,7 +266,7 @@ void palette8torgb24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui { long i; /* - writes 1 byte o much and might cause alignment issues on some architectures? + Writes 1 byte too much and might cause alignment issues on some architectures? for (i=0; i<num_pixels; i++) ((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]]; */ @@ -284,7 +284,7 @@ void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui { long i; /* - writes 1 byte o much and might cause alignment issues on some architectures? + Writes 1 byte too much and might cause alignment issues on some architectures? for (i=0; i<num_pixels; i++) ((unsigned *)(&dst[i*3])) = ((unsigned *)palette)[src[i]]; */ @@ -299,7 +299,7 @@ void palette8tobgr24(const uint8_t *src, uint8_t *dst, long num_pixels, const ui } /** - * Palette is assumed to contain bgr16, see rgb32to16 to convert the palette + * Palette is assumed to contain BGR16, see rgb32to16 to convert the palette. */ void palette8torgb16(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette) { diff --git a/libswscale/rgb2rgb.h b/libswscale/rgb2rgb.h index 260732f731..f2697c65d6 100644 --- a/libswscale/rgb2rgb.h +++ b/libswscale/rgb2rgb.h @@ -1,8 +1,8 @@ /* - * rgb2rgb.h, Software RGB to RGB convertor - * pluralize by Software PAL8 to RGB convertor - * Software YUV to YUV convertor - * Software YUV to RGB convertor + * software RGB to RGB converter + * pluralize by Software PAL8 to RGB converter + * Software YUV to YUV converter + * Software YUV to RGB converter * Written by Nick Kurshev. * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) * @@ -28,7 +28,7 @@ #include <inttypes.h> -/* A full collection of rgb to rgb(bgr) convertors */ +/* A full collection of RGB to RGB(BGR) converters */ extern void (*rgb24to32) (const uint8_t *src, uint8_t *dst, long src_size); extern void (*rgb24to16) (const uint8_t *src, uint8_t *dst, long src_size); extern void (*rgb24to15) (const uint8_t *src, uint8_t *dst, long src_size); @@ -71,53 +71,49 @@ extern void palette8torgb15(const uint8_t *src, uint8_t *dst, long num_pixels, c extern void palette8tobgr15(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); /** - * - * height should be a multiple of 2 and width should be a multiple of 16 (if this is a - * problem for anyone then tell me, and ill fix it) - * chrominance data is only taken from every secound line others are ignored FIXME write HQ version + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + * Chrominance data is only taken from every second line, others are ignored. + * FIXME: Write HQ version. */ //void uyvytoyv12(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, /** - * - * height should be a multiple of 2 and width should be a multiple of 16 (if this is a - * problem for anyone then tell me, and ill fix it) + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) */ extern void (*yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, long lumStride, long chromStride, long dstStride); /** - * - * width should be a multiple of 16 + * Width should be a multiple of 16. */ extern void (*yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, long lumStride, long chromStride, long dstStride); /** - * - * height should be a multiple of 2 and width should be a multiple of 16 (if this is a - * problem for anyone then tell me, and ill fix it) + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) */ extern void (*yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, long width, long height, long lumStride, long chromStride, long srcStride); /** - * - * height should be a multiple of 2 and width should be a multiple of 16 (if this is a - * problem for anyone then tell me, and ill fix it) + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) */ extern void (*yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, long lumStride, long chromStride, long dstStride); /** - * - * height should be a multiple of 2 and width should be a multiple of 2 (if this is a - * problem for anyone then tell me, and ill fix it) - * chrominance data is only taken from every secound line others are ignored FIXME write HQ version + * Height should be a multiple of 2 and width should be a multiple of 2. + * (If this is a problem for anyone then tell me, and I will fix it.) + * Chrominance data is only taken from every second line, others are ignored. + * FIXME: Write HQ version. */ extern void (*rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, long width, long height, diff --git a/libswscale/rgb2rgb_template.c b/libswscale/rgb2rgb_template.c index 3fb04c9c91..ffbf2c734b 100644 --- a/libswscale/rgb2rgb_template.c +++ b/libswscale/rgb2rgb_template.c @@ -1,11 +1,11 @@ /* - * rgb2rgb.c, Software RGB to RGB convertor - * pluralize by Software PAL8 to RGB convertor - * Software YUV to YUV convertor - * Software YUV to RGB convertor - * Written by Nick Kurshev. - * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) - * lot of big-endian byteorder fixes by Alex Beregszaszi + * software RGB to RGB converter + * pluralize by software PAL8 to RGB converter + * software YUV to YUV converter + * software YUV to RGB converter + * Written by Nick Kurshev. + * palette & YUV & runtime CPU stuff by Michael (michaelni@gmx.at) + * lot of big-endian byte order fixes by Alex Beregszaszi * * This file is part of FFmpeg. * @@ -23,7 +23,7 @@ * along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * The C code (not assembly, mmx, ...) of this file can be used + * The C code (not assembly, MMX, ...) of this file can be used * under the LGPL license. */ @@ -229,10 +229,10 @@ static inline void RENAME(rgb32to24)(const uint8_t *src, uint8_t *dst, long src_ } /* - Original by Strepto/Astral - ported to gcc & bugfixed : A'rpi + original by Strepto/Astral + ported to gcc & bugfixed: A'rpi MMX2, 3DNOW optimization by Nick Kurshev - 32 bit C version, and and&add trick by Michael Niedermayer + 32-bit C version, and and&add trick by Michael Niedermayer */ static inline void RENAME(rgb15to16)(const uint8_t *src, uint8_t *dst, long src_size) { @@ -926,9 +926,9 @@ static inline void RENAME(rgb24tobgr15)(const uint8_t *src, uint8_t *dst, long s ---------------- 1 1 0 1 1 1 1 0 |=======| |===| - | Leftmost Bits Repeated to Fill Open Bits + | leftmost bits repeated to fill open bits | - Original Bits + original bits */ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_size) { @@ -1006,7 +1006,7 @@ static inline void RENAME(rgb15to24)(const uint8_t *src, uint8_t *dst, long src_ :"=m"(*d) :"m"(*s),"m"(mask15b),"m"(mask15g),"m"(mask15r), "m"(mmx_null) :"memory"); - /* Borrowed 32 to 24 */ + /* borrowed 32 to 24 */ asm volatile( "movq %%mm0, %%mm4 \n\t" "movq %%mm3, %%mm5 \n\t" @@ -1147,7 +1147,7 @@ static inline void RENAME(rgb16to24)(const uint8_t *src, uint8_t *dst, long src_ :"=m"(*d) :"m"(*s),"m"(mask16b),"m"(mask16g),"m"(mask16r),"m"(mmx_null) :"memory"); - /* Borrowed 32 to 24 */ + /* borrowed 32 to 24 */ asm volatile( "movq %%mm0, %%mm4 \n\t" "movq %%mm3, %%mm5 \n\t" @@ -1479,7 +1479,7 @@ static inline void RENAME(rgb24tobgr24)(const uint8_t *src, uint8_t *dst, long s asm volatile(SFENCE:::"memory"); asm volatile(EMMS:::"memory"); - if (mmx_size==23) return; //finihsed, was multiple of 8 + if (mmx_size==23) return; //finished, was multiple of 8 src+= src_size; dst+= src_size; @@ -1638,8 +1638,8 @@ asm( EMMS" \n\t" } /** - * Height should be a multiple of 2 and width should be a multiple of 16 (if - * this is a problem for anyone then tell me, and I will fix it). + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) */ static inline void RENAME(yv12toyuy2)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, @@ -1720,7 +1720,7 @@ static inline void RENAME(yuvPlanartouyvy)(const uint8_t *ysrc, const uint8_t *u (vc[0] << 8) + (yc[1] << 0); #else *idst++ = uc[0] + (yc[0] << 8) + - (vc[0] << 16) + (yc[1] << 24); + (vc[0] << 16) + (yc[1] << 24); #endif yc += 2; uc++; @@ -1744,8 +1744,8 @@ asm( EMMS" \n\t" } /** - * Height should be a multiple of 2 and width should be a multiple of 16 (if - * this is a problem for anyone then tell me, and I will fix it). + * Height should be a multiple of 2 and width should be a multiple of 16 + * (If this is a problem for anyone then tell me, and I will fix it.) */ static inline void RENAME(yv12touyvy)(const uint8_t *ysrc, const uint8_t *usrc, const uint8_t *vsrc, uint8_t *dst, long width, long height, @@ -1766,8 +1766,8 @@ static inline void RENAME(yuv422ptoyuy2)(const uint8_t *ysrc, const uint8_t *usr } /** - * Height should be a multiple of 2 and width should be a multiple of 16 (if - * this is a problem for anyone then tell me, and I will fix it). + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) */ static inline void RENAME(yuy2toyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, long width, long height, @@ -2002,9 +2002,9 @@ asm volatile( EMMS" \n\t" } /** - * Height should be a multiple of 2 and width should be a multiple of 16 (if - * this is a problem for anyone then tell me, and I will fix it). - * Chrominance data is only taken from every secound line, others are ignored. + * Height should be a multiple of 2 and width should be a multiple of 16. + * (If this is a problem for anyone then tell me, and I will fix it.) + * Chrominance data is only taken from every second line, others are ignored. * FIXME: Write HQ version. */ static inline void RENAME(uyvytoyv12)(const uint8_t *src, uint8_t *ydst, uint8_t *udst, uint8_t *vdst, @@ -2128,9 +2128,9 @@ asm volatile( EMMS" \n\t" } /** - * Height should be a multiple of 2 and width should be a multiple of 2 (if - * this is a problem for anyone then tell me, and I will fix it). - * Chrominance data is only taken from every secound line, + * Height should be a multiple of 2 and width should be a multiple of 2. + * (If this is a problem for anyone then tell me, and I will fix it.) + * Chrominance data is only taken from every second line, * others are ignored in the C version. * FIXME: Write HQ version. */ diff --git a/libswscale/swscale_altivec_template.c b/libswscale/swscale_altivec_template.c index 47b7e0dc6e..2111cec410 100644 --- a/libswscale/swscale_altivec_template.c +++ b/libswscale/swscale_altivec_template.c @@ -245,12 +245,12 @@ static inline void hScale_altivec_real(int16_t *dst, int dstW, uint8_t *src, int src_v = vec_mergeh(src_v, (vector signed short)vzero); filter_v = vec_ld(i << 3, filter); - // the 3 above is 2 (filterSize == 4) + 1 (sizeof(short) == 2) + // The 3 above is 2 (filterSize == 4) + 1 (sizeof(short) == 2). - // the neat trick : we only care for half the elements, + // The neat trick: We only care for half the elements, // high or low depending on (i<<3)%16 (it's 0 or 8 here), - // and we're going to use vec_mule, so we chose - // carefully how to "unpack" the elements into the even slots + // and we're going to use vec_mule, so we choose + // carefully how to "unpack" the elements into the even slots. if ((i << 3) % 16) filter_v = vec_mergel(filter_v, (vector signed short)vzero); else @@ -405,12 +405,12 @@ static inline int yv12toyuy2_unscaled_altivec(SwsContext *c, uint8_t* src[], int return srcSliceH; } - /* this code assume: + /* This code assumes: 1) dst is 16 bytes-aligned 2) dstStride is a multiple of 16 3) width is a multiple of 16 - 4) lum&chrom stride are multiple of 8 + 4) lum & chrom stride are multiples of 8 */ for (y=0; y<height; y++) { @@ -482,12 +482,12 @@ static inline int yv12touyvy_unscaled_altivec(SwsContext *c, uint8_t* src[], int return srcSliceH; } - /* this code assume: + /* This code assumes: 1) dst is 16 bytes-aligned 2) dstStride is a multiple of 16 3) width is a multiple of 16 - 4) lum&chrom stride are multiple of 8 + 4) lum & chrom stride are multiples of 8 */ for (y=0; y<height; y++) { diff --git a/libswscale/swscale_bfin.c b/libswscale/swscale_bfin.c index bbc304dfe3..3e63bbd638 100644 --- a/libswscale/swscale_bfin.c +++ b/libswscale/swscale_bfin.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2007 Marc Hoffman <marc.hoffman@analog.com> * - * Blackfin Software Video SCALER Operations + * Blackfin software video scaler operations * * This file is part of FFmpeg. * diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index d8dc974ac1..45cf738973 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -37,7 +37,7 @@ typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t* dst[], int dstStride[]); -/* this struct should be aligned on at least 32-byte boundary */ +/* This struct should be aligned on at least a 32-byte boundary. */ typedef struct SwsContext{ /** * info on struct for av_log @@ -73,7 +73,7 @@ typedef struct SwsContext{ int16_t *vChrFilter; int16_t *vChrFilterPos; - uint8_t formatConvBuffer[VOF]; //FIXME dynamic alloc, but we have to change a lot of code for this to be useful + uint8_t formatConvBuffer[VOF]; //FIXME dynamic allocation, but we have to change a lot of code for this to be useful int hLumFilterSize; int hChrFilterSize; @@ -122,7 +122,7 @@ typedef struct SwsContext{ #define V_OFFSET "10*8" #define LUM_MMX_FILTER_OFFSET "11*8" #define CHR_MMX_FILTER_OFFSET "11*8+4*4*256" -#define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the asm +#define DSTW_OFFSET "11*8+4*4*256*2" //do not change, it is hardcoded in the ASM #define ESP_OFFSET "11*8+4*4*256*2+8" #define VROUNDER_OFFSET "11*8+4*4*256*2+16" #define U_TEMP "11*8+4*4*256*2+24" diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c index f76c5948c5..56c91c14da 100644 --- a/libswscale/swscale_template.c +++ b/libswscale/swscale_template.c @@ -17,8 +17,8 @@ * along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * the C code (not assembly, mmx, ...) of this file can be used - * under the LGPL license too + * The C code (not assembly, MMX, ...) of this file can be used + * under the LGPL license. */ #undef REAL_MOVNTQ @@ -30,7 +30,7 @@ #undef SFENCE #ifdef HAVE_3DNOW -/* On K6 femms is faster of emms. On K7 femms is directly mapped on emms. */ +/* On K6 femms is faster than emms. On K7 femms is directly mapped on emms. */ #define EMMS "femms" #else #define EMMS "emms" @@ -1503,7 +1503,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * const int yalpha1=0; int i; - uint16_t *buf1= buf0; //FIXME needed for the rgb1/bgr1 + uint16_t *buf1= buf0; //FIXME needed for RGB1/BGR1 const int yalpha= 4096; //FIXME ... if (flags&SWS_FULL_CHR_H_INT) @@ -1700,7 +1700,7 @@ static inline void RENAME(yuv2packed1)(SwsContext *c, uint16_t *buf0, uint16_t * |