Commit graph

123 commits

Author SHA1 Message Date
Android Build Merger (Role)
2e1c177836 [automerger] Encoder: Return error for odd resolution am: 9fa58d4db3 am: f56e0c0ed3 am: db53adff11 am: 538e4ed787 am: c8fc4c0206
Change-Id: Iafdb9ee561ac366c63959b5b392e37fe81771a9f
2018-04-14 18:38:56 +00:00
Android Build Merger (Role)
c8fc4c0206 [automerger] Encoder: Return error for odd resolution am: 9fa58d4db3 am: f56e0c0ed3 am: db53adff11 am: 538e4ed787
Change-Id: I58ab8312cb0a5a4bd85eedb2ff55f2c82fa5e79d
2018-04-14 18:38:55 +00:00
Android Build Merger (Role)
f56e0c0ed3 [automerger] Encoder: Return error for odd resolution am: 9fa58d4db3
Change-Id: I4b71af182f1d2be051bc831dfe134b4c012048af
2018-04-14 18:38:50 +00:00
Akshata Jadhav
9fa58d4db3 Encoder: Return error for odd resolution
Bug: 73625898
Test: ran POC before/after under ASAN
Change-Id: I9765b57f4afc6a2b6ad9cd19c8c7c5000beb9de9
2018-02-28 15:36:46 -08:00
Doney Alex
983e1aecd4 Encoder: Added support for configuring VUI parameters.
Bug: 27442922

Change-Id: I781195e78c480e7449f49467abb1df71902e568d
2016-07-12 14:41:59 -07:00
Doney Alex
6581cbf841 DO NOT MERGE Encoder: Fixed adaptive intra refresh.
Earlier if an MB was coded as intra in the previous frame,
corresponding MB in the current frame will not be coded as intra
even though it was supposed to be intra according to adaptive intra refresh.
Now the MB will honour adaptive intra refresh irrespective of its type
in previous frame.

Change-Id: Icc84ddf962dad6f7d1f4d11e9cb2a37bcda567b8
2016-03-12 00:11:40 +00:00
Doney Alex
dfe686ad4a DO NOT MERGE Encoder: Added support for Constrained intra prediction.
Change-Id: I674746047b2b007ca4bc52fad1a2cd9b177cd7bb
2016-03-11 22:10:12 +00:00
Harish Mahendrakar
089f41d1f5 Encoder: Fixed an out of bound write in AIR map
pu2_intr_rfrsh_map was initialized with a wrong pointer which was
resulting in an out of bound write.
This was resulting in inconsistent output between runs when AIR was
enabled

Bug: 27076302

Change-Id: I1f36936837e3cb221ff218c3c6e7b8b20a0e26a7
2016-02-10 10:23:36 -08:00
Dan Willemsen
1c01bc10a9 Remove __DATE__/__TIME__ from Android builds
This removes unnecessary changes from build to build.

Bug: 24204119
Change-Id: I25258314fe56ea186d38d756fb5fb04aa689a812
(cherry picked from commit f197ccb756)
2015-10-30 21:54:53 +00:00
Dan Willemsen
f197ccb756 Remove __DATE__/__TIME__ from Android builds
This removes unnecessary changes from build to build.

Bug: 24204119
Change-Id: I25258314fe56ea186d38d756fb5fb04aa689a812
2015-10-27 17:52:13 -07:00
Hamsalekha S
126d84e0d3 Encoder added support for VUI params
SPS will now include vui params
Removed a trailing space in ih264e_api.c

Change-Id: I67a57741689206e571e9a83f7e3360149f87e06a
2015-10-09 11:35:29 -07:00
Hamsalekha S
4202606c70 Encoder added support for VUI params
SPS will now include vui params
Removed a trailing space in ih264e_api.c

Change-Id: I67a57741689206e571e9a83f7e3360149f87e06a
2015-08-04 11:27:29 +05:30
Ronghua Wu
374e7a8984 Merge "Encoder: Fixed an issue in handling FPS greater than 60" into mnc-dev 2015-08-03 18:07:01 +00:00
Harish Mahendrakar
bb1543bd85 Encoder: Fixed an issue in handling FPS greater than 60
FPS > 60 was resulting in an integer overflow, so using float now.

Bug: 22504214
Change-Id: I4626ba6a43167c00c42dd6440df37bd1eb1f151a
2015-08-03 09:45:14 -07:00
Harish Mahendrakar
2eaba5ebd1 Encoder: Fixed an issue in handling FPS greater than 60
FPS > 60 was resulting in an integer overflow, so using float now.

