Commit graph

3948 commits

Author SHA1 Message Date
Elliott Hughes
81d765231f Also ignore missing BTI for the examples, fuzzers, and tests.
Some checks are pending
CMake / build (push) Waiting to run
Change-Id: Ic4e60685efde008d04e0c070d35bc207564c9fcb
2026-04-01 16:26:38 -07:00
Elliott Hughes
dd26705c3e libavc: ignore BTI for now.
The assembler in this project needs updating, but we want to enable the
bti-report=error flag globally.

Change-Id: Ia67dd7bfc9adce5a434f45a783ffbc109dfb4dd4
2026-04-01 16:26:38 -07:00
MallikarjunKamble
74704cccf3 svc_dec_fuzzer: Allocated size was lower for non_vcl NAL
Some checks failed
CMake / build (push) Has been cancelled
Bug: oss-fuzz-473582308
Test: ./svc_dec_fuzzer
2026-02-16 12:26:21 -08:00
Sharjeel Khan
40a5577c96 svc_enc_fuzzer: Add algorithm header for C++23
Some checks failed
CMake / build (push) Has been cancelled
C++23 removed transitive includes so you need to add C++23 headers
directly to use its classes and functions. svc_enc_fuzzer needs the
algorithm header to use std::fill. I tested it in Android by building `m
svc_enc_fuzzer`.

Error:
external/libavc/fuzzer/svc_enc_fuzzer.cpp:347:5: error: no member named
'fill' in namespace 'std'; did you mean 'kill'?
  347 |     std::fill(mMemRecBufs.begin(), mMemRecBufs.end(), nullptr);
external/libavc/fuzzer/svc_enc_fuzzer.cpp:379:5: error: no member named
'fill' in namespace 'std'; did you mean 'kill'?
  379 |     std::fill(mMemRecBufs.begin(), mMemRecBufs.end(), nullptr);
