Commit Graph

348 Commits

Author SHA1 Message Date
Martin Storsjö
7b96c6756e Use void instead of void_t
There's really no reason for adding a typedef for void.
2014-02-10 08:06:33 +02:00
Martin Storsjö
2b77fe7f49 Use bool instead of bool_t
bool is one of the built in, standard types in C++, there's no need
for a typedef for it.
2014-02-10 08:05:09 +02:00
Martin Storsjö
17d7b5d72e Use bool_t instead of BOOL_T
One bool typedef is already more than enough, two is too many.
2014-02-10 08:05:09 +02:00
Martin Storsjö
0f7a958ce3 Move declarations of functions in mc_chroma/luma.asm into a header in common 2014-02-10 08:05:02 +02:00
Martin Storsjö
ad209c2d14 Move declarations of functions in expand_picture.asm into a header in common 2014-02-10 08:05:02 +02:00
volvet
bf9a78085e Merge pull request #273 from mstorsjo/remove-editor-state-file
Remove an MSVC resource editor state file
2014-02-10 09:08:09 +08:00
volvet
a4d9ba3feb Merge pull request #275 from mstorsjo/fix-win64-noasm-build
Fix building for win64 with assembly disabled
2014-02-10 09:00:31 +08:00
Martin Storsjö
47934b3042 Fix building for win64 with assembly disabled 2014-02-09 02:19:48 +02:00
Martin Storsjö
83892ad056 Remove an MSVC resource editor state file
This file contains the local UI state of the resource editor,
and should not be committed to version control.

A similar file was removed earlier in c61b040, but this one
was missed.
2014-02-08 23:40:06 +02:00
Martin Storsjö
a532c1233b Take the missed WelsDecoderI4x4LumaPredH_sse2 function into use
Previously this function was never used.
2014-02-08 23:09:16 +02:00
Martin Storsjö
d0185ab253 Remove redundant /./ parts from pathnames in makefiles
This is mostly a cosmetic improvement for the quiet make output.
2014-02-08 18:46:52 +02:00
Ethan Hugg
c80553bfa1 Merge pull request #270 from mstorsjo/c-interface-headers
Include stdbool.h in the public interface headers in C mode
2014-02-08 08:42:48 -08:00
Martin Storsjö
bcd08d8713 Include stdbool.h in the public interface headers in C mode
This avoids requiring the callers to explicitly include it before
including codec_api.h
2014-02-08 14:37:26 +02:00
Martin Storsjö
e66ad9ab86 Remove the real32_t typedef
The float type is defined in standards and is portably available
on all supported compilers and platforms.
2014-02-08 14:12:03 +02:00
Martin Storsjö
d36b10fac5 Remove typedefs for float_t and double_t
The actual float and double data types are defined in C89 and are
usable as such without any extra typedefs.

Removing the extra typedefs simplifies the compatibility typedef
headers, simplifies portability and makes the code base easier
to work with for people new to the library.
2014-02-08 14:11:44 +02:00
Martin Storsjö
ba6bf7da18 Consistently use inline instead of __inline
This seemed to have been missed in 109fecc.
2014-02-08 14:08:46 +02:00
Martin Storsjö
f252acf8a5 Remove fallback defines for NULL
No actual (supported) compiler lacks a definition for NULL, and it
is mandated to be present in stddef.h according to the C89 standard.
2014-02-06 10:38:15 +02:00
orbitcowboy
7d29cecc0e cleanup variable initializations. 2014-01-31 23:13:21 +01:00
orbitcowboy
21197abe96 cleanup unused variable in codec/common/deblocking_common.cpp. 2014-01-31 23:00:30 +01:00
Martin Storsjö
8ecdcc7172 Add a make option for silencing the commands run
Add "V=No" to the make command to silence the make output.

