Commit graph

50 commits

Author SHA1 Message Date
Harinarayanan K K
4e2c308d17 Fixed issues with forcing I and IDR frames.
Setting I frame interval to 1 caused encoder to go into
infinite loop. Fixed that by stopping RC update.

Forcing of I and IDR frame did not cause the frames at expected time
due to delayed encoding. This is fixed now.

Change-Id: Ibf549fb335c053ee33de768455b20e46be3e7c1c
2015-06-25 08:25:53 -07:00
Martin Storsjo
85a43d2fcf Fix string handling for generating version strings
Don't do concatenation with strncat; the length parameter in strncat
is only for how many chars to append at most, not for the full output
buffer size. To safely use strncat, one would have to do
strncat(buf, str, sizeof(buf) - strlen(buf)).

By using snprintf, we guarantee that the buffer is null terminated, and
we don't need to use strnlen at all.

(If compatibility with older MSVC versions that lack snprintf, one
can use _snprintf instead and manually add the null termination.)

Change-Id: I1c2322c7a406ddd5e6551a96c460da60deeffda1
2015-06-25 08:25:52 -07:00
Martin Storsjo
c6488980b2 Remove some unused source files and headers
They seem to have been included by accident. Nothing includes
them or refer to the symbols declared in them. (The other functions
declared by the header don't have any matching implementation either.)

Change-Id: I1c77a21226613bda0b029dd4ea5da207aa7cae09
2015-06-25 08:25:52 -07:00
Martin Storsjo
94000e8a28 Remove a duplicate header
ithread.h is already in the common directory.

Change-Id: I300fd9c07075e16793e7b645e483663d081ca0cc
2015-06-25 08:25:52 -07:00
Martin Storsjo
9831e85efd Don't add -m32/-m64 to the cflags
If the environment already indicates that the compiler targets
either x86 or x86_64, we don't need to enforce this by trying to
force the compiler to output a specific bitness.

Change-Id: Ife6e717e90b4da4edd852dcd66ad92dba70939a2
2015-06-25 08:25:51 -07:00
Martin Storsjo
56378a82a6 Remove an unused and unnecessary function prototype and associated define
Change-Id: I61b30d0934715cddd54b66ea3b023b2316a0106f
2015-06-25 08:25:51 -07:00
Martin Storsjo
ce7f41973c Remove the codec level stride field
This field isn't used at the moment at all. The public field
ive_ctl_set_dimensions_ip_t.u4_strd is kept to avoid breaking
other calling code, although it doesn't have any actual function
any longer.

Change-Id: Icfc88846fa63f209c67b8e1f8e0cc21bc4ddb73a
2015-06-25 08:25:50 -07:00
Martin Storsjo
4f5ceca078 Always copy data to a local buffer if padding is needed
If horizontal padding is needed, copy the data to avoid having to try
to write into the input buffer.

If vertical padding is needed, we could get away with only copying
the last MB row (as previously was done), but then one extra row of
pixels are needed for intra pred. Thus always copy all of the picture,
for simplicity, if padding is needed.

Change-Id: I6b456a12956120d64e7c6b86d7b571e159f4566b
2015-06-25 08:25:50 -07:00
Martin Storsjo
cb6a43532c Set the luma/chroma strides depending on source buffer
If the data is read directly from the input buffer, set the stride
values to those of the input buffer. If the data is copied, set the
stride to the value of the local buffer instead.

This fixes handling of cases where the input buffer stride is
(significantly) larger than the maxwidth of the video.

This also effectively makes the parameter
ive_ctl_set_dimensions_ip_t.u4_strd useless - nothing needs to
know the stride until you actually encode a frame, and at that point,
we can either use the stride of the input buffer, or of the local
pu1_y_csc_buf_base where the copied content is stored.

Change-Id: Icde400b4a0867d25855e621e143454e608748aa3
2015-06-25 08:25:49 -07:00
Martin Storsjo
9113f5615c Use a separate field for the chroma stride
When both luma and chroma are copied to the local buffer (either
due to yuv format conversion, or due to padding), they have got
the same stride, but if chroma is copied while luma is used directly
from the input buffer, they might have different strides.

Therefore add a separate field for chroma stride.

This commit only adds the field, while it still has got the same
value as before.

Change-Id: I0dce97ad4d91cd1d9aba4b4472c6a0de45a314bc
2015-06-25 08:25:49 -07:00
Martin Storsjo
bc8456b296 armv8: Don't touch the x18 register
The x18 register is platform specific, and using it in portable assembler
code should be avoided.

In this particular case, using it is not actually needed at all.

Change-Id: I07016fdd3a264ed77eba37abcd1748b51cf7a49e
2015-06-25 08:25:49 -07:00
Martin Storsjo
f640384449 arm: Properly match /* */ comments in the arm assembly
Some versions of the clang built-in assembler interprets /* as a start
of a multi-line comment, even within lines starting with a @. Therefore,
make sure to terminate these properly.

This fixes warnings about /* within a block comment when building
using the clang built-in assembler (in some versions of clang), and
fixes issues where part of the assembly source was effectively
commented out, when building with this assembler.

Change-Id: I4b520334d92740f8c60def94ee990561b2cb8b7c
2015-06-25 08:25:48 -07:00
Martin Storsjo
c9f67e59b7 Allow using the clang built-in arm assembler
The arm and armv8 assembly source should now build just fine with
clang's built-in assembler.

Change-Id: I26d2a74d05e56e6e93457299d4d8ab082368701f
2015-06-25 08:25:48 -07:00
Martin Storsjo
3e4b6559bc armv8: Don't accidentally write 8 bytes instead of 4
This fixes running when built with clang - by pure luck the out of bounds
writes didn't cause any harm when the calling C code was built with gcc.

Change-Id: I4e33dd403b785cbcd24fb80f4db7a86310a32225
2015-06-25 08:25:47 -07:00
Martin Storsjo
0ce73fe558 arm: Use vqmovun instead of vqshrun #0
binutils gas automatically produces vqmovun when vqshrun is used
with a zero shift.

This is required for building the armv8 assembly with the clang built-in
assembler.

Change-Id: Ie986978e4508a085e4e4c76f8db9a8a8394c4fec
2015-06-25 08:25:47 -07:00
Martin Storsjo
b5cec4f95f arm: Use unified syntax, ldrsheq instead of ldreqsh
clang only supports the new, unified arm syntax (UAL), while binutils
gas supports both (and defaults to the old syntax). Explicitly declare
that the unified syntax is used, and use the right form of these
instructions that is supported by both.

Change-Id: I9a3940e060c129861c7a542ccf09035dbd1766ae
2015-06-25 08:25:47 -07:00
Martin Storsjo
b6d4342f4f armv8: Use the cmn instruction instead of doing cmp with negative values
binutils gas automatically converts cmp with negative values to use
the cmn instruction instead.

This is required for building the armv8 assembly with the clang built-in
assembler.

Change-Id: If6465ea1bec252446c49cf497153e3ef3dad905a
2015-06-25 08:25:46 -07:00
Martin Storsjo
9f81a0a202 armv8: Remove redundant NEON element size declarations
When specifying one specific lane of the vector, the number of
lanes don't need to be specified.

The clang built-in assembler doesn't allow the redundant
declarations, while binutils gas work fine with both forms.

Change-Id: I86077ce0774d4594a1295b6860e4944df87dde2f
2015-06-25 08:25:46 -07:00
Martin Storsjo
436fccb164 Handle non-mod-16 widths in the NEON version of 422i->420sp conversion
This uses the same mechanism as in ih264e_fmt_conv_420p_to_420sp_a9q
to do an overlapping copy of the last few pixels.

Change-Id: Ic93a00d0683337fd0f6f540119000466685f64bd
2015-06-25 08:25:45 -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
3806807d70 Remove the ithread_exit function
This function is dangerous since it behaved differently on different
platform implementations. It is not used for any actual purpose, and
not currently necessary.

Change-Id: I9702e9943065235c7a7b29dc6c6eeb36212e7ce1
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
Martin Storsjo
b8681a4380 Remove unnecessary defines/undefines in the makefiles
The following defines aren't referenced anywhere in the code base:
_LIB MULTICORE APPLY_CONCEALMENT THREAD_QUAD_CORE DISABLE_NEONINTR
ARMGCC

The DEFAULT_ARCH define isn't used within the encoder at all.

The ANDROID define isn't referenced anywhere either, and if necessary,
the automatically enabled define __ANDROID__ can be used instead.

The defines INSERT_LOGO and LOGO_EN were undefined in the makefiles,
but that is unnecessary since nothing actually defines them. The
decoder x86_64 makefile also undefined LOGO_EN; an architecture
specific makefile shouldn't touch such feature settings, otherwise
there's a risk that different builds for different architectures
behave significantly differently.

Change-Id: I13b86c8bf2feb3a381d904a13f18c3b35f40a575
2015-06-25 08:25:43 -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
Hamsalekha S
c080d57996 Moved check for level after check for resolution change.
This is required for DRC tests in CTS .

Change-Id: Icd0fe10d97c6ee55f8358682a578bddb58590de4
2015-06-25 08:25:42 -07:00
Hamsalekha S
9327d0ea03 Added support for level 52
Change-Id: Ib2fa0b02b408a7bb21b3115e5b1c1317706a7354
2015-06-25 08:25:42 -07:00
Naveen Kumar Ponnusamy
796e3c8de8 SSSE3/SSE4 Intrinsics Optimizations
Change-Id: I55c74d9b2a0b323886d8a80eaad899b187c22cd7
2015-06-25 08:25:42 -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
Martin Storsjo
c75cf37283 Support levels 5.0 and 5.1 in the encoder properly
The function ih264e_get_lvl_idx lacked handling of them
before, which meant that it returned index 0 (corresponding
to level 1.0) if level 5.0 or 5.1 were selected.

Change-Id: I482213e68e11fd091c72ec57a593392aa1a0a4ae
2015-06-03 08:47:38 -07:00
Martin Storsjo
e398f0eccb Fix a typo in gas_ih264_lvl_tbl, set proper sizes for level 1.1
The table values themselves were correct, but the level values
were swapped for 1.1 and 1B.

This fixes encoding using level 1.1, which previously got the
wrong (too small) sizes (corresponding to level 1B).

Change-Id: Ic0acc58eb5841710ffd8be54bf97800fdbb40855
2015-06-03 08:45:29 -07:00
Lajos Molnar
93295b228f Merge "Set cflags for the right arch in the arm64 makefile" into mnc-dev 2015-06-03 15:44:23 +00:00
Martin Storsjo
50cb7d0fac Set cflags for the right arch in the arm64 makefile
Change-Id: I0b7c56670e93b825b95b84d7573b968c51313d2e
2015-06-03 08:43:52 -07:00
Martin Storsjo
90c798b14b Remove leftover printfs in x86 encoder initialization
A library shouldn't printf things to the common stdout, at least
not in normal builds.

Change-Id: Ifd875369c2347549f141fe0f9754e51814c0de96
2015-06-03 08:42:39 -07:00
Martin Storsjo
b30b70f9cc Remove an empty source file
This source file doesn't contain anything else than just included
headers.

Change-Id: I7cd238a5d220907db82b98f7aaefad9d66af8ee4
2015-06-03 08:40:46 -07:00
Martin Storsjo
1ff75b8cc0 Only initialize u4_deblk_prev_row if it will be used
This avoids reads out of bounds when encoding videos with a height
of one single macroblock.

Change-Id: Iec982cebb0995c8ecf160751eaa72df38604e8b0
2015-06-03 08:39:31 -07:00
Martin Storsjo
ac97f28bb6 Fix an overread in the slice map
After incrementing the macroblock position in ih264e_update_proc_ctxt,
the slice index of the next macroblock is read. The value that is read
isn't actually used, but make sure that the array is large enough to
avoid overreads.

Change-Id: I44ddb49773244c7d1e404199fc57a9e30a8959e0
2015-06-03 08:37:00 -07:00
Martin Storsjo
df06a38c5b Include space for chroma in the padding allocated in ih264e_get_total_pic_buf_size
Chroma is already accounted for in e.g. num_samples by multiplying
the number of luma samples by 3/2, so include it in the padding
calculation as well.

This fixes encoding 176x144 at level 1.0 - normally this isn't an issue
since the padding is a bit overestimated, but for this particular
resolution/level combination, it fails unless this is calculated properly.

Change-Id: Id5df6e5aee4d3d78f4c28a3b7d5fed6fe42a1f2c
2015-06-03 08:35:02 -07:00
Martin Storsjo
eb7b34579c Fix a variable name typo in the mips64 makefiles
Change-Id: I88617ca5e189cb6d5dbaf0422dd2f7cecdfde778
2015-06-03 08:30:27 -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
Lajos Molnar
fab9a811d2 fix build issues with clang
Disable clang for assembly, and pass include paths to clang-assembly in a clang way

Change-Id: Idceb43f22b6fc26ec31de910482cdac62b6bbe86
2015-04-16 18:55:35 -07:00
Lajos Molnar
7023f4d0e9 fix build for generic builds
Change-Id: I7654a801a2b168b7e0bcbebf680efbf2343b1ece
2015-04-16 11:54:42 -07:00
Lajos Molnar
7e7f176198 Merge "Initial version" 2015-04-15 20:02:28 +00:00
Hamsalekha S
8d3d303c79 Initial version
Change-Id: I7efe9a589cd24edf86e8d086b40c27cbbf8b4017
2015-04-02 15:59:02 +05:30
Bill Yi
b745243fe3 Merge remote-tracking branch 'goog/stage-aosp-master' into HEAD 2015-03-10 14:57:40 -07:00
Bill Yi
3956d913d3 Initial empty repository 2015-03-04 19:39:31 +00:00
Bill Yi
c634a42d85 Initial empty repository 2015-03-04 11:36:37 -08:00