few SIMD modules read few more bytes from the input buffer
at the end of frame. To avoid OOB read, intermediate buffer
is used while processing last MB row.
Bug: 180505809
Test: poc in bug
Test: atest CtsMediaTestCases:VideoEncoderTest
Test: atest CtsMediaV2TestCases:CodecEncoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoEncTest
Change-Id: I11ca65937c7dfaf623f3535c02158ceec0dcc6ee
Do not set the picture type as NA for the last frame in encoding
order.
Bug: 180219345
Test: POC in bug descriptions
Test: atest CtsMediaV2TestCases:CodecEncoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoEncTest
Change-Id: I57ee7db9e2e55fba2666a6aaa4002ef31276e4b9
Input dimensions are checked for supported range in set_dimensions
control call. Encoder returns an error for unsupported values in
this control call. But if the caller ignores this error and proceeds
to call process(), encoder wasn't checking the dimensions again.
Unsupported dimensions are now checked in process() call as well.
Note: This is relanding previously reverted commit
06c30b33c4
Bug: 172908358
Test: Poc in bug
Test: atest android.mediav2.cts
Test: atest android.media.cts
Change-Id: Icf3f296ab24432c680427a82da3505491acca3bd
For every IDR generated after the first one, one recon buffer was not
released from the buffer manager, when recon was enabled. This resulted
in encoder returning with an error after couple of IDRs when recon was
enabled.
This is fixed by calling recon buffer release based on pic_cnt instead
of frm_num. frm_num is reset to 0 for every IDR where as pic_cnt is not.
Bug: 173150684
Test: avcenc -i qcif.yuv -w 176 -h 144 -o out.h264 \
--bframes 2 --idr_interval 4 --recon_enable 1 \
--recon recon.yuv
Change-Id: I8b72e5aedc6a460292388e4e46f56c07486db4a6
Recent error propagation change in encoder introduced a DoS when
output buffer is not large enough to hold the frame encoded.
This commit fixes the DoS seen.
Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Test: revert fix for b/144928581 to reduce the output buffer size
Test: atest android.media.cts.VideoEncoderTest#testGoogH264FlexMaxMax
Test: atest android.media.cts.VideoEncoderTest#testGoogH264Flex1080p
Bug:145019703
Change-Id: I3b3408153a2cb8541a87547d51dd8bde25a33d6c
This commit has changes to Error return propagation to
the caller functions.
Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Bug: 142545567
Change-Id: I015ebe03e753a0edc1bf8bfc167180ead63193e1
This commit add support for encoding and decoding of MDCV, CLL, CCV and
AVE SEI messages
Test: avcenc -c enc.cfg, avcdec -c dec.cfg
Bug: 141931623
Change-Id: Idc0b0db5291482ae2bc19cdff65669c32374b02a
We're beginning to use remote caches with Android builds, so I'm turning
on -Werror=date-time so that host builds are also reproducible.
Test: treehugger
Test: mmma external/libavc
Change-Id: I581f3abf528a7bb5df6ee9963f4d72e2b4bb8a6c
In entropy thread, after a call to __sync_synchronize(), store buffer is
receiving new entries. This is causing entropy threads to go out of sync,
resulting in erroneous bitstreams. The following change corrects this.
Bug: 130554568
Test: run cts -m CtsVideoTestCases -t
android.video.cts.VideoEncoderDecoderTest#testAvcGoog0Qual0720x480
--skip-preconditions
Change-Id: I81a2343f0f80c1e899e60e92fb48bbd3da006eab
The encoder doesn't return remaining frames if last subgop is
incomplete. This problem is solved by swapping last NULL P frame
(as subgop is incomplete last P frame will be NULL) with the
last valid (non- NULL) B frame. Complete subgop swapping is not done.
Also update MAX_NUM_BFRAMES to 8 and added a separate macro to
define maximum number of pictures in input queue
Bug: 132063959
Test: run cts -m CtsMediaTestCases \
-t android.media.cts.VideoEncoderTest
Change-Id: I9625c5f5f64ec60032c44dad54f735991921d6dd
Intrinsic _mm_set_epi8 require char input, converting everything to char.
Including log.h from android library instead of cutils.
Bug: 112316276
Test: before/after object comparison for no diff in generated code.
Change-Id: I82b8c48494619b64465eda2476c7c903652c6066
For static content, intra modes and skip mode compete with each
other neck and neck. From bitstream perspective its favourable to
pick skip. But do not over bias towards skip as intra modes
are already being penalized with mode bits * lambda.
Average bdrates improve by 1%
Test: Tested on clips of different resolutions for quality changes
Change-Id: I8ae85e7e807c9810e10b325627c84eec679327a9
Skip bias is encoder specific. It is better if it is defined in
encoder headers as opposed to me headers
Test: CL refactoring
Change-Id: I19afb9fcb4fb966c890ed41ab3fe0984e552f57f
For static content, skip and intra modes often compete with each other
neck and neck during mode evaluation. Upon fast skip detection, instead of
skipping all further mode analysis, disable motion search and allow intra
analysis.
This change applies to all presets except FASTEST.
Average bdrate improves by 1%.
Test: Tested on clips of different resolutions.
Change-Id: Ia0aabca5c1dcad03359bebaf071b7be27898e735
Encoder detects scene cut based on number of Intra MBs in the current
frame. For frames which contain plane areas which are different from
reference frames, encoder might encode these MBs as intra because of
lower SAD when compared with inter SAD.
Such cases were detected as scene cuts and RC model was being reset.
To fix this, scene cut is rejected if the current picture did not consume
all the bits that were allocated to it. In an actual scene cut where RC
needs to be reset, current frame consumes more than what is allocated to it.
Bug: 36814430
Change-Id: Ifa904fbaf28481f4762a23bb63e013fd37ec8942
Instead of using hard coded address offsets,
defined structures to access MB Header for each MB type
This improves readability of the code
Also helps in maintaining required alignment for MV
MV elements need to be aligned to 2 byte boundary
Unaligned accesses result in undefined behavior
Bug: 33073518
Test: Tested with -fsanitize=alignment enabled on avcenc
Change-Id: I51c009b7deded76315a4bf2880444d21ae7d517f
i1_ref_idx and u1_mv in cabac context are defined as char,
but were typecasted to int and were accessed, and were not
aligned to 4 byte boundary.
This results in an undefined behaviour
Bug: 33073518
Test: Tested with -fsanitize=alignment enabled on avcenc
Change-Id: Ie4a73de076a9239f2d8707af68b7d2cd796aa803