Commit graph

72 commits

Author SHA1 Message Date
Rakesh Kumar
29611400fa hevcdec: add support for internal color format 444
Change-Id: I013e44e024258f2f84690fdcc01b4cd52f0fbd18
2026-02-23 10:59:08 -08:00
Suyog Pawar
45c10b2003 libhevc: Enable support for MacOS
Test: ./hevcenc
Test: ./hevcdec

Change-Id: Iafd43c61d80ddc46807441bcda97bb72edd76850
2024-10-01 06:37:42 -07:00
Suyog Pawar
8dd2b3392a libhevc: Update encoder logic to handle iframe interval and bframes
This update improves the encoder's behavior and ensures it runs efficiently
when the iframeinterval is less than or equal to maxbframes. In this
case, the encoder ignores the maxbframes.

Test: ./hevcenc
2024-07-17 21:23:49 -07:00
srujan vandrangi
95929e6021 libhevc: fix encoder SEI related code while disabling SEI
initialise the default size of synchronous and asynchronous
command buffers to 16 if sei encoder parsing is disabled

Bug: 338446610
Test: ./hevcenc
2024-06-06 22:52:18 -07:00
srujan vandrangi
5fa218d639 libhevc: fix codec SEI related code while disabling SEI
Bug: 338446610
Test: ./hevcenc
Test: ./hevcdec
2024-06-06 22:27:43 -07:00
srujan vandrangi
05d4214bef libhevc: do not disable sei code in hevc encoder application
Bug: 338446610
Test: ./hevcenc

Change-Id: Ie05ee25b757c1f3d26658d4111a8fb69f91b4a62
2024-06-05 23:39:50 -07:00
Srujan Vandrangi
b2b115e957 libhevc: move encoder SEI related code under a macro
Bug: 338446610
Test: ./hevcenc

Change-Id: I76fa9371aac6ef5fca3723425e0010cf1f13db1f
2024-05-09 07:40:11 -07:00
Srujan Vandrangi
a7874ebcf8 encoder: hevc encoder expects allocation returns zeroed memory
earlier, hevc encoder memory allocation wrappers were not clearing the memory.it requires explicit calling of memset functions wherever required for memory management.

this has been resolved since the memory reset happens with in the function call and returns the zeroed memory whenever it is called and does memory management efficiently.

Bug: 275059745
Bug: 275060007
Bug: 275802472
Bug: oss-fuzz:57397, oss-fuzz:57398, oss-fuzz:57401
Test: hevc_enc_fuzzer
(cherry picked from https://partner-android-review.googlesource.com/q/commit:545fd7bfd22d2894057caac2baa835a082f515fd)
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a0b217f1c0b58547e6732e77cff6306e9b8c7e81)
Merged-In: I76fa9371aac6ef5fca3923435e0010cf2f13db6f
Change-Id: I76fa9371aac6ef5fca3923435e0010cf2f13db6f
2024-03-07 07:04:05 +00:00
Suyog Pawar
1fc3851045 libhevcenc: fix overflow during intermediate computes of qp modulation
Test: ./hevc_enc_fuzzer
Bug: 295984567
2023-10-30 23:59:12 -07:00
Harish Mahendrakar
3f937636db encoder: Fix warnings due to -WSwitch
There were a few switch case blocks that didn't cover all possible
cases.
- ME_USER_DEFINED wasn't used anywhere, so removed it.
- In all the other cases fixed, uncovered cases are not reachable,
so added a default with a log for those cases.

These above changes require some default initializations.

