Commit graph

41 commits

Author SHA1 Message Date
Harish Mahendrakar
18fc8f6b52 Added support for 420 10-bit decoding.
This is the initial version and doesn't enable SIMD functions yet.
Has not been tested extensively yet.
This is not ready to be merged into main branch yet.
2026-08-07 03:21:32 +00:00
Ram Mohan M
bc802ee605 hevcdec: update chroma subsample filter from neighbor to area
For clips with chroma format idc 444/422 and output format selected to
420, after decoding during chroma sampling conversion from 444/422 to
420, neighbor filtering is done currently. This is updated to area.

Test: ./hevcdec
Change-Id: I024886655084051093858c5c40a94c0373c64813
2026-07-02 10:09:50 -07:00
Sushant
646ee99888 libhevc: Direct memcpy and memset calls to enable _FORTIFY_SOURCE
Some checks failed
CMake / build (cmake, aarch64-linux-gnu-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake, aarch64-linux-gnu-g++, ubuntu-latest-cross-aarch64-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, arm-linux-gnueabihf-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake, arm-linux-gnueabihf-g++, ubuntu-latest-cross-aarch32-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, macos-latest-clang-cmake, macos-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-24.04-arm-clang-cmake, ubuntu-24.04-arm) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-latest-clang-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -DSANITIZE=fuzzer-no-link,address, clang++, ubuntu-latest-clang-cmake-asan-fuzzer, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -G Ninja, clang++, ubuntu-latest-clang-cmake-ninja, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, gcc, , g++, ubuntu-latest-gcc-cmake, ubuntu-latest) (push) Has been cancelled
Bypass wrappers functions for memcpy and memset, calling standard
C library functions directly. This allows _FORTIFY_SOURCE to
perform compile-time safety checks.

Bug: 514722372
Test: ./hevcdec

Change-Id: Id9faf0919ecedfd1833d40a7fbf6ddac454628b4
2026-06-18 06:44:56 -07:00
Vivek R Jadhav
e7d529d271 hevcdec: add support for chroma qp offset list
Test: ./hevcdec

Change-Id: I40411c04ab00d7e23843eb1d033c4943e3ec86e8
2026-06-18 06:42:01 -07:00
Harish Mahendrakar
a2a98baa6e refactor: clean up SAO and ILF padding code
- Deleted ihevcd_sao_ctb implementation and declaration.
- Removed code under #else of SAO_PROCESS_SHIFT_CTB in ihevcd_process_slice.c.
- Removed code under #if FRAME_ILF_PAD and simplified checks assuming FRAME_ILF_PAD is 0.
- Deleted ihevcd_ilf_padding.c and removed it from Android.bp and libhevcdec.cmake.
- Removed SAO_PROCESS_SHIFT_CTB definition in ihevcd_defs.h.
- Removed FRAME_ILF_PAD definition in ihevcd_defs.h.

TAG=agy
CONV=ceba65ba-1766-4f4d-84f0-f7c3804a90fe
2026-05-24 10:11:19 -07:00
Vivek R Jadhav
37e4bc2135 libhevcdec: Add inter pred support for yuv422 format
Bug:
Test: ./hevcdec

Change-Id: I40411c04ab00d7e23843eb1d033c4945e3ec66e9
2026-05-06 10:30:26 -07:00
Ram Mohan M
a960c019e0 hevcdec: add support for persistent rice adaptation flag
Some checks failed
CMake / build (cmake, aarch64-linux-gnu-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake, aarch64-linux-gnu-g++, ubuntu-latest-cross-aarch64-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, arm-linux-gnueabihf-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake, arm-linux-gnueabihf-g++, ubuntu-latest-cross-aarch32-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, macos-latest-clang-cmake, macos-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-24.04-arm-clang-cmake, ubuntu-24.04-arm) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-latest-clang-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -DSANITIZE=fuzzer-no-link,address, clang++, ubuntu-latest-clang-cmake-asan-fuzzer, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -G Ninja, clang++, ubuntu-latest-clang-cmake-ninja, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, gcc, , g++, ubuntu-latest-gcc-cmake, ubuntu-latest) (push) Has been cancelled
Test: ./hevcdec
Change-Id: I835753e513b757330a4905ac29340422fc8d1590
2026-03-16 10:03:26 -07:00
Ram Mohan M
38e622bf6a hevcdec: update lib for chroma format idc 422
Some checks are pending
CMake / build (cmake, aarch64-linux-gnu-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake, aarch64-linux-gnu-g++, ubuntu-latest-cross-aarch64-cmake, ubuntu-latest) (push) Waiting to run
CMake / build (cmake, arm-linux-gnueabihf-gcc, -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake, arm-linux-gnueabihf-g++, ubuntu-latest-cross-aarch32-cmake, ubuntu-latest) (push) Waiting to run
CMake / build (cmake, clang, , clang++, macos-latest-clang-cmake, macos-latest) (push) Waiting to run
CMake / build (cmake, clang, , clang++, ubuntu-24.04-arm-clang-cmake, ubuntu-24.04-arm) (push) Waiting to run
CMake / build (cmake, clang, , clang++, ubuntu-latest-clang-cmake, ubuntu-latest) (push) Waiting to run
CMake / build (cmake, clang, -DSANITIZE=fuzzer-no-link,address, clang++, ubuntu-latest-clang-cmake-asan-fuzzer, ubuntu-latest) (push) Waiting to run
CMake / build (cmake, clang, -G Ninja, clang++, ubuntu-latest-clang-cmake-ninja, ubuntu-latest) (push) Waiting to run
CMake / build (cmake, gcc, , g++, ubuntu-latest-gcc-cmake, ubuntu-latest) (push) Waiting to run
- updated parser for 422 specific syntax elements
- updated iqitrecon module to handle 422 subtu's. Verified functionality
  for intra only slices
