From a0940a569f2bc24b00dc10ce0fa7658b1dc3a3a5 Mon Sep 17 00:00:00 2001 From: Lajos Molnar Date: Wed, 24 Sep 2014 13:57:35 -0700 Subject: stagefright: misc fixes to software video encoders (and decoders) - move logic to set encoder parameters to common encoder class (similarly to what was done for decoders) - set compressed buffer size based on frame size and compression ratio, and codec-specific minimum size - set raw buffer size based on frame size and metadata mode - do not set stride and slice height on compressed ports - advertise only QCIF support for google H263 encoder - set large-enough input size for video decoders to support adaptive playback - do not change input buffer size on output port reconfiguration, as no input buffer reallocation takes place - do not return empty buffers with EOS after EOS has been signaled Bug: 18513091 Bug: 18639027 Change-Id: Ib13492ef66adf331aa4572c67d2b283ea020cb41 --- include/media/stagefright/foundation/AUtils.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/media/stagefright/foundation/AUtils.h b/include/media/stagefright/foundation/AUtils.h index 3a73a39..d7ecf50 100644 --- a/include/media/stagefright/foundation/AUtils.h +++ b/include/media/stagefright/foundation/AUtils.h @@ -40,6 +40,12 @@ inline static const T divUp(const T &nom, const T &den) { } } +/* == ceil(nom / den) * den. T must be integer type, alignment must be positive power of 2 */ +template +inline static const T align(const T &nom, const U &den) { + return (nom + (T)(den - 1)) & (T)~(den - 1); +} + template inline static T abs(const T &a) { return a < 0 ? -a : a; -- cgit v1.1