Commit graph

19 commits

Author SHA1 Message Date
Harish Mahendrakar
59348127de Decoder: Fixed an issue in handling flush
Fixed a NULL pointer reference, when flush is called before
decoding any pictures.

This was seen in following CTS test,
android.media.cts.DecoderTest#testCodecResetsH264WithSurface

Fixed code formatting issues in ih264d_set_flush_mode
Updated the testbench to call flush before decoding starts

Bug: 24405410

Change-Id: Ib04e0b15573b2482c9d5b43c8bc7dd30d8f8efdd
2015-09-25 22:24:55 +00:00
Harish Mahendrakar
251b007ecc Decoder: Reduced memory requirements
Memory allocations are now done based on contents of SPS
API changed to move allocations inside the library

Also changed strlen to strnlen

Bug: 24221026

Change-Id: I9130457f564cddb4da7ec6399cc9fe88ee871217
2015-09-23 18:35:27 +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
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
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
Martin Storsjo
c4355642ba avcenc: Make sure that "avcenc --help" works as intended
The --help option is handled by the normal argument parsing loop
below, but that is only invoked if argc > 2.

Change-Id: Icff3625412c340565c062628f2657c41db73068e
2015-06-25 08:25:56 -07:00
Martin Storsjo
85783df984 avcenc: Check that enough arguments exist before parsing
Each round in the loop uses both argv[i] and argv[i + 1].

This fixes crashes if given an odd number of parameters, 3 or
more.

Change-Id: I9b8be99042eb7d0f69ebd87166d9cc920d15a950
2015-06-25 08:25:55 -07:00
Harinarayanan K K
7dbacdf765 Added code to handle cases with qp less than 10
When qp goes less than 10, all I16x16 mode evaluations
are disabled and I4x4 evaluations are enabled irrespective
of preset. This will ensure that the residual will not
exceed the supported range of entropy

Minimum Qp cannot be set less than 4 now. When QP goes lesser,
the residual may exceed the supported range even with I4x4 enabled.

Change-Id: I25b404fcd9c9e9dbdd77679280968635ee047eb3
2015-06-25 08:25:54 -07:00
Harinarayanan K K
d3e18f0c88 Reduced memory requirements.
Buffer allocation is based on minimum level required for the
input resolution rather than the input max level.

Number of maximum context sets can be set to 1 to reduce
memory usage.

Added a macro ENC_MIN_PU_SIZE for minimum size of
inter prediction unit supported by encoder.

Changed the maximum constraint on number of MBs for NMB
processing to width in Mbs.

Change-Id: I5a9255e93935d90c13262681aafc772aedf8ae81
2015-06-25 08:25:54 -07:00
Martin Storsjo
a932f734ab Don't include <sys/time.h> if WINDOWS_TIMER is set
If WINDOWS_TIMER is set, windows.h is supposed to be used instead,
and sys/time.h isn't available.

This reduces the amount of duplicated include directives in the test
apps.

Change-Id: I223d80c4ccaed2aab55e3aae66dab903ecacef7a
2015-06-25 08:25:45 -07:00
Martin Storsjo
796c0d475a Remove unnecessary calls to ithread_exit
The ithread_exit wrapper function behaves inconsistently across
platforms; on windows, the argument is a thread handle, denoting
the thread that will be exited. On pthreads, ithread_exit only
terminates the current thread, not any other thread.

These both calls are at the end of each thread function (and the one
with a non-null parameter refers to the handle of the thread itself),
so the thread will exit immediately anyway.

Change-Id: I21e43c56874729452bd80b28ff351e3c5d3f087e
2015-06-25 08:25:44 -07:00
Hamsalekha S
9f0dcba9b4 Improved error resilience in decoder
Fixed buffer management for error cases
Fixed end of picture detection logic for multiple slice error cases
Fixed handling of incomplete frame, missing slices.

Change-Id: Iae447667e4d88869a8bf992180cacd77870b9877
2015-06-25 08:25:44 -07:00
Harinarayanan K K
3749f6f435 Added support for Main Profile toolsets in encoder.
Added support for CABAC entropy coding.
Added support for B slices.
Fixed an issue in rate control constant QP mode.

Change-Id: Ib759d35e8e943f941aa9b8bbff0362d92c619994
2015-06-25 08:25:43 -07:00
Harish Mahendrakar
cf91c87b25 Fixed an overread in YUV420 Semi-planar input usecase
Handled non-multiple of 16 dimensions for 420 semiplanar input
Modified test code to remove alignment of width and height

Bug: 21586373
Change-Id: I83ff8165364a863d577fcac81e711b07eec9c004
2015-06-12 18:34:16 -07:00
Marco Nelissen
8ef4c3f614 Multithreading changes and better error resilience
Fixed the following bugs
Issue 21145276
Issue 21144884
Issue 21181133
Issue 21181134

Decoder now returns error if the level in stream is higher than level at init

Change-Id: I8892c62bd98f7854d046510330c05a1e9ca826b2
2015-06-03 07:27:36 -07:00
Harish Mahendrakar
7497191460 Resolved warnings and fixed alignment of few assemblies
Resolved warnings seen in x86 modules
Fixed alignment of few modules
Updated comments in few arm modules for consistency
Fixed warnings seen in clang build

Change-Id: I0623169b5e84a6a6f09c3d2212e754101272f5e9
2015-05-05 17:51:53 +00:00
Lajos Molnar
a2b49e5f05 fix file permissions
Change-Id: Ia4f99d5b963acd8d8a1afc2fbdf06b122d898f63
2015-05-05 17:51:34 +00:00
Harish Mahendrakar
3a52efd361 Fixed few issues seen in CTS tests
Added support for encoding non-multiple of 16 dimensions
Added support for encoding dimensions smaller than 64x64
Aligned coeff data to 4 byte boundary

Bug: 20554276
Change-Id: I111093950f94698296d8499a2845cfe2db6c557b
2015-05-05 17:45:29 +00:00
Hamsalekha S
8d3d303c79 Initial version
Change-Id: I7efe9a589cd24edf86e8d086b40c27cbbf8b4017
2015-04-02 15:59:02 +05:30