- add support 422 i/o
- restrict combinations of output chroma format and internal chroma
  format allowed. That is, for a given chroma format idc not all output
  color formats are supported. The output format can now be either same
  as internal color format or 420p.

Test: ./hevcdec
Change-Id: I9dbf5c141aceb8ffcbe063aa35856eeed11e3d4f
2026-03-04 15:39:55 -08:00
Ram Mohan M
87962d6818 hevcdec: add support for cross component prediction
Test: ./hevcdec

Change-Id: I84b76bdd7a8f0611be42fbe08bb0dca46bc40df7
2026-03-04 12:32:03 -08:00
Ram Mohan M
3d63430b77 hevcdec: improve sample app config file
Test: ./hevcdec
Change-Id: I51021c7b43f6b208db9c6dd6f9278d52ffe40eac
2026-02-23 11:55:55 -08:00
Rakesh Kumar
29611400fa hevcdec: add support for internal color format 444
Change-Id: I013e44e024258f2f84690fdcc01b4cd52f0fbd18
2026-02-23 10:59:08 -08:00
Ram Mohan M
09bc53ec53 hevcdec: fix white spacing and other cosmetic changes
Some checks failed
CMake / build (cmake, clang, , clang++, macos-latest-clang-cmake, macos-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-latest-clang-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -DSANITIZE=fuzzer-no-link,address, clang++, ubuntu-latest-clang-cmake-asan-fuzzer, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -G Ninja, clang++, ubuntu-latest-clang-cmake-ninja, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, gcc, , g++, ubuntu-latest-gcc-cmake, ubuntu-latest) (push) Has been cancelled
Test: Build
2026-02-11 12:14:51 -08:00
Vivek Jadhav
45340a66f0 libhevcdec: Add support for monochrome
Some checks failed
CMake / build (cmake, clang, , clang++, macos-latest-clang-cmake, macos-latest) (push) Has been cancelled
CMake / build (cmake, clang, , clang++, ubuntu-latest-clang-cmake, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -DSANITIZE=fuzzer-no-link,address, clang++, ubuntu-latest-clang-cmake-asan-fuzzer, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, clang, -G Ninja, clang++, ubuntu-latest-clang-cmake-ninja, ubuntu-latest) (push) Has been cancelled
CMake / build (cmake, gcc, , g++, ubuntu-latest-gcc-cmake, ubuntu-latest) (push) Has been cancelled
Bug: 382315082
Test: ./hevcdec

Change-Id: I944c539000f26898d5985cd5809f2958d4865f71
2025-11-11 07:11:03 -08:00
Shivaansh Agrawal
f6dcd29208 Decoder: add support for QP and block_type map export in library
Bug: 176469524

Test: hevcdec -c test.cfg
Test: atest -c android.mediav2.cts.CodecDecoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoDecTest

Change-Id: I75aebd3c4121d3b8cb5a2a947f643abbff41810d
2022-08-04 11:40:43 +05:30
Rakesh Kumar
06e94e9ceb Decoder: Fix integer-overflow sanitizer issues
Bug: 111272481
Test: vendor
Change-Id: If4266a33677d98f567884ebbc7908289e42fb94f
2019-01-09 13:16:37 -08:00
Naveen Kumar P
ec2c7b5be8 Merge "Update ctb pu map for I slice" into lmp-dev am: d4cb5bc056 am: 2c01a8105a am: 3598a31588 am: 3249f368df am: ef55cf7d83 am: a1930d6125
am: 143746ee0a