Change-Id: I4626ba6a43167c00c42dd6440df37bd1eb1f151a
2015-08-03 12:13:51 +05:30
Martin Storsjo
bbc83b16b9 Don't use side effects in the macro PUT_BITS_SEV parameters
If ENTROPY_TRACE is defined, the value parameter gets evaluated
twice. Since this parameter includes ++, the pointer gets incremented
twice.

This fixes encoding with trace enabled.

Bug: 22860270

Change-Id: I3d71ac33d007301e488d264a33c7b5c4d4ff2b56
2015-07-31 18:51:33 +00:00
Harinarayanan K K
dbe9ac8936 Made gops closed
Now no picture in a gop will depend on any picture in the previous gop

All calls to force an IDR are respected as soon as possible

Bug: 22860270

Change-Id: Id2bcd5687c3fb786336a01894c1b9228d67a87a6
2015-07-31 18:51:20 +00:00
Martin Storsjo
860f75203e Always do recon of 4x4 intra blocks
Even if this 4x4 block isn't at the bottom or right border,
the other 4x4 intra blocks within the same macroblock may
use it for intra prediction.

This fixes intra coded macroblocks in b-frames.

Bug: 22860270

Change-Id: Ifdf48c1b2bbf232e785d6d5b8244aacba1ad3dd6
2015-07-31 18:51:09 +00:00
Martin Storsjo
33134b2617 Validate the u4_entropy_coding_mode field
Previously, if this field wasn't set, the invalid coding mode
could lead to crashes later.

Bug: 22860270

Change-Id: If8dd2f8d5f2fbdd6bb76772344f959df23159167
2015-07-31 18:51:00 +00:00
Harinarayanan K K
8ce82804ab Fixed issue in cost computation for BIPRED ME
BIPRED ME was discarding the halfpel motion vector components
in cost computation. That is fixed now.

Bug: 22860270

Change-Id: If6c77096d701a258920b14134ff120fd1540f254
2015-07-31 18:50:48 +00:00
Doney Alex
0574be65f4 Cabac optimizations
Optimized cabac functions for writing bypass bins.
Removed unused return from cabac flush function.
Removed the macro REV_NBITS.

Bug: 22860270

Change-Id: Iece82797f2f45a35281817a2b77a7c7fe4e02bd1
2015-07-31 18:50:37 +00:00
Martin Storsjo
eddf6a33fe Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
The stored i4_mb_distortion that was used as i4_max_sad previously
might come from a different coding mode - even if
pf_ime_compute_sad_16x16 returns early when i4_mb_distortion is
larger than ps_mb_ctxt_bi->i4_mb_distortion, the calculated i4_mb_cost
can still end up smaller than ps_mb_ctxt_bi->i4_mb_cost.

Therefore, set i4_max_sad to INT_MAX to avoid the early exit in
pf_ime_compute_sad_16x16 here, since it can't be used reliably (and
returning early can end up choosing a suboptimal mode).

This makes sure that the encoded output is identical when the SIMD
optimized routines are disabled, when using B-frames.

Bug: 22860270

Change-Id: I9b8d524f88020e557541700133c7a0b48fe6a3b8
2015-07-31 18:50:26 +00:00
Martin Storsjo
6fb90f8fec Make sure that apv_bufs[0] and u4_is_last always are set
When encoding in header mode, the s_inp_buf struct that was written
to ps_video_encode_op->s_ive_op.s_inp_buf was completely uninitialized.

In ih264e_input_queue_update, make sure to initialize u4_is_last
when skipping frames.

Bug: 22860270