Bug: 244507923
Test: Builds
2023-09-17 21:05:31 -07:00
caoyifeng
2f24f2706f Correct comment spelling error.
Change-Id: Ifa2fcf8a8589b67344b8e12d40fce3f35f92f0b1
Signed-off-by: caoyifeng <caoyifeng@xiaomi.corp-partner.google.com>
2023-08-11 15:54:49 -07:00
wujianxing1
545b769b83 Correct comment spelling error.
Change-Id: I68e8a946086bf14951102d663911737bf55c773c
Signed-off-by: wujianxing1 <wujianxing1@xiaomi.corp-partner.google.com>
2023-08-11 15:54:49 -07:00
Haripriya Deshmukh
8263641644 encoder: configure encoder to support frame rate upto 300
Bug: 282541314
Test: atest CtsMediaV2TestCases:EncoderProfileLevelTest
2023-05-26 01:07:17 -07:00
Harish Mahendrakar
be899d6a6b Fix cmake build for arm 2023-03-27 20:53:41 -07:00
Harish Mahendrakar
276b8b04ce encoder: Add missing checks for preset P7 in a couple of places
Test: hevc_enc_fuzzer
2023-03-24 11:15:34 +05:30
Treehugger Robot
000859511f Merge "cmake: Move hevcdec specific macros to its cmake file" 2022-08-05 20:56:12 +00:00
Harish Mahendrakar
28794b1bb5 cmake: Move hevcdec specific macros to its cmake file
Also in encoder define PROFILE_ENABLE only when not defined

This is need to fix multiple definitions error when building
libhevc using cmake.

Bug: 241484499
Test: Build with cmake

Change-Id: I122b3db8f57604df3a8655ad1b75562fd71cd909
2022-08-04 20:40:33 -07:00
Harish Mahendrakar
cda032bf4e encoder: Fix enum conversion warning
ihevce_rc_conv_pic_type() had an initialization which
was missing a typecast.

Bug: 241128234
Test: Builds

Change-Id: Ie30cd6fcc98a2b6233afc0aaf81bff7a210e7101
2022-08-03 17:36:12 -07:00
Yi Kong
e27fc881dc Fix int-in-bool-context warning am: 6b2208f1c7 am: f98b4617a5
Original change: 2030528

Change-Id: I9794face1f9edd0b14b11c48356a98d3093c9279
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-03-31 03:40:50 +00:00
Yi Kong
6b2208f1c7 Fix int-in-bool-context warning
Test: presubmit
Bug: 148287349
Change-Id: I339ba50154911cc00be5a2f9f4182ae3305733c9
2022-03-30 17:38:15 +00:00
Neelkamal Semwal
ff8f79c0f2 [automerge] hevcenc: Correctly update second best mv candidate in hme coarse layers 2p: 2db516cc99
Original change: 17294547

Bug: 207502397
Change-Id: I6e13a6e85061a3b55512f45c7dfd27419f9a419a
Merged-In: I0bc050ca4804b724bc226d6f00f798696d1b5c65
2022-03-21 15:55:01 +00:00
Neelkamal Semwal
2db516cc99 hevcenc: Correctly update second best mv candidate in hme coarse layers
Test: poc in the bug report
Test: atest CtsMediaV2TestCases:CodecEncoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoEncTest

Bug: 207502397

Change-Id: I0bc050ca4804b724bc226d6f00f798696d1b5c65
(cherry picked from commit 057f2f3aae)
Merged-In: I0bc050ca4804b724bc226d6f00f798696d1b5c65
2022-03-21 15:54:53 +00:00
Treehugger Robot
bdc315d517 Merge "libhevcenc: remove unneeded error check on frame_qp" 2022-02-17 20:07:43 +00:00
Neelkamal Semwal
21da565ddf Builds: Modular cmake scripts added
Add modular Cmake scripts. Separate scripts now handle
build specifications for each target and dependency.

Toolchain files have been added for armv7, armv8 builds.

Bug: 210759503

Test: Builds using cmake
Test: Builds in OSS-fuzz

Change-Id: I5f522d3904907b33a39df52fc06f047be1f21834
2022-02-14 09:45:38 +05:30
Manisha Jajoo
47291ce148 libhevcenc: remove unneeded error check on frame_qp
libhevc encoder library would return error if the configured frame_qp
was not within the range. This patch removes that check on the initial
frame qp as it is clipped to valid range later.

Test: hevcenc -c enc.cfg
Bug: 182015210

Change-Id: I708dd69f2ba7a26eb4b4ee1d3b3585bc16c00d3a
2022-01-19 05:10:52 +00:00
Aayush Soni
270d784c79 libhevcenc: update minimum bitrate check value
Bug: 192129470

Test: POC in bug descriptions

