[x264-devel] How to speed ffmpeg-x264 encoder for better performance.

Sureshkumar M sureshmenon87 at gmail.com
Wed Mar 7 06:02:10 CET 2012


Hi,

I have ported ffmpeg-x264 with neon for android but the issue is
encoder takes more time to encode a single frame .It takes above 150ms
to encode and cpu rises to 85% in some devices like LG and
samsung.when both encode and decoder active device struggle to give a
good smooth output.It is working better in Samsung GTI9000 compared to
other devices such as HTC Desire,..etc.i am using the following ffmpeg
 avcodeccontext settings during ffmpeg initialization.

c->bit_rate = 256000;
c->width = width;
c->height = height;
c->gop_size = 2;
c->pix_fmt = PIX_FMT_YUV420P;
c->codec_type=AVMEDIA_TYPE_VIDEO;
c->codec_id=CODEC_ID_H264;
c->cqp=36;


Is there any other settings  available or  have to rebuild the x264
with any advanced configure options?

My x264 configure script
./configure --prefix='dist'  --cross-prefix=arm-linux-androideabi-
--enable-pic  --host=arm-linux

inside x264 configure script  i have  added additional flag to CC
-mfloat-abi=softfp   to support the instruction __asm__("vadd.i16 q0,
q0, q0");... yes  to make HAVE_NEON to 1 and also to avoid bad
instruction  pointing vadd.i16 q0, q0, q0 which makes HAVE_NEON  to 0
inside config.h


ffmpeg configure script
FFMPEG_CONFIGURATION=--enable-cross-compile --arch=armv7
--cpu=cortex-a8  --enable-asm --target-os=linux --disable-stripping
--enable-neon --enable-version3 --disable-shared --enable-static
--enable-gpl --enable-memalign-hack --cc=arm-linux-androideabi-gcc
--ld=arm-linux-androideabi-ld --extra-cflags='-fPIC -DANDROID
-D__thumb__ -mthumb -Wfatal-errors -Wno-deprecated'
--disable-everything --enable-decoder=h264 --enable-encoder=libx264
--enable-libx264 --enable-hwaccels --disable-ffmpeg --disable-ffplay
--disable-ffprobe --disable-ffserver --disable-network
--enable-filter=buffer --enable-filter=buffersink
--disable-demuxer=v4l --disable-demuxer=v4l2 --disable-indev=v4l
--disable-indev=v4l2 --extra-cflags=-I./../x264
--extra-ldflags=-L./../x264


Thanks,


More information about the x264-devel mailing list