Commit graph

31 commits

Author SHA1 Message Date
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
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
Ray Essick
e73988415f Merge "libhevcenc: reduce output buffer latency for B picture" am: fc394ef8ce am: 130dae5eaa
am: 3f6dc24f13

Change-Id: I6ccdc44eb9e672aa3338d7bee727f96dd457f7e9
2019-11-13 16:12:42 -08:00
Ray Essick
fc394ef8ce Merge "libhevcenc: reduce output buffer latency for B picture" 2019-11-13 23:06:44 +00:00
Ram Mohan
0974060412 libhevcenc: pre enc intra cleanup
code associated with pre enc intra processing is cleaned up.
Unreachable code and debug code is removed. Structure members that
are unused or used for debugging purpose are removed. Control
code is simplified. This helps in memory footprint and object size
foot print.

Test: hevcenc -c vid_enc_cfg.txt
Bug: 139400699
Change-Id: I7697b05ea1d470d93bdb9cb14304cb0bfefd8054
2019-11-08 13:22:26 -08:00
Ram Mohan
efef6bf1f2 libhevcenc: reduce memory consumption am: 40ed9a784a am: 249cf251b5
am: 289e13445d

Change-Id: I8e0b7af880b7b2eff8955e7efc3ef1186f7c0b73
2019-11-08 13:07:09 -08:00
Ram Mohan
40ed9a784a libhevcenc: reduce memory consumption
1. Removed excess buffer contexts between core encoding and entropy
2. Allocate memory for lookahead feature on a need basis as opposed to
allocation based on a pre-defined macro
3. Removed unused/debug structure members

Test: hevcenc -c vid_enc_cfg.txt
Bug: 139400088
Change-Id: Ibc7228181b51ec97f355b3657df87d70f207cdd9
2019-11-08 17:46:09 +05:30
Akshata Jadhav
afb1deb1b3 libhevcenc: Move deblk, sao and subpel plane generation into nctb loop
Currently deblocking, sao and subpel plane generation are happening for every
CTB serially. This change enables deblocking to be finished for the entire row first.
Then performs SAO for the entire row and finally performs subpel plane
generation for the entire row. This change does not have any effect on the
end bitstream but is expected to give performance gains on devices with
low instruction cache.

On arm platforms, it is noticed that for P5 preset, performance is improved by 15%.

Test: hevcenc -c vid_enc_cfg.txt
Bug: 135510351

Change-Id: I6d09e6cc1d36e967a9b3dd3e68f75bdd0b476a1c
2019-10-11 12:09:30 -07:00
Ram Mohan
ceed88e597 libhevcenc: default initialize enc ctxt at the start
When cu level rc is enabled, the lagrange param is left
uninitialized at the start of row. This is causing the
outputs to vary from run to run when multi-thread is
enabled, for a given input and encoding options. This is
now corrected.

Test: hevcenc -c vid_enc_cfg.txt
Bug: 139402085
Change-Id: Ic9693e9a547d9d5dc1c3b7ef4a46640850723829
2019-10-10 18:55:10 +05:30
Akshata Jadhav
5d67b44791 libhevcenc: deblk sao low res race condition am: 50408aad50 am: bf1e9088dc am: d52ce65b76
am: 02273aa048

Change-Id: I50765a3ab78d597a5aca43a23939ec8612491fff
2019-10-07 15:23:07 -07:00
Akshata Jadhav
50408aad50 libhevcenc: deblk sao low res race condition
While encoding inputs for size 64 x ht for ht > 64, there is a possible
race condition. Before performing deblocking/sao for current CTB, its
top right CTB is checked for its deblocking/sao completion. This can be
skipped for last CTB of a row, provided you have atleast 2 CTB's per row.
The skip is happening for rows with single CTB as well. This is corrected.

Test: hevcenc -c vid_enc_cfg.txt --src_width 64 --src_height 512 \
--input night_64x512.yuv --num_cores 4
Bug: 135516662

Change-Id: Ifed1ae25e5e460cb59d84533e5ad87730ebb3395
2019-10-04 15:56:49 -07:00
Akshata Jadhav
2247be3289 libhevcenc: reduce output buffer latency for B picture
Output receive buffer was waiting for one extra picture,
corrected latency.

Bug:135986218
Test: hevcenc -c vid_enc_cfg.txt --max_temporal_layers 1

