When u1_video_signal_type_present_flag and
u1_colour_description_present_flag were set, we did write all
fields relating to video signal and color description into
the VUI, even if all those fields were uninitialized (left
at the default cleared zero, which for most fields are
invalid/reserved value zero).
Instead have these flags default to zero, making it clear
that the VUI doesn't (yet) contain correctly set values
for those fields.
Bug: 240470605
Change-Id: I86628cff190c8a40e9c6fd12d3fc8e06419ece7c
The ih264e_vui_ip_t struct doesn't contain any input timestamps,
and the IVE_CMD_CTL_SET_VUI_PARAMS command didn't set these fields
at all (leaving them at their default initialized state 0,0).
At the start of ih264e_encode, pending configurations are
applied if their timestamp matches the timestamp of the frame
to be encoded, or applied unconditionally if the timestamps are
equal to -1.
Thus, the parameters set with IVE_CMD_CTL_SET_VUI_PARAMS
previously only got applied if encoding a frame with the specific
timestamp 0, but now they get applied unconditionally on the
next encoded frame.
Bug: 240466320
Change-Id: I12c50251d8485e3f171ac5c87132ddfbc80377d6
INSERT_EPB doesn't insert emulation prevention byte and instead
is used to check if an emulation prevention byte is to be inserted.
Renaming INSERT_EPB to SHOULD_INSERT_EPB.
Bug: 180962392
Test: build library
Change-Id: I9ac8d8ca6b2d29d5bccab68404f02883acf5d361
Cmake scripts are now modular. Separate scripts now handle
build specifications for each target and dependency.
Toolchain files have been added for armv7, armv8 builds.
Bug: 213579857
Test: Builds using cmake
Test: Builds in OSS-fuzz
Change-Id: Iac62b443c0a0de09a2ce6553a660db2c3d5dc846
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
Return current input buffer as buffer to be freed in case
of errors that are seen before picking up the input buffer
to be from the input queue.
Once a buffer is picked up from the queue, that is returned
as the buffer to be freed.
There is no need to return a buffer from ps_proc context
Bug: 180643802
Test: poc in the bug description
Test: atest CtsMediaV2TestCases:CodecEncoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoEncTest
Change-Id: I1671ca1e82f522004d1f070df89b256b856f75b8
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