This makes it easier to spot warnings or other unexpected messages
in the build output.
2014-01-30 13:56:19 +02:00
Ethan Hugg
1e744b1933 Merge pull request #257 from mstorsjo/simplify-endian-func
Simplify the implementation of GetValueOf4Bytes
2014-01-29 15:25:30 -08:00
Ethan Hugg
fbcd962169 Merge pull request #256 from mstorsjo/bigendian
Make the library work on big endian
2014-01-29 15:24:32 -08:00
Martin Storsjö
1d2c37f7de Simplify the implementation of GetValueOf4Bytes
What the two different implementations currently do is simply
to write a 32 bit number, in the native endianness, into the
given buffer.

The actual purpose of this function is still unknown though,
it can be removed completely without breaking decoding - it
is possibly a remnant from earlier functionality in the
decoder.
2014-01-29 22:44:42 +02:00
Martin Storsjö
cadbec75d8 Fix shifting tricks in deblocking for big endian
The code interprets an array of 4 uint8_t values as one uint32_t
and does shifts on the value. The same optimization can be
kept in big endian as well, but the shift has to be done in the
other direction.

This code could be made truly independent of endianness, but
that could cause some minimal performance degradaion, at least
in theory.

This makes "make test" pass on big endian, assuming that
WORDS_BIGENDIAN is defined while building.
2014-01-29 22:30:33 +02:00
Martin Storsjö
47ec78843a Don't read an uint8_t array as an uint32_t
This makes the code work properly on big endian.

The MC case is similar to how it's done in the encoder.

Neither of these should have any significant performance
impact.
2014-01-29 22:27:55 +02:00
Martin Storsjö
66c39a4fd4 Remove the array_stack_align.h header from the encoder lib
All of these macros are already available in the common
macros.h header. Unify all the macros to be named ENFORCE_*
instead of mixed FORCE/ENFORCE.
2014-01-29 22:07:52 +02:00
Martin Storsjö
b2178aacc0 Fix a typo in a directory name 2014-01-29 10:29:53 +02:00
Ethan Hugg
ec576baf25 Merge pull request #249 from mstorsjo/encconsole-arg-parsing-ifdef
Fix parsing of the -drec option if ENABLE_FRAME_DUMP isn't set
2014-01-28 11:05:31 -08:00
Ethan Hugg
b58bf88b44 Merge pull request #247 from mstorsjo/simplify-missed-inline-asm-macro
Unify the codepaths for WELS_GET_PERFIX_BITS at the second place
2014-01-28 11:04:50 -08:00
Ethan Hugg
08638a9396 Merge pull request #252 from mstorsjo/share-processing-asm
Merge identical assembly code between the processing and encoder libs
2014-01-28 11:04:12 -08:00
Ethan Hugg
3c40261256 Merge pull request #251 from mstorsjo/crt-string-cleanup
Clean up the rest of the usage of crt_safe_util_x
2014-01-28 09:42:56 -08:00
Ethan Hugg
0d7bafcebc Merge pull request #248 from mstorsjo/msvc-proj-cleanup
MSVC project file warning cleanup
2014-01-28 09:40:17 -08:00
Martin Storsjö
04dba61d22 Remove an unused assembly source file
Nothing within processing uses functions from this file.
2014-01-28 13:55:41 +02:00
Martin Storsjö
3761901ed4 Remove sad.asm from the processing lib, move satd_sad from the encoder to the common lib
sad.asm as used in processing is an exact subset of the
code in satd_sad.asm in the encoder.
2014-01-28 13:54:57 +02:00
Martin Storsjö
e0da5a1686 Remove the now unused STRCAT macro 2014-01-28 12:43:22 +02:00
Martin Storsjö
208f033bcd Use WelsStrcat instead of the STRCAT macro 2014-01-28 12:43:22 +02:00
Martin Storsjö
903f265965 Fix a format string to use the correct type 2014-01-28 12:42:01 +02:00
Martin Storsjö
5c5dcfb14c Remove an unused global variable and commented out code 2014-01-28 12:36:54 +02:00
Martin Storsjö
fa93c88fa2 Implement WelsStrcat based on WelsStrncpy
This is a more convenient behaviour (truncating on overflow and
always null terminating the buffer) compared to the MSVC
safe strcat_s which aborts the process if the string doesn't fit
into the target buffer.