Change-Id: I2bb2b69ef1fc9a929b7cffa57b2dca0e5aa847f1
2017-11-30 02:13:20 +00:00
Naveen Kumar P
3598a31588 Merge "Update ctb pu map for I slice" into lmp-dev am: d4cb5bc056
am: 2c01a8105a

Change-Id: I713638a47505ff1fcc01346c792390c20f0251cc
2017-11-30 01:51:59 +00:00
Naveen Kumar P
43f126112a Update ctb pu map for I slice
The update in I slice is required for P/B slices in the same
frame for accessing neighbor pus.

Bug: 62851602
Bug: 63522067
Test: re-run PoC from b/62851602
Change-Id: Ie5e43f1cd5649b2745b6527654bc24d8c7d42932
2017-11-21 11:50:04 -08:00
Naveen Kumar P
2e75afa0b6 Merge "Fix first frame error return" into mnc-dev am: cd5fc07378 am: 6a8d396574 am: de7f47bcc0 am: 6f830783d1
am: 4ced4d140b

Change-Id: I5693cee77a29fe6591a8d15a698af976688664be
2017-11-07 22:28:24 +00:00
Naveen Kumar P
8fff219fac Fix first frame error return
Remove the check that returns before joining the slave threads
if there is an error in the first frame. And in slice error mode
do not parse bitstream.

Bug: 64784973
Test: no longer hangs on POC
Change-Id: I3c2e2d9f84304bcb34831d7d796da710154774fa
2017-11-07 18:30:03 +00:00
Naveen Kumar P
4b51fe8471 Merge "Set error skip ctbs as multiple 8x8 pus" into lmp-dev am: 6587d735fa am: 27e8401a7c am: 862bb09d83 am: 44b8f080fb am: 7ec22794a9 am: 4d3f1cc304
am: 5669203fdf

Change-Id: I10dafebc1b85ff9521a15f01082e4794d1766df6
2017-10-20 20:04:11 +00:00
Naveen Kumar P
862bb09d83 Merge "Set error skip ctbs as multiple 8x8 pus" into lmp-dev am: 6587d735fa
am: 27e8401a7c

Change-Id: Ia7712ae3fa31002fbde12b2491d42c8532555a26
2017-10-20 19:54:10 +00:00
Naveen Kumar P
2b9fb0c207 Set error skip ctbs as multiple 8x8 pus
Bug: 65123471

This is required for incomplete ctbs at the frame
boundaries

Change-Id: I7e41a3ac2f6e35a929ba4ff3ca4cfcc859a7b867
2017-10-05 13:56:13 -07:00
Harish Mahendrakar
8ea578bc28 Merge "Limit boundary PU sizes in case of errors" into lmp-dev am: f661b00835 am: 34ec365ad3 am: f7579e8bd4 am: 54ce382232 am: e9683f3831 am: 5d5e3e5f60 am: dd544a23aa
am: 877a39c5a0

Change-Id: I60d3125fa0b557da74fbb59de884ec2184693cc8
2017-07-10 20:08:58 +00:00
Harish Mahendrakar
54ce382232 Merge "Limit boundary PU sizes in case of errors" into lmp-dev am: f661b00835 am: 34ec365ad3
am: f7579e8bd4

Change-Id: I38d1ada08789a4fe31063445af07c6c75dcb50b1
2017-07-10 19:47:56 +00:00
Harish Mahendrakar
62830d130b Limit boundary PU sizes in case of errors
In case of error clips, some PUs are marked as skip.
Ensure such PUs stay within the picture

Bug: 37615911
Test: ran POC included with the bug.
Change-Id: Ie0aeccc752cf556f9dea84de61c15a7906e1060b
2017-06-13 14:54:58 -07:00
Naveen Kumar P
6a7bdf2172 Handle error return in parse slice am: 4535874899 am: c83ae25b05 am: 2bdd1d0979 am: f103a876f8 am: 3a53506dd4 am: 416da06611 am: c8ca86237e
am: 0806e67ec5

Change-Id: I48304693bde40f88567e93f2251888810f4f8eb5
2017-06-01 21:24:25 +00:00
Naveen Kumar P
f103a876f8 Handle error return in parse slice am: 4535874899 am: c83ae25b05
am: 2bdd1d0979

Change-Id: Ib2359105fa8376d7fcb79973db597862f7340097
2017-06-01 21:10:24 +00:00
Naveen Kumar P
4535874899 Handle error return in parse slice
Bug: 37430213
Change-Id: I77f5973db54edccc0972649035b0fbde961c10dd
(cherry picked from commit 16c8c8cceeb74c7f4634803723a0b8b1f4881dc9)
2017-05-30 09:38:36 -07:00
Naveen Kumar Ponnusamy
14ca5bef56 Merge "Return error from cabac init if offset is greater than range" into lmp-dev am: 09ff5c6298 am: eef834a4d0 am: 49e9836a16 am: de6bd99214 am: ee8b0629d9 am: b6da1b1291 am: 8e0bd1fd7f
am: fb96f065c9

