Commit graph

332 commits

Author SHA1 Message Date
Hamsalekha S
308ae11ce9 am c8581659: Support for level greater than level at init in Decoder
* commit 'c858165962':
  Support for level greater than level at init in Decoder
2015-07-31 19:05:28 +00:00
Hamsalekha S
ed297a4b1e am 8a503281: Support for level greater than level at init in Decoder
* commit '8a50328131':
  Support for level greater than level at init in Decoder
2015-07-31 19:02:26 +00:00
Hamsalekha S
e3da14c4e7 am e789d1d2: Decoder: Fixed issues shown by Valgrind
* commit 'e789d1d2e2':
  Decoder: Fixed issues shown by Valgrind
2015-07-31 19:02:25 +00:00
Martin Storsjo
43af91db4e am bbc83b16: Don\'t use side effects in the macro PUT_BITS_SEV parameters
* commit 'bbc83b16b9':
  Don't use side effects in the macro PUT_BITS_SEV parameters
2015-07-31 19:02:23 +00:00
Harinarayanan K K
6423373ac5 am dbe9ac89: Made gops closed
* commit 'dbe9ac8936':
  Made gops closed
2015-07-31 19:02:20 +00:00
Martin Storsjo
55dc090755 am 860f7520: Always do recon of 4x4 intra blocks
* commit '860f75203e':
  Always do recon of 4x4 intra blocks
2015-07-31 19:02:19 +00:00
Martin Storsjo
9a3e4479ae am 33134b26: Validate the u4_entropy_coding_mode field
* commit '33134b2617':
  Validate the u4_entropy_coding_mode field
2015-07-31 19:02:18 +00:00
Harinarayanan K K
63ac809183 am 8ce82804: Fixed issue in cost computation for BIPRED ME
* commit '8ce82804ab':
  Fixed issue in cost computation for BIPRED ME
2015-07-31 19:02:18 +00:00
Doney Alex
34cdc7fc18 am 0574be65: Cabac optimizations
* commit '0574be65f4':
  Cabac optimizations
2015-07-31 19:02:17 +00:00
Martin Storsjo
67e59edb69 am eddf6a33: Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
* commit 'eddf6a33fe':
  Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
2015-07-31 19:02:16 +00:00
Martin Storsjo
81ce210ab5 am 6fb90f8f: Make sure that apv_bufs[0] and u4_is_last always are set
* commit '6fb90f8fec':
  Make sure that apv_bufs[0] and u4_is_last always are set
2015-07-31 19:02:15 +00:00
Martin Storsjo
44bf7d013d am dc4c6140: avcenc: Initialize avg_time
* commit 'dc4c6140a9':
  avcenc: Initialize avg_time
2015-07-31 19:02:14 +00:00
Martin Storsjo
37247e1a4b am a6bcaf36: Check the width/height and adjust level used for RC
* commit 'a6bcaf3690':
  Check the width/height and adjust level used for RC
2015-07-31 18:53:29 +00:00
Harinarayanan K K
21e6c0c5c7 am 01168dc0: Fixed encode of trailing B frames
* commit '01168dc07e':
  Fixed encode of trailing B frames
2015-07-31 18:53:28 +00:00
Martin Storsjo
ad9fb1869b am b0aadd0c: Remove the now unused stride field from the set dimensions struct
* commit 'b0aadd0c45':
  Remove the now unused stride field from the set dimensions struct
2015-07-31 18:53:27 +00:00
Harinarayanan K K
74c858ae94 am 0cf554f7: Fixed encode of single frame
* commit '0cf554f73b':
  Fixed encode of single frame
2015-07-31 18:53:26 +00:00
Martin Storsjo
9aada81fcd am 4b09a8c0: Don\'t declare variables after statements
* commit '4b09a8c011':
  Don't declare variables after statements
2015-07-31 18:53:25 +00:00
Martin Storsjo
a7935f26f1 am 698de0ed: Mark arrays of pointers as const
* commit '698de0ed5c':
  Mark arrays of pointers as const
2015-07-31 18:53:25 +00:00
Martin Storsjo
c3f753bbb6 am 970dfc0e: Don\'t set -mno-avx
* commit '970dfc0e82':
  Don't set -mno-avx
2015-07-31 18:53:23 +00:00
Martin Storsjo
0b751f46ac am 61791a91: Remove double semicolons (empty statements)
* commit '61791a91be':
  Remove double semicolons (empty statements)