Change-Id: I02a5d1cf886b68513bb20c4a0cfcbe168c072e1e
2021-09-21 07:51:32 +05:30
Xin Li
1b0f117a35 DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Merged-In: I598c50f727b4d62f19523cbb008482e27de5e3cc
Change-Id: I90608242ee02771f107a9bb32c865f37bdf38c0f
2021-06-17 21:46:21 +00:00
Ray Essick
f96e852650 Merge "encoder: Fix entropy sync mode for height <= 64" am: a5f7557e5f am: 082ba20452
Original change: 1629485

Change-Id: I4f1cf898669cca4c209f0e3ea2932f1fb3b69e42
2021-04-28 03:05:58 +00:00
Neelkamal Semwal
9a3fdcc7b7 encoder: Update chroma modules to avoid reading an extra byte am: 45fb34a5a5
Original change: 14008800

Change-Id: Id6ad19a50cd49948c2baee9e4ea9d00536fecdb5
2021-03-31 17:31:00 +00:00
Neelkamal Semwal
45fb34a5a5 encoder: Update chroma modules to avoid reading an extra byte
When processing V plane, an extra byte was being read in some
of the neon modules.
Modules are now updated to avoid that extra byte read.

Bug: 177433559
Bug: 183012467

Test: poc in bug
Test: atest CtsMediaTestCases:VideoEncoderTest
Test: atest CtsMediaV2TestCases:CodecEncoderTest
Test: atest VtsHalMediaC2V1_0TargetVideoEncTest

Change-Id: I598c50f727b4d62f19523cbb008482e27de5e3cc
2021-03-27 04:30:56 +00:00
Aayush Soni
2c273564b9 encoder: Fix entropy sync mode for height <= 64
Test: POC in bug descriptions
Test: hevcenc -c vid_enc_cfg.txt --enable_entropy_sync 1

Bug: 177750322

Change-Id: I761e3e5e375d02e804f46b63ac308483f44bd976
2021-03-15 20:44:10 +05:30
Harish Mahendrakar
2913b0a5c2 encoder: Do not use memcmp for volatile data
memcmp was used in a loop to compare data that
was being updated by other threads.
memcmp doesn't support comparing volatile data.

This is now replaced by a function which
compares the volatile data to zero

Bug: 168427831
Bug: 177354159
Bug: 177483127

Test: atest VtsHalMediaC2V1_0TargetVideoEncTest
Test: atest CtsMediaV2TestCases

Change-Id: I00c5a9ac3e5ae792337017dbbb89d3947687e1e9
2021-01-15 12:39:41 -08:00
Harish Mahendrakar
2c23e26c80 encoder: Fix divide by zero in all intra encoding case
Bug: 173312145
Test: poc in bug
Test: atest android.media.cts.HeifWriterTest
Test: atest android.mediav2.cts

Change-Id: I469c6864ffce5f0019f6be49ff4f3f0a58f04ec1
2020-11-20 14:01:22 -08:00
Ram Mohan
fa4b60c764 libhevcenc: fix bitrate overshoot when lookahead is disabled
When rc lookahead is disabled, next frame encode context becomes NULL.
This context is used to signal end of gop. As this is NULL rc does not
know the end of gop causing over consumption of bits. Rely on intraframe
interval to resolve this.

Also, as there is no scene change detection, default all pics to single scene.

Bug: 140313463
Bug: 168628473
Bug: 166085628
Test: atest android.media.cts.VideoCodecTest

Change-Id: I6dcf9fb52d3aa18935e0b8d9ec9c193b15d30668
2020-09-18 17:56:53 +05:30
Akshata Jadhav
11f1a35e4c libhevcenc: Release async control command buffer am: 4a0581dafa am: 72305e8d1d
Original change: 1323871

Change-Id: Icc06c5ffe94a8a4bbe9c230545b7a1125293b428
2020-06-05 20:47:32 +00:00
Akshata Jadhav
72305e8d1d libhevcenc: Release async control command buffer am: 4a0581dafa
Original change: 1323871

Change-Id: I1374dc16eda67f7e93a4d16cf7ab707c956a80aa
2020-06-05 20:23:21 +00:00
Akshata Jadhav
4a0581dafa libhevcenc: Release async control command buffer
Async command control buffer is not being released after use.
This is corrected.
Also ensured dynamic bitrate doesn't go below min supported bitrate