Change-Id: I87e677acd00baf4f732ca7d35ee192e7f1f73994
2015-07-31 18:50:12 +00:00
Martin Storsjo
a6bcaf3690 Check the width/height and adjust level used for RC
Since 6cb6772805, the actual level used is
MAX(u4_max_level, ih264e_get_min_level()), which means that it isn't
a fatal error to set u4_max_level to a too low level (if the caller
doesn't know or care). Despite this, the actual value set by the caller
was still used for initializing the RC.

This allows the caller to not have to set u4_max_level (currently
every caller has to duplicate a table or code snippet for determining
the right level for each resolution). The caller still can set it
to a higher value if he wants to explicitly use a higher level than
what is necessary.

This makes sure that the output is identical even if u4_max_level is
set too low.

Bug: 22860270

Change-Id: Icdc6c0652a97568d1eafc050226357a9d643d809
2015-07-31 18:49:17 +00:00
Harinarayanan K K
01168dc07e Fixed encode of trailing B frames
In case a P frame was marked as the last frame to encode, the B frames
previous to it in the same gop were not getting encoded. This is fixed now.

Bug: 22860270

Change-Id: I871f2a1d52b8db9ee75426b00287b58203586f23
2015-07-31 18:48:48 +00:00
Martin Storsjo
b0aadd0c45 Remove the now unused stride field from the set dimensions struct
Since 90a3904fd3 and d020be5ac7, this field doesn't have any actual
effect - the strides are taken from the input pictures.

Bug: 22860270

Change-Id: I9b08cbf8ee558e038d0017a6176d7b3bd3c428bd
2015-07-31 18:48:14 +00:00
Harinarayanan K K
0cf554f73b Fixed encode of single frame
Encoding a single frame used to make encoder to go into infinite
loop. That is fixed now

Bug: 22860270

Change-Id: I51752bdc5fd6071868884c2ff6074c14d05c8564
2015-07-31 18:47:56 +00:00
Martin Storsjo
4b09a8c011 Don't declare variables after statements
This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.

(The previous version of this commit was originally made before
the commit adding support for main profile, which added a bunch
more similar issues.)

Bug: 22860270

Change-Id: I0a927deb2ef4125f79429d108439e249fa531607
2015-07-31 18:47:37 +00:00
Martin Storsjo
61791a91be Remove double semicolons (empty statements)
Some compilers can't handle this, and these occurrances are typos.

Bug: 22860270

Change-Id: I82349f103cef1f196d1a85dae307aff83c7d6090
2015-07-31 02:11:31 +00:00
Marco Nelissen
1cd52d608f Merge "Don't use side effects in the macro PUT_BITS_SEV parameters" 2015-07-28 19:16:42 +00:00
Harinarayanan K K
aad4587335 Made gops closed
Now no picture in a gop will depend on any picture in the previous gop

All calls to force an IDR are respected as soon as possible

Change-Id: Id2bcd5687c3fb786336a01894c1b9228d67a87a6
2015-07-28 19:14:39 +00:00
Marco Nelissen
634567f170 Merge "Always do recon of 4x4 intra blocks" 2015-07-28 18:53:44 +00:00
Martin Storsjo
5696adb5ec Validate the u4_entropy_coding_mode field
Previously, if this field wasn't set, the invalid coding mode
could lead to crashes later.

Change-Id: If8dd2f8d5f2fbdd6bb76772344f959df23159167
2015-07-28 18:52:05 +00:00
Harinarayanan K K
b7d5bb5e2a Fixed issue in cost computation for BIPRED ME
BIPRED ME was discarding the halfpel motion vector components
in cost computation. That is fixed now.

Change-Id: If6c77096d701a258920b14134ff120fd1540f254
2015-07-28 18:50:14 +00:00
Doney Alex
9c6a2f78dd Cabac optimizations
Optimized cabac functions for writing bypass bins.
Removed unused return from cabac flush function.
Removed the macro REV_NBITS.

Change-Id: Iece82797f2f45a35281817a2b77a7c7fe4e02bd1
2015-07-28 18:48:57 +00:00
Martin Storsjo
0fee94865a Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
The stored i4_mb_distortion that was used as i4_max_sad previously
might come from a different coding mode - even if
pf_ime_compute_sad_16x16 returns early when i4_mb_distortion is
larger than ps_mb_ctxt_bi->i4_mb_distortion, the calculated i4_mb_cost
can still end up smaller than ps_mb_ctxt_bi->i4_mb_cost.

Therefore, set i4_max_sad to INT_MAX to avoid the early exit in
pf_ime_compute_sad_16x16 here, since it can't be used reliably (and
returning early can end up choosing a suboptimal mode).

This makes sure that the encoded output is identical when the SIMD
optimized routines are disabled, when using B-frames.

Change-Id: I9b8d524f88020e557541700133c7a0b48fe6a3b8
2015-07-28 18:47:19 +00:00
Martin Storsjo
8e78e306bb Make sure that apv_bufs[0] and u4_is_last always are set
When encoding in header mode, the s_inp_buf struct that was written
to ps_video_encode_op->s_ive_op.s_inp_buf was completely uninitialized.

In ih264e_input_queue_update, make sure to initialize u4_is_last
when skipping frames.

