Commit graph

3661 commits

Author SHA1 Message Date
Ashwin Natesan
c411bb53e6
mvc: corrected logic for inserting long term refs
The logic for inserting long term refs was failing
when the new ltIdx was greater than any of the
existing ltIdx in the DPB

Bug: 242723830
Test: fuzzer poc in bug
Change-Id: Iea9d71e563910a884ddfc2ddc6d6ab2b32581fde
2022-09-10 11:31:09 +05:30
Harish Mahendrakar
eb463e5aa2 cmake: Set C standard to C90 and move few macros to specific targets
- Set CMAKE_C_STANDARD to 90
  Because of this, moved some declarations to start of the block
- Move PROFILE_ENABLE and MD5_DISABLE to specific targets as these
  macros are not used when building libraries

Bug: 242076773
Test: Builds
Change-Id: Icd0b8a48f015a695185ce2220800348f7a7512f1
2022-08-30 20:00:54 +00:00
Treehugger Robot
b7ac6e9575 Merge "mvc: corrected handling of incorrect bitstreams in mmco parsing" 2022-08-30 15:29:42 +00:00
Ashwin Natesan
17f097626f
mvc: corrected handling of incorrect bitstreams in mmco parsing
Test: fuzzer poc in bug
Bug: 243507465
Bug: 243980319
Change-Id: Ie0fa865791948693d7cd1665965022302ec56203
2022-08-30 10:14:10 +05:30
Treehugger Robot
7215ecabd3 Merge "mvc: Fix for cases where PPS is replaced while still in use" 2022-08-24 22:25:05 +00:00
Treehugger Robot
0a0a4bc9af Merge "avcenc: Make a separate call to encode header" 2022-08-24 19:10:25 +00:00
Ray Essick
a0660f6242 Merge "avcenc: Fix recon dump for last frame" 2022-08-24 16:04:57 +00:00
Treehugger Robot
6a99b2b6c3 Merge "mvc: Fix for with excessive number of 'modification_of_pic_nums_idc'" 2022-08-23 21:14:38 +00:00
Treehugger Robot
4a1c3fbce0 Merge "mvc: Fixed integer overflow erros while computing picNum" 2022-08-23 17:38:28 +00:00
Treehugger Robot
5806b7a626 Merge "readme: integer sanitizer options added" 2022-08-23 13:44:47 +00:00
Ashwin Natesan
cd642700aa readme: integer sanitizer options added
Documents how to enable sanitization for fuzzing outside of android build system.

Change-Id: Ib14fd1215b9db1ba582a9dbbd2d592680a4e230e
2022-08-23 06:19:46 +00:00
Ashwin Natesan
f548c7afab
mvc: Fix for with excessive number of 'modification_of_pic_nums_idc'
Bug: 242600232
Test: fuzzer poc in bug
Change-Id: Ibb566320a452b38235b57bd4b7dd1215a37ca515
2022-08-20 15:58:51 +05:30
Harish Mahendrakar
a90b35eb01 avcenc: Make a separate call to encode header
This makes avcenc to be in sync with c2 plugin

Bug: 242103842
Test: avcenc -c enc.cfg

Change-Id: Ia19f8fc6d3a824a29206e3214d4c8145479ecc70
2022-08-19 12:04:30 -07:00
Treehugger Robot
b9e8c708aa Merge "avcenc: Set default color aspects to unspecified in VUI" 2022-08-19 16:02:56 +00:00
Treehugger Robot
ab6bce7870 Merge "Encoder: add support for PSNR export" 2022-08-19 15:52:16 +00:00
Ashwin Natesan
b1636ac734
mvc: Fix for cases where PPS is replaced while still in use
Bug: 242417287
Test: fuzzer poc in bug
Change-Id: Icb2e9a8f3f815fe7ee271c57e334e13186665e9c
2022-08-19 21:08:41 +05:30
Treehugger Robot
eda6e822bd Merge "mvc: corrected handling of incorrect bitstreams in refIdxActive parsing" 2022-08-19 15:20:56 +00:00
Treehugger Robot
c5ee6f9883 Merge "mvc: Fix for int overflow when parsing u1_bits_in_frm_num" 2022-08-19 07:46:59 +00:00
Treehugger Robot
4a169466ec Merge "mvc: Signal resolution change correctly in subset SPS" 2022-08-19 06:18:19 +00:00
Ashwin Natesan
113c748dd2
mvc: Signal resolution change correctly in subset SPS
Bug: 242500802
Test: fuzzer poc in bug
Change-Id: I1ad1e427fed56b00fc6203328fbe02bb9a453874
2022-08-18 18:49:55 +05:30
Ashwin Natesan
0f0cca684c
mvc: corrected handling of incorrect bitstreams in refIdxActive parsing
Test: fuzzer poc in bug
Bug: 242723830
Change-Id: Ib43c6d24fd45cbab7fe2a7b4b698f50e95b2092a
2022-08-18 16:00:05 +05:30
Harish Mahendrakar
6f403c12e3 avcenc: Set default color aspects to unspecified in VUI
In avcenc test application, when configuring VUI,
color aspects were set to 0. This causes issues when the
clips are decoded using reference decoder where this is treated
as RGB data. Set these to unspecified.