2015-07-31 18:53:22 +00:00
Hamsalekha S
8a50328131 Support for level greater than level at init in Decoder
Added support to check num_ref_frames  in SPS
and num_reorder_frames in VUI before returning error for level

Bug: 22860270

Change-Id: I392bab419385ca239836d200f9f2b064915a8a46
2015-07-31 18:53:17 +00:00
Hamsalekha S
e789d1d2e2 Decoder: Fixed issues shown by Valgrind
The slice header structure has now been initialized to 0
Fixed bug in closing of threads in the case of error.

Bug: 22860270

Change-Id: I777e0b73ad2f083c72be179984f5c1cb00ededb6
2015-07-31 18:52:32 +00:00
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
dc4c6140a9 avcenc: Initialize avg_time
This fixes valgrind warnings when encoding with b-frames.

Bug: 22860270

Change-Id: I922314e5e6fd09db3ba60e60863e2611309886d5
2015-07-31 18:50:02 +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
698de0ed5c Mark arrays of pointers as const
Previously they were only marked as the pointers pointing to const
data, but the array themselves being non-const.

Bug: 22860270

Change-Id: Ib5a9af6298615b2c40367a21e728899418b09935
2015-07-31 18:47:25 +00:00
Martin Storsjo
970dfc0e82 Don't set -mno-avx
There is no point in intentionally disabling this feature; it
isn't enabled by default by the compiler - and if it were to be
enabled by default (if the toolchain baseline includes it, because
it can be expected to be supported everywhere) there would be no
reason to disable it.

Bug: 22860270

Change-Id: I67019eea63c4fb7183d9e47cf16bc8485022fef2
2015-07-31 18:47:07 +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
Hamsalekha S
09cb983ae8 am 90bd0454: Decoder: Fixed issues shown by Valgrind
* commit '90bd045476':
  Decoder: Fixed issues shown by Valgrind
2015-07-29 15:18:34 +00:00
Hamsalekha S
c858165962 Support for level greater than level at init in Decoder
Added support to check num_ref_frames  in SPS
and num_reorder_frames in VUI before returning error for level

Change-Id: I392bab419385ca239836d200f9f2b064915a8a46
2015-07-29 14:42:35 +00:00
Hamsalekha S
90bd045476 Decoder: Fixed issues shown by Valgrind
The slice header structure has now been initialized to 0
Fixed bug in closing of threads in the case of error.

Change-Id: I777e0b73ad2f083c72be179984f5c1cb00ededb6
2015-07-29 16:15:30 +05:30
Marco Nelissen
c53965cb67 am 1cd52d60: Merge "Don\'t use side effects in the macro PUT_BITS_SEV parameters"
* commit '1cd52d608f':
  Don't use side effects in the macro PUT_BITS_SEV parameters
2015-07-28 20:32:44 +00:00
Harinarayanan K K
777448fc16 am aad45873: Made gops closed
* commit 'aad4587335':
  Made gops closed
2015-07-28 20:32:43 +00:00
Marco Nelissen
21949e6000 am 634567f1: Merge "Always do recon of 4x4 intra blocks"
* commit '634567f170':
  Always do recon of 4x4 intra blocks
2015-07-28 20:32:37 +00:00
Martin Storsjo
1da9fc7cd8 am 5696adb5: Validate the u4_entropy_coding_mode field
* commit '5696adb5ec':
  Validate the u4_entropy_coding_mode field
2015-07-28 20:32:35 +00:00
Harinarayanan K K
ea4fec2a8c am b7d5bb5e: Fixed issue in cost computation for BIPRED ME
* commit 'b7d5bb5e2a':
  Fixed issue in cost computation for BIPRED ME
2015-07-28 20:32:33 +00:00
Doney Alex
4a578ca1be am 9c6a2f78: Cabac optimizations
* commit '9c6a2f78dd':
  Cabac optimizations
2015-07-28 20:32:31 +00:00
Martin Storsjo
3d970f95be am 0fee9486: Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
* commit '0fee94865a':
  Use INT_MAX as i4_max_sad in ih264e_evaluate_bipred
2015-07-28 20:32:30 +00:00
Martin Storsjo
dd27b57b34 am 8e78e306: Make sure that apv_bufs[0] and u4_is_last always are set
* commit '8e78e306bb':
  Make sure that apv_bufs[0] and u4_is_last always are set
2015-07-28 20:32:29 +00:00