Change-Id: I87e677acd00baf4f732ca7d35ee192e7f1f73994
2015-07-28 18:46:30 +00:00
Martin Storsjo
cc58d3f491 Check the width/height and adjust level used for RC
Since 6cb6772805, the actual level used is
MAX(u4_max_level, ih264e_get_min_level()), which means that it isn't
a fatal error to set u4_max_level to a too low level (if the caller
doesn't know or care). Despite this, the actual value set by the caller
was still used for initializing the RC.

This allows the caller to not have to set u4_max_level (currently
every caller has to duplicate a table or code snippet for determining
the right level for each resolution). The caller still can set it
to a higher value if he wants to explicitly use a higher level than
what is necessary.

This makes sure that the output is identical even if u4_max_level is
set too low.

Change-Id: Icdc6c0652a97568d1eafc050226357a9d643d809
2015-07-28 18:44:06 +00:00
Marco Nelissen
a306c95201 Merge "Fixed encode of trailing B frames" 2015-07-28 18:43:47 +00:00
Marco Nelissen
d0603c30a6 Merge "Remove the now unused stride field from the set dimensions struct" 2015-07-28 18:42:28 +00:00
Harinarayanan K K
f080d51500 Fixed encode of single frame
Encoding a single frame used to make encoder to go into infinite
loop. That is fixed now

Change-Id: I51752bdc5fd6071868884c2ff6074c14d05c8564
2015-07-28 18:37:38 +00:00
Martin Storsjo
9fbffcfb6e Don't declare variables after statements
This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.

(The previous version of this commit was originally made before
the commit adding support for main profile, which added a bunch
more similar issues.)

Change-Id: I0a927deb2ef4125f79429d108439e249fa531607
2015-07-28 18:35:54 +00:00
Martin Storsjo
a77fc521ca Don't use side effects in the macro PUT_BITS_SEV parameters
If ENTROPY_TRACE is defined, the value parameter gets evaluated
twice. Since this parameter includes ++, the pointer gets incremented
twice.

This fixes encoding with trace enabled.

Change-Id: I3d71ac33d007301e488d264a33c7b5c4d4ff2b56
2015-07-18 17:30:44 +03:00
Martin Storsjo
17c7e8e151 Always do recon of 4x4 intra blocks
Even if this 4x4 block isn't at the bottom or right border,
the other 4x4 intra blocks within the same macroblock may
use it for intra prediction.

This fixes intra coded macroblocks in b-frames.

Change-Id: Ifdf48c1b2bbf232e785d6d5b8244aacba1ad3dd6
2015-07-02 13:22:18 +03:00
Harinarayanan K K
4d35438288 Fixed encode of trailing B frames
In case a P frame was marked as the last frame to encode, the B frames
previous to it in the same gop were not getting encoded. This is fixed now.

Change-Id: I871f2a1d52b8db9ee75426b00287b58203586f23
2015-06-29 15:04:53 +05:30
Martin Storsjo
18e256879b Remove the now unused stride field from the set dimensions struct
Since 90a3904fd3 and d020be5ac7, this field doesn't have any actual
effect - the strides are taken from the input pictures.

Change-Id: I9b08cbf8ee558e038d0017a6176d7b3bd3c428bd
2015-06-27 09:28:24 +03:00
Martin Storsjo
76cdaed5fa Remove double semicolons (empty statements)
Some compilers can't handle this, and these occurrances are typos.

Change-Id: I82349f103cef1f196d1a85dae307aff83c7d6090
2015-06-27 00:42:57 +03:00
Marco Nelissen
f73e92aff1 Fix MIPS build
Change-Id: I8190ce01d313f987f142a0c7ef5ae31f01562510
2015-06-25 10:43:24 -07:00
Martin Storsjo
086dd8ea90 Don't declare variables after statements
This fixes building with compilers that are strict about the pre-C99
rule about having all variable declarations before statements.

Change-Id: I06dd0cc42a6dbe90025c3c913a0c8d9ffb0acbcb
2015-06-25 08:25:58 -07:00
Martin Storsjo
4adb9f4923 Reorder code to avoid reading uninitialized data
If the current slice isn't BSLICE, u1_weighted_bipred_idc is
uninitialized, which valgrind can complain about (mostly in uninitialized
builds). By reordering the conditions, we avoid doing conditional
jumps based on uninitialized data.

Change-Id: I4d601fd1a4e34d85fe5992ecb934ac3747953960
2015-06-25 08:25:57 -07:00