Bug: 242104405
Test: avcenc -c enc.cfg

Change-Id: I2f80250f94faccba52fe945502fc10b793def536
2022-08-17 22:41:47 +00:00
Harish Mahendrakar
ba6f646849 avcenc: Fix recon dump for last frame
Last recon frame wasn't being saved in some cases, it is now fixed.

Bug: 242104774
Test: avcenc -c enc.cfg

Change-Id: I50fcd6709988b7126a36cc88d8abdb75e871a37a
2022-08-17 22:41:33 +00:00
Manisha Jajoo
e559967790 Encoder: add support for PSNR export
This CL adds support to report PSNR between incoming and resulting
encoded frames. Eventually be reported upstream as part of a feedback
mechanism.

Test: avcenc -c enc.cfg
Bug: b/235899898

Change-Id: Id520913ca5964965b5a86bc520240ccd1b28176c
2022-08-17 17:22:00 +00:00
Ashwin Natesan
bb490c0067
mvc: Fix for int overflow when parsing u1_bits_in_frm_num
Bug: 242555278
Test: fuzzer poc in bug
Change-Id: Ie8b8c0a977ad827d7a05fd80b8d8186c78d2acb5
2022-08-16 16:29:40 +05:30
Treehugger Robot
2187495400 Merge "mvc: Set minimum bitstream buffser size correctly" am: 5d36aabe47
Original change: 2183784

Change-Id: Ia909b9e4086a3e9d6adc56ee2a1e9bbe28ef5881
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-14 20:58:16 +00:00
Treehugger Robot
5d36aabe47 Merge "mvc: Set minimum bitstream buffser size correctly" 2022-08-14 20:41:32 +00:00
Treehugger Robot
25ba7774e9 Merge "mvc: Correct view id checks in SPS parsing" am: 5fd48009bf
Original change: 2181819

Change-Id: I71eff2bd64ebdaf4ca65b379b87e557c57b45afa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-14 18:03:51 +00:00
Treehugger Robot
5fd48009bf Merge "mvc: Correct view id checks in SPS parsing" 2022-08-14 17:48:52 +00:00
Ashwin Natesan
2704594292
mvc: Fixed integer overflow erros while computing picNum
Bug: 242372644
Test: fuzzer poc in bug
Change-Id: I36b6f7df8804d45e8965a7ef1c69d5a4d4fd835f
2022-08-14 00:17:35 +05:30
Ashwin Natesan
eb3d11f42f
mvc: Set minimum bitstream buffser size correctly
Bug: 242303994
Test: fuzzer poc in bug
Change-Id: I7bc7fa05c46d9474db4fa8ee7761cf90fa6d8452
2022-08-13 12:09:58 +05:30
Harish Mahendrakar
3328845fa8 encoder: Update dimension check for semi-planar input am: afd2eeb402
Original change: 1782210

Change-Id: I1c1d60f5da17bcd4de359aadaa818878d6ce3c3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-12 17:21:22 +00:00
Ashwin Natesan
79dc65e023
mvc: Correct view id checks in SPS parsing
Corrected checks for number of views and view id
when parsing SPS in MVC decode

Bug: 241865791
Bug: 241867454
Test: fuzzer poc in the bugs
Change-Id: I8241de5c28ddbfebdb639852cf647df5e0a9487b
2022-08-12 12:13:16 +05:30
Harish Mahendrakar
afd2eeb402 encoder: Update dimension check for semi-planar input
For YUV 420 semi-planar input, second plane's width was
wrongly being checked to be equal to half of first plane's width.
Corrected this condition now to check that both these widths are
same.

Bug: 242103647
Test: avcenc -c enc.cfg