Change-Id: I558839aa8dc86b14411c4c4f9320a7977f22c4ed
2017-03-13 23:09:25 +00:00
Naveen Kumar Ponnusamy
de6bd99214 Merge "Return error from cabac init if offset is greater than range" into lmp-dev am: 09ff5c6298 am: eef834a4d0
am: 49e9836a16

Change-Id: Ia6594900b169d3f3dfe4e767558a5f76fb77e3fd
2017-03-13 22:49:08 +00:00
Naveen Kumar Ponnusamy
b92314c860 Return error from cabac init if offset is greater than range
When the offset was greater than range, the bitstream was read
more than the valid range in leaf-level cabac parsing modules.
Error check was added to cabac init to fix this issue. Additionally
end of slice and slice error were signalled to suppress further
parsing of current slice.

Bug: 34897036
Change-Id: I1263f1d1219684ffa6e952c76e5a08e9a933c9d2
(cherry picked from commit 3b175da88a1807d19cdd248b74bce60e57f05c6a)
2017-03-10 14:56:09 -08:00
Marco Nelissen
a066d53106 Merge "Fix in handling wrong cu_qp_delta" into lmp-dev am: 98f9e26d24 am: 10f2b105f5 am: b4ddce56d1 am: 59b232588b am: ca85c43d8d am: fc093b18cd am: 4f28fb5344
am: 29a107d6fb

Change-Id: I25e5774e0bd95720864d4b86acae96899359a942
2017-02-14 23:11:02 +00:00
Marco Nelissen
59b232588b Merge "Fix in handling wrong cu_qp_delta" into lmp-dev am: 98f9e26d24 am: 10f2b105f5
am: b4ddce56d1

Change-Id: I2280a7fcbd5b71ca3d6f8c0a747f4805e96caea8
2017-02-14 22:59:01 +00:00
Harish Mahendrakar
01ca88bb6c Fix in handling wrong cu_qp_delta
cu_qp_delta is now checked for the range as specified in the spec
Bug: 33966031

Change-Id: I00420bf68081af92e9f2be9af7ce58d0683094ca
2017-02-13 20:18:51 +00:00
Harish Mahendrakar
27405a217f Added memory barrier calls
On some A72 based devices, data shared between cores was found to be
inconsistent which was resulting in an infinite loop.

Adding memory barriers before marking a CTB as parsed/processed,
all the pending memory operations are guaranteed to be completed.

Change-Id: I6e3bb11123a3c12ba7e69c4bfcd38960616f9fb5
(cherry picked from commit 031b91dde5)
2016-08-24 18:11:14 -07:00
Naveen Kumar Ponnusamy
221aaccb7a Few bug fixes in loop filter
Removed few unused functions
Fixed an issue in 420P output in shared mdoe
Few bug fixes in handling loop filter corner cases in multi-tile multi-slice clips
Renamed few elements in mv_buf_t for consistency

Bug: 22860270

Change-Id: I8d179b9ad3c7ee3ad27972ee02ea2658fd2c3c25
2015-07-31 01:59:55 +00:00
Naveen Kumar Ponnusamy
9663ae2116 Few bug fixes in loop filter
Removed few unused functions
Fixed an issue in 420P output in shared mdoe
Few bug fixes in handling loop filter corner cases in multi-tile multi-slice clips
Renamed few elements in mv_buf_t for consistency

Change-Id: I8d179b9ad3c7ee3ad27972ee02ea2658fd2c3c25
2015-07-30 18:14:32 +05:30
Naveen Kumar Ponnusamy
6c166a9e18 Source files clean up
Cleaned up source files for redundant and inactive #if directives
2014-07-12 15:09:24 -07:00
Harish Mahendrakar
707042fda9 Few bug fixes and warnings removed
Added support for returning coded width and height along with display dimensions
Fixed few macros for mips
Removed signed comparison warnings
Removed few files that are not needed
Fixed an issue in handling more than 256 slices in a picture

Bug: 14571712
Change-Id: Ie485aaae3a13744bc9acff8aa699efbbc31f94f1
2014-06-06 06:42:02 -07:00
Harish Mahendrakar
0d8951cef4 Initial Version of HEVC decoder
Compliant to reference software HM11.0 onwards

Bug: 14571712
Change-Id: I8af25c1221cc6ab70440141c4d9b48c1ac69696a
2014-05-21 18:14:55 -07:00