external/libavc/fuzzer/svc_enc_fuzzer.cpp:1203:13: error: no member
named 'fill' in namespace 'std'; did you mean 'kill'?
 1203 |             std::fill(std::next(mEncBufs.mInputBuf.begin(),
bytesLeft), mEncBufs.mInputBuf.end(),
2026-01-05 15:46:44 -08:00
srujan vandrangi
4064713f6f avc_dec_fuzzer: Add AVX2 arch support for avc decoder fuzzer
Some checks failed
CMake / build (push) Has been cancelled
Test: ./avc_dec_fuzzer
Change-Id: If2eddf34e5c59b0d8b7e35b80b9b28a47f3d72a8
2025-11-19 17:05:27 -08:00
Priyanka Bose
ca7461442c avx2 intrinsics support for libavc(sw decoder)
Some checks failed
CMake / build (push) Has been cancelled
This patch includes handwritten avx2 intrinsics to optimize the libavc sw decoder
by reducing CPU-cycles overhead on module : libcodec2_soft_avcdec.

Playing 1024 resolution video playback on the Galley App with HW decoder disabled:
cpu-cycles overhead(%) reduced by ~15%.
Loading of video thumbnails on Gallery/Photos App is faster (we have pushed approx
more than 30 videos as a part of the usecase): cpu-cycles overhead(%) have reduced by ~10%.This patch is related to s/w video decoding.

Signed-off-by: Priyanka Bose <priyanka.bose@intel.corp-partner.google.com>
2025-11-12 22:21:10 -08:00
Sushant
9331596eef avcdec: fixing transform_8x8_present_flag parsing
Some checks failed
CMake / build (push) Has been cancelled
Change-Id: Iead57925b55e28ded388afd8ba379080792d9f4f
2025-09-08 09:05:51 -07:00
Rakesh Kumar
ab825bbb0d svcdec: fix build issue
Some checks failed
CMake / build (push) Has been cancelled
2025-08-20 10:04:14 -07:00
Mallikarjun Kamble
6f5a49da5d svcdec: Fixed heap use after free by initilizing dpb ref buffers
Bug: 428771938
Test: ./svc_dec_fuzzer
2025-08-11 08:59:28 -07:00
Vivek Jadhav
b34ac3d492 libavcdec: resolve heap buffer overflows in svc
Bug: 434978682
Bug: 435086517
Test: ./svc_dec_fuzzer

Change-Id: I5c432aa63b0975b76baa5e59a819278087b65218
2025-08-08 07:53:30 -07:00
Vivek Jadhav
2f6371b3b8 libavcdec: Add support for 4096x4096 resolution
Bug:
Test: ./avcdec

Change-Id: Ie111f58e04bbd045e94167cdb978c571662567fb
2025-07-21 22:26:42 -07:00
Sushant
f308c61af0 avcenc: cleanup for thread pool memory handling
Test: avcenc -c enc.cfg
Change-Id: I5f5cf7f705d389f6938fc641daa558bedfbc573c
2025-05-23 14:59:56 +05:30
Sushant
c2714ee61c avcenc: Fixed thread handle parameter
Test: avcenc -c enc.cfg
Change-Id: I5f5cf7f705d389f6938fc641daa558bedfbc462b
2025-05-19 20:37:53 +05:30
Hang Nguyen
70530453cc Redefine examples test modules as cc_binary
This change redefines the `cc_test` modules within the examples
directory as `cc_binary` modules.

Previously, these `cc_test` modules were effectively acting as wrappers
around executable binaries, solely for the purpose of generating test
executables. This approach did not allow for the direct installation of
these executables on devices.

Changing these modules to `cc_binary` allows the resulting executables
are produced as standalone binaries, enabling their deployment and
execution on test devices.

Bug: 414657128
Change-Id: I9caef8a5cf29c7d77b8bcd535f047a640c52285c
2025-05-09 22:11:54 -07:00
Sushant
bbe50c922a avcenc: Enabling keep_threads_active in cfg and avc_enc_fuzzer
Test: avcenc -c enc.cfg
Change-Id: I45b32621aa3d64b569e5ac6b7f23405aa1711c82
2025-04-22 18:02:12 +05:30
Sushant
5e9c764903 avcenc: Replacing KEEP_THREADS_ACTIVE with runtime check
Test: avcenc -c enc.cfg
Change-Id: If6c8c29d2b5b1322796b8b25dc74231d13b61243
2025-04-22 17:09:57 +05:30
Sushant
262b845c31 avc_enc_fuzzer: call retrieve memrec before deinit
Change-Id: I79fb713c655f1a79941165f0214575389561f0bb
2025-04-21 18:54:01 +05:30
Sushant
f17635d2eb avcenc: moving mutex and cond variable init and destruction
Change-Id: I7123f43b5f3a85355b43370ae3df1930ebe5b570
2025-04-21 18:54:01 +05:30
Sushant
cdbee17b6e avcenc: add thread pool shutdown on last frame with KEEP_THREADS_ACTIVE
Test: avcenc -c enc.cfg
Change-Id: I85c9b535e2b81bf7f07a80bd7038d4f0429eecfe
2025-04-21 18:54:01 +05:30
Sushant
ee0c417a64 avcenc: add support for KEEP_THREADS_ACTIVE
Currently avc encoder creates desired number of threads at
the start of every frame and joins after frame is processed.
This change modifies the thread creation part. Now the threads
are created at the start of the sequence. Kept alive through
out the sequence and joined at the end of the sequence. This
helps in reduction of thread creation and deletion overhead.

This change does not effect the encoded bitstream. That is,
encoded output with this change is same as encoded output
without this change.

Bug: 288998933
Test: avcenc -c enc.cfg
Change-Id: I98784169052a5f05c109aaf1de97a5e46d7a773d
2025-03-20 07:11:55 -07:00
Harish Mahendrakar
bf47848174 Update cifuzz.yml
Updated cifuzz.yml to use actions/upload-artifacts@v4.
2025-03-18 22:53:31 -07:00
Vaibhav Valvaiker
3916f3eea4 mvcdec: Heap overflow in 'ih264d_read_coeff4x4_cabac'
In some erroneous fuzzer bistreams, the slice data requires more
parsing than what was implied by the distance between successive
start codes. The primary culprit is the NEXTBITS macro which requires
reading 4 additional bytes of the bitstream buffer. To alleviate
this, 16 bytes per 4x4 TU have been additionally allocated to the
bitstream buffer. Also, chroma bytes are added for 4:2:0/4:2:2.

This is in reference to commit-72315c1, where additional bytes were added to fix similar issue.

Bug = ossfuzz:42538616
Test: mvc_dec_fuzzer
2025-01-30 06:21:06 -08:00
Rakesh Kumar
ba74b083b4 libavc: Fix dynamic color aspects support
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Id64ddb874efe1ab51cd9b2359bfa9526bc1ccd6e
2024-11-11 18:23:04 -08:00
Srujan Vandrangi
f6a923b765 libavc: remove unused KEEP_THREADS_ACTIVE flag in Android.bp
Bug: 376303949
Test: Build and review
Change-Id: If2eddf34e5c59b0d8b7e35b80b9b28a47f4d72a1
2024-11-04 09:19:56 -08:00
Rakesh Kumar
7d6f8576e0 libavcdec: Fix integer overflow issue in ui_max_frame_num
In avc MaxFrameNum can be 65536 which is of 17 bits due to which
interger overflow was happening for i2_max_frm_num and
ui_max_frame_num. This has been fixed.

Bug: 369676522
Test: poc in bug description

Change-Id: I858eea6bf8eea1e2cee6d4a7c28a84705eb51792
2024-10-24 08:16:56 -07:00
Sushant
1a896d45d5 libavc: Add VSCode configuration files for Linux & MacOS
- Added .vscode directory with tasks.json, settings.json, c_cpp_properties.json, and launch.json.
- Configures the Build button to build the project.
- Configures Run and Debug panel to run avcdec and avcenc test benches.

Test: Build

Change-Id: Ifee9130f0041f77907a1a668227bc049270898e1
2024-10-15 22:51:19 -07:00
Suyog Pawar
266cda3c3b libavc : Enable support for MacOS
Test: ./avcenc
      ./avcdec

Change-Id: If03196cf979d7f6638b99d5b13afba6df3364178
2024-10-04 06:51:30 -07:00
Suyog Pawar
045d0c9156 libavc : Fix mutex initialization index in apv_proc_start_mutex
- Changed hardcoded index [0] to loop variable [i] in ithread_mutex_init call
- Ensures correct initialization of both mutexes in the loop

Test: ./avcdec

Change-Id: I95ccd1eec5f18b5391befbcedf3546a119681b54
2024-10-04 06:50:55 -07:00
Suyog Pawar
42068b0f6c libavc: Fix poc counts for idr slice
Test: Build
Change-Id: Ic9212b86efbc54724c09164776169bfeafb15d7b
2024-08-07 05:53:55 -07:00
Mallikarjun Kamble
bc0de21907 Limit decode calls to a maximum of 100 to prevent potential timeouts with fuzzers 2024-07-22 09:58:04 -07:00
Mallikarjun Kamble
3899610fa8 svcdec: Handled timeout by returning status of the error
Bug = ossfuzz:67415
Test: svc_dec_fuzzer
2024-07-19 01:11:00 -07:00
Mallikarjun Kamble
b0117e32b9 svcdec: Ensure decoder display dimensions match subset sequence dimensions
- Fixes for heap buffer overflow

Bug = ossfuzz:68807, ossfuzz:69682
Test: svc_dec_fuzzer
2024-07-11 00:24:15 -07:00
Ashwin Natesan
72315c11ac mvcdec: Heap overflow in 'ih264d_read_coeff4x4_cabac'
In some erroneous fuzzer bistreams, the slice data requires more
parsing than what was implied by the distance between successive
start codes. The primary culprit is the NEXTBITS macro which requires
reading 4 additional bytes of the bitstream buffer. To alleviate
this, 4 bytes per 4x4 TU have been additionally allocated to the
bitstream buffer.

Bug = ossfuzz:66989
Test: mvc_dec_fuzzer
2024-05-07 11:48:55 -07:00
Haripriya Deshmukh
828cdb77ba libavc: Add dynamic color aspects support
Bug: 325468696
Test: atest android.mediav2.cts.DecoderDynamicColorAspectTest

Change-Id: Ib33d57a1f8109a149926841fed1a3d2ff454b668
2024-04-23 23:04:49 -07:00
Harish Mahendrakar
1c9bd7e20a Remove useless neon: clause.
There hasn't been a non-neon platform build in years.

Bug: 330929681
Test: Builds
Change-Id: I712c2111722a17ecf55ab36e8069275c74379256
2024-03-23 15:08:24 -07:00
Harish Mahendrakar
5ff80617fa Enable unit tests in postsubmit
After some time of running these in postsubmit, these will be changed
to presubmit.

- Added AvcEncTest to device-tests test suite
- Also run bpfmt on test/Android.bp

Bug: 304383609
Test: atest AvcEncTest
Change-Id: Ic18b25d8ed27313b6e3a984259af1215ae240c9e
2024-01-30 15:45:17 -08:00
Harish Mahendrakar
f0214b163b Use media file zip from dl.google.com
Bug: 308464572
Test: atest AvcEncTest

Change-Id: I20387647c54e665e5b632ac0e791e259ddb519ff
2024-01-29 13:58:44 -08:00
Ashwin Natesan
a20a5df162 mvcdec: Heap overflow in 'ih264d_parse_fgc'
Although the fag end of both the NALU and the bitstream buffer
 is being parsed, not all FGC SEI symbols would have been
decoded semantically. This commit detects and returns an error
in this situation.

Bug = ossfuzz:65418
Test: mvc_dec_fuzzer
2024-01-21 21:40:27 -08:00
Mallikarjun Kamble
28727baf58 svcdec: oss-fuzz bug fixes
ID#
65031
65035
65057
65059
65060
65132
65172
65482
2024-01-09 07:12:29 -08:00
Srujan Vandrangi
0d29250b99 libavcenc: fix build issues on android
Test: Build
2023-12-19 20:45:31 -08:00
Ashwin Natesan
63b8be0524 svcenc: Integer overflow in irc_ba_get_cur_frm_est_texture_bits
'isvce_svc_rc_params_validate' was not being invoked prior to
call to 'isvce_rc_init'. This resulted in an erroneous state
within RC's context wherein the instantaneous estimate for the
texture bits for the frame being processed exceeded INT_MAX.
'isvce_svc_rc_params_validate' has code that detects such a
state and is now being correctly invoked where apprpriate.

Bug = ossfuzz:63175
Test: svc_enc_fuzzer
2023-12-13 07:40:47 -08:00
Mallikarjun Kamble
3cc9ff94db Update intra resamp flags 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
a8a8a80c5f Added compliance fixes 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
df740b5ebc Added fixes for hang 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
e49a9150a3 Fixes for heap overflow 2023-12-11 10:41:02 -08:00
Mallikarjun Kamble
82f4e69094 svcdec: Fixes for NULL dereferencing in inter-layer functions
Resolution level initialization is tracked in inter layer prediction functions

Bug = ossfuzz:62290
Test: svc_dec_fuzzer
2023-11-24 07:19:34 -08:00
Ashwin Natesan
37beb97292 mvcdec: Fixed heap overflow during SEI parsing
There can be cases where there are multiple SEI payloads within a
single SEI NAL. In the particulkar case where the payload comprises
exclusiely of FGC data, the size of the NAL can exceed the size
of the 'dynamic bitstream buffer' which is used to pass the NALU
onto its appropriate parser.

This commit adds 'imvcd_bitstream_buf_realloc' which re-allocates
the 'dynamic bitstream buffer' such that any arbitrarily sized
NALU can be stored without a heap overflow.

Bug = ossfuzz:64286
Test: svc_enc_fuzzer
2023-11-21 06:02:14 -08:00
Ram Mohan M
0e72348961 libavcenc: validate dimensions after applying config params
Before applying the config params (dimensions), the api is validating
the input buffer dimensions. This causes encode fails wrongly. This is
corrected.
2023-11-20 22:40:30 -08:00
Vivek Jadhav
972c0aa711 libavcdec: Fix timeout issue in AVC Decoder
Make use of cur_pps to compute the max number of frames
in decode gaps in frame num

Bug: oss-fuzz-61655
Test: avc_dec_fuzzer
2023-11-14 21:03:25 -08:00
Ashwin Natesan
51268b3a71 svcenc: Redundant code removed
The following lines of code have been removed to improve coverage -
  [x] Functions -
      - isvc_interleaved_copy
      - isvc_16bit_interleaved_copy
      - isvc_16bit_interleaved_memset
      - isvc_iquant_itrans_recon_chroma_4x4_neon
      - isvc_iquant_itrans_recon_chroma_4x4_sse42
      - isvc_iquant_itrans_recon_4x4_dc_with_res_output_neon
      - isvc_iquant_itrans_recon_res_dc_4x4_sse42
      - isvc_iquant_itrans_recon_4x4_dc_with_res_accumulate_neon
      - isvc_iquant_itrans_recon_res_dc_with_res_acc_4x4_sse42
      - isvce_wait_for_thread
  [x] Function pointer initialisations for the functions above

Test: svc_enc_fuzzer
2023-10-27 06:14:32 -07:00