Change-Id: I2623e59e1b62d1fcbe432f0fe0bab6350ab23889
2019-10-04 15:39:25 -07:00
Ram Mohan
66444824d3 libhevcenc: integer overflow in vui
Fixes integer overflow seen in low bitrate encoding or
in constant qp encoding at lower levels.

Test: hevcenc --rate_control_mode 3 --codec_level 63 --input football_qvga.yuv\
 --src_width 320 --src_height 240 --output out.265 --tgt_bitrate 128000 \
 --vui_enable 1  --num_frames_to_encode -1

Bug: 134139339
Change-Id: Ifa5b35fc680f09009f76105a0ee4778683b7fcad
2019-06-13 15:28:33 -07:00
Wonsik Kim
1e1bf6f80d Merge "libhevcenc: Add support for dynamic change in bitrate" into qt-dev 2019-05-28 18:41:54 +00:00
TreeHugger Robot
74e2f92937 Merge "libhevcenc: fix few isan and usan issues" into qt-dev 2019-05-22 21:24:32 +00:00
Akshata Jadhav
5c55da9913 libhevcenc: Add support for dynamic change in bitrate
Test: hevcenc -c vid_enc_cfg.txt
Bug: 125938526

Change-Id: I3c45cf5ebf6348024a5632025f042b1a3c2544d9
2019-05-20 16:58:32 -07:00
Ram Mohan
c6b8260fc9 libhevcenc: clip frame qp to configured bounds
In one of the returns paths from rc library, it is seen that frame qp is
exceeding the max value configured. At extremely low bitrates, this is
exceeding the max allowable qp and is causing access violation.

Test: hevcenc -c vid_enc_cfg.txt --tgt_bitrate 64000
Bug: 130018957
Test: poc
Change-Id: Iff64c73752d2fd795276678b0d681ab10b550750
(cherry picked from commit 79b1da48eb)
2019-05-15 22:03:54 +00:00
Ram Mohan
0bd715ca06 libhevcenc: fix few isan and usan issues
1. While encoding uniform content, it is possible to have perfect
prediction, thus yielding zero distortion. Ratio of Log(cu distortion),
Log(avg cu distortion) is used in cu level qp modulation.
So avoid log(zero) calls.
2. Limit peak-br to twice of tgt-br.

Test: hevcenc -c vid_enc_cfg.txt --input night_320x240_1.yuv --src_width 320 --src_height 240
Bug: 130019940
Change-Id: I9ec68e385b06af25f216c51bcb90910750a5b3bf
(cherry picked from commit 79d3f2a354)
2019-05-15 21:45:55 +00:00
TreeHugger Robot
aa9b5a11f1 Merge "encoder: Allow minimum frame rate of 1" into qt-dev 2019-05-11 01:44:17 +00:00
TreeHugger Robot
3dc3e414dc Merge "libhevcenc: reduce min resolution from 320x240 to 2x2" into qt-dev 2019-05-10 22:55:00 +00:00
Harish Mahendrakar
6147147cdf encoder: Allow minimum frame rate of 1
Earlier min frame rate allowed was 7.5.
Encoder now supports min frame rate of 1 which is needed for image
encoding

Bug: 132450110
Test: With HeifWriter demo application for 512x512 image
Change-Id: I1c39ecef3f489d9acc3ae1e6ef8f7ad587b3f2e1
2019-05-10 15:43:36 -07:00
Ram Mohan
c0745f1209 libhevcenc: reduce min resolution from 320x240 to 2x2
Test: hevcenc -c vid_enc_cfg.txt
Bug: 129763447

Change-Id: If4dbaba1086694fd2030b05c232988d8c1807fea
2019-05-03 21:36:21 +00:00
Ram Mohan
c7fa48a5c3 libhevcenc: integrate missing neon function in preset P0
C/neon behaviour earlier differed (Neon was correct).  This is corrected.

Test: hevcenc -c vid_enc_cfg.txt
Bug: 129762743
Change-Id: I0e59ee371a3d3b9902bcce1d1188856fb169fb8a
2019-05-03 21:35:01 +00:00
Ram Mohan
69da5e22f6 libhevcenc: Initial commit
Test: hevcenc -c vid_enc_cfg.txt

Bug: 110456253
Test: CtsMediaTests/VideoEncoder
Change-Id: I9df8143709c3fe5d2c8398974a16529a3f8b8ebc
2019-02-18 07:43:11 -08:00