Change-Id: I3c06f6e40823ddbf00df0435bfbd1cd314c982e3
2022-08-10 22:47:10 +00:00
Treehugger Robot
f9e89c6707 Merge "Decoder: MVC decoding support added" am: d249d3642d
Original change: 1876797

Change-Id: Ib077451ea8d0ce0adeb124aa01c91c5d9162dfdc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-08-08 15:13:07 +00:00
Treehugger Robot
d249d3642d Merge "Decoder: MVC decoding support added" 2022-08-08 14:53:05 +00:00
Ashwin Natesan
779bbfdb00 Decoder: MVC decoding support added
Added support for decoding 'Multiview High' profile, corresponding to
profile_idc of 118 in 'Rec. ITU-T H.264 (08/2021)'.

Bug: 232169767
Test: atest CtsMediaV2TestCases

Change-Id: I63256344a8a205e74f2bcebe555f5ba6cc3163d0
2022-08-06 05:51:31 +00:00
Ray Essick
038306f35e Merge "Set correct defaults for video signal flags in VUI" am: c4f2671a16
Original change: 1972859

Change-Id: I2dd57344672138083f8f7679463b0c50d42167ed
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28 22:25:51 +00:00
Ray Essick
c4f2671a16 Merge "Set correct defaults for video signal flags in VUI" 2022-07-28 22:05:03 +00:00
Ray Essick
ac8e211679 Merge "Fix setting IVE_CMD_CTL_SET_VUI_PARAMS with IVE_ENC_MODE_HEADER mode" am: 0948bc7fe3
Original change: 1972861

Change-Id: I06b52f22e700a2bab7b8618846f79bd0bcf08fd9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-28 21:32:06 +00:00
Ray Essick
0948bc7fe3 Merge "Fix setting IVE_CMD_CTL_SET_VUI_PARAMS with IVE_ENC_MODE_HEADER mode" 2022-07-28 21:12:06 +00:00
Martin Storsjo
8362f0939b Set correct defaults for video signal flags in VUI
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
2022-07-28 00:31:09 +03:00
Martin Storsjo
a3eaf9ccfc Fix setting IVE_CMD_CTL_SET_VUI_PARAMS with IVE_ENC_MODE_HEADER mode
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
2022-07-27 23:57:57 +03:00
Treehugger Robot
6a8e0e3930 Merge "avc_dec_fuzzer: Zero initialize input and output structures to API calls" am: 4be0806e4e
Original change: 2163356

Change-Id: Ie5c73b700919b665c0ec962c27e7f55d22eb6ab0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-21 22:48:39 +00:00
Treehugger Robot
4be0806e4e Merge "avc_dec_fuzzer: Zero initialize input and output structures to API calls" 2022-07-21 21:42:05 +00:00
Harish Mahendrakar
4ab2109685 avc_dec_fuzzer: Zero initialize input and output structures to API calls
Input and output structures to decoder's functions are now zero
initialized. This way any new additional members in these structures
will be initialized correctly.

Bug: oss-fuzz:49322
Bug: 175179303
Test: avc_dec_fuzzer with memory sanitizer
Change-Id: Ic89625aaaededdef107c34bf8bdc793824b96f85
2022-07-21 19:56:14 +00:00
Harish Mahendrakar
08bcd7ac38 Decoder: In case of no free buffers, release all buffers am: 2a238075dc
Original change: https://android-review.googlesource.com/c/platform/external/libavc/+/220010

Change-Id: I80022f457427df0cd867ee4d3c1eafbc3175ec0e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-20 18:07:14 +00:00
Harish Mahendrakar
2a238075dc Decoder: In case of no free buffers, release all buffers
When decoding erroneous streams, decoder may run out of all buffers
used to hold reference pictures and MV data. In such cases, ignore
all frames till the next IDR frame and then release all buffers while
decoding the IDR frame.

Bug: 236102268
Test: multiple seek on the clip in bug

Change-Id: I14d107a5fdaf5c8d2133e59f48c2b947a5fee5ff
2022-07-20 04:29:15 +00:00
Ray Essick
2d6cd13a61 Merge "Decoder: add support for QP and block_type map export in library" am: aeb7fa461e
Original change: 2014975

Change-Id: If58084c0a1862184c9d23c5a974cedcbfd32f0b8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 23:59:29 +00:00
Ray Essick
aeb7fa461e Merge "Decoder: add support for QP and block_type map export in library" 2022-07-18 23:35:32 +00:00