Test: hevcenc -c vid_enc_cfg.txt
Bug: 147574800
Change-Id: I0e31092bb9c51ce5d22798aab6004d1654ff985e
2020-06-04 15:58:51 -07:00
Treehugger Robot
229e7ee214 Merge "libhevcenc: Add support for force idr picture" am: 3d654001c4 am: 9aaf323625
Change-Id: Ieb0047dc8d7bb6ea3055a7c8f43c4a64f885dd63
2020-03-24 19:29:11 +00:00
Treehugger Robot
7d3321c8be Merge "libhevcenc: Add support for force idr picture" am: 3d654001c4 am: 9aaf323625
Change-Id: Iaa69281191172d8bea92010733c2f87a3b43e139
2020-03-24 19:28:59 +00:00
Akshata Jadhav
35d222d352 libhevcenc: Add support for force idr picture
Test: hevcenc -c vid_enc_cfg.txt
Bug: 135515629
Change-Id: I055dade512277a0bb605f253328cf5ac8af2a64f
2020-03-24 12:20:20 -07:00
TreeHugger Robot
a486b91044 Merge "libhevc: Fix asan issue in intra pred mode assembly function" into qt-qpr1-dev am: 06714eb8e9
Change-Id: Ib5da48774a515af147c7dce1503338b5e4fe4cb5
2020-03-20 02:23:04 +00:00
TreeHugger Robot
e00c85aa34 Merge "libhevc: Fix asan issue in intra pred mode assembly function" into qt-qpr1-dev am: 06714eb8e9
Change-Id: Ib5fc2812400ca7f9cf835033ebdd09bf94c7c09c
2020-03-20 02:22:49 +00:00
Akshata Jadhav
b852cf285c libhevcenc: Add support for force idr picture
Test: hevcenc -c vid_enc_cfg.txt
Bug: 135515629
Change-Id: I055dade512277a0bb605f253328cf5ac8af2a64f
2020-03-13 15:48:53 +05:30
Akshata Jadhav
8d1f374789 libhevc: Fix asan issue in intra pred mode assembly function
chroma intra pred 3_to_9 mode av8 assembly loads 16 bytes ahead of base
address of intermediate buffer but doesnt use it. Allocate this
additional size and offset the same to avoid access violation

Test: hevcenc -c vid_enc_cfg.txt --input selfie_1280_720.yuv --src_width 512 --src_height 512

Bug: 144595488

Change-Id: I1094cf4593ba379354f567876288e2d9b9fae83d
2020-02-11 10:59:12 -08:00
Ray Essick
2d6a15e1ca Merge "libhevcenc: pre enc intra cleanup" am: 3fac63c9b7 am: eb0e8325ae
am: 69dd91e2b1

Change-Id: Ia0d68453a15cd86d38938a2b50f024147f4b8850
2019-12-05 15:12:29 -08:00
Ray Essick
3fac63c9b7 Merge "libhevcenc: pre enc intra cleanup" 2019-12-05 21:54:12 +00:00
Akshata Jadhav
f98edd9a93 Merge "libhevcenc: Move deblk, sao and subpel plane generation into nctb loop" am: f74c2f62dd am: 7b50e40026
am: 5a302f5f2b

Change-Id: Ibad38aaa7604683d6467c37bb2f19cc467ecd780
2019-12-01 14:52:16 -08:00
Treehugger Robot
f74c2f62dd Merge "libhevcenc: Move deblk, sao and subpel plane generation into nctb loop" 2019-12-01 22:45:05 +00:00
Ram Mohan
be44ff1c81 Merge "libhevcenc: default initialize enc ctxt at the start" am: e6689ed5b0 am: 53dfefdaf7
am: c789b735f0

Change-Id: I8414616e8e3d5df59472d7d645f9a9c003a4c71d
2019-11-13 18:46:42 -08:00
Treehugger Robot
e6689ed5b0 Merge "libhevcenc: default initialize enc ctxt at the start" 2019-11-14 02:31:06 +00:00