Also mark the source buffer as const in the function prototype.
2014-01-28 12:27:22 +02:00
Martin Storsjö
9840f11784 Remove the now unused count parameter to WelsStrncpy
Also remove manual null termination as WelsStrncpy now always
takes care of it.
2014-01-28 12:13:11 +02:00
Martin Storsjö
a16ccc0b4d Fix the implementations of WelsStrncpy
Make the MSVC "safe" version truncate instead of aborting the
process if the buffer is too small.

Update all the other functions to use the right parameter
(iSizeInBytes, not iCount) as 'n' parameter to strncpy.
(By passing iCount as parameter to the normal strncpy functions,
it meant that the resulting buffer actually never was null
terminated.)

Additionally make sure that the other implementations of WelsStrncpy
always null terminate the resulting buffer, just as the MSVC safe
version does when passed the _TRUNCATE parameter.
2014-01-28 12:08:35 +02:00
Martin Storsjö
74e7c9b6d8 Remove the now unused STRNCPY macro 2014-01-28 12:06:07 +02:00
Martin Storsjö
215eb56453 Use WelsStrncpy instead of STRNCPY 2014-01-28 12:05:28 +02:00
Martin Storsjö
7791a6d28d Use WelsSnprintf instead of a combination of strlen and STRNCAT
This simplifies the code and makes the buffer size checks
more consistent. Additionally, the previous version wrote
the extra space character without checking if it actually fit
into the buffer.
2014-01-28 12:00:04 +02:00
Martin Storsjö
0318922654 Check the right pointer for being non-null in WelsLogDefault
In case the log level was invalid, GetLogTag returns null.
Checking pCtx doesn't make sense since nothing within the
if block uses pCtx.
2014-01-28 12:00:04 +02:00
Martin Storsjö
9b59153263 Remove the STRNLEN/WelsStrnlen compatibility functions
These were essentially useless - if strlen() ever was used as
fallback, it either indicated that those ports of the library
were insecure, or that strnlen never was required at all.
In this case it turned out to be the latter (at least after
the preceding cleanups) - all uses of it were with known null
terminated strings.
2014-01-28 12:00:04 +02:00
Martin Storsjö
19f03d6a26 Fix parsing of the -drec option if ENABLE_FRAME_DUMP isn't set
If the define wasn't set, the argument iterator didn't skip
the file name argument.
2014-01-28 11:46:27 +02:00
Martin Storsjö
92fa4eb400 Use strlen instead of WelsStrnlen/STRNLEN for known null terminated strings
strlen is not dangerous if the string is known to be null
terminated (and MSVC does not warn about its use either).

For the cases in the decoder welsCodecTrace.cpp, the string
passed to all WriteString instances is produced by WelsVsnprintf
which always null terminates the buffer nowadays.

Additionally, as the string was passed to OutputDebugStringA
without any length specifier before, it was already assumed to
be null terminated.

The file name parameter passed to DumpDependencyRec and
DumpRecFrame in encoder.cpp is always null terminated,
which was already assumed as it is passed to WelsFopen as is.

As for the encoder utils.cpp, the strings returned by GetLogPath
are string constants that are null terminated.
2014-01-28 11:40:54 +02:00
Martin Storsjö
082a986990 Use strlen() instead of WelsStrnlen/STRNLEN for string constants
A string constant is guaranteed to be null terminated, and thus
doesn't need to use a version of strlen with a fixed buffer size
limit.
2014-01-28 11:38:26 +02:00
Martin Storsjö
da7d3d9bad Remove an unused and unnecessary string length calculation
This is unused since 771ff739b.
2014-01-28 11:38:22 +02:00