[FFmpeg-devel] [PATCH] AAC encoder: refactor to resynchronize MIPS port

Claudio Freire klaussfreire at gmail.com
Tue Sep 15 09:24:02 CEST 2015

This patch refactors the AAC coders to reuse code
between the MIPS port and the regular, portable C code.
There were two main functions that had to use
hand-optimized versions of quantization code:
 - search_for_quantizers_twoloop
 - codebook_trellis_rate

Those two were split into their own template header
files so they can be inlined inside both the MIPS port
and the generic code. In each context, they'll link
to their specialized implementations, and thus be
optimized by the compiler.

This approach I believe is better than maintaining
several copies of each function. As past experience has
proven, having to keep those in sync was error prone.
In this way, they will remain in sync by default.

Also, an implementation of the reconstructed output
argument for the optimized quantize_and_encode
functions is included in the patch. While the current
implementation of search_for_pred still isn't using
it, future iterations of main prediction probably will.
It should not imply any measurable performance hit while
not being used.

Patch attached.

I thought it was worth a review.

It does include lots of copypaste.

FTR, I tested MIPS 74Kf and x86_64 with make fate-aac

PS: yes, Nedeljko beat me by a small margin in syncing up the
implementations, but still I believe sharing code is better than
maintaining copies. Especially having in mind the big rewrite that is
coming from the work in #2686. So I submit this approach for

PS2: ffserver is causing some ICEs on cross gcc 4.5.3, a slight
variation on this fate failure:
- let me know if I can provide some more info on this to get it fixed
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-AAC-encoder-refactor-to-resynchronize-MIPS-port.patch
Type: text/x-patch
Size: 64549 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150915/6c89ff17/attachment.bin>

More information about the ffmpeg-devel mailing list