Compare commits

..

34 Commits

Author SHA1 Message Date
dongzha
30b63a42af Merge pull request #1276 from huili2/modify_releases
release note for v1.1.0
2014-08-15 09:35:11 +08:00
huili2
1b26a3c3fb release note for v1.1.0 2014-08-10 20:01:00 -07:00
ruil2
ed9f7e0d05 Merge pull request #1235 from huili2/v1.1_APIDoc
enable API doc
2014-07-29 13:53:23 +08:00
huili2
dd136c2cde enable API doc 2014-07-28 22:29:48 -07:00
huili2
c607d3a248 Merge pull request #1209 from ruil2/crash_mac64
fix crash bugs that too large size local varialbe will cause stack overflow
2014-07-25 13:09:05 +08:00
Ethan Hugg
798928ecd1 Merge pull request #1212 from mstorsjo/version-generate-deps-1.1
Fix generating version.h in parallel make builds (make -jX) - for openh264v1.1
2014-07-24 08:18:35 -07:00
Martin Storsjö
d048a7a94a Fix the name of the version generation makefile target 2014-07-24 17:51:49 +03:00
Martin Storsjö
7b9a3251f9 Add dependencies to generating version.h in the object files that use it
Previously the makefile didn't know that there was any dependency between
compiling welsDecoderExt.o and welsEncoderExt.o and the regeneration
of the version.h header. This meant that in parallel builds (make -jX),
make could try to regenerate version.h while compiling welsDecoderExt.o
and welsEncoderExt.o, which would lead to errors about version.h not
existing.

Also add some spacing around the makefile rules.

This fixes parallel make building in certain cases.
2014-07-24 17:51:21 +03:00
ruil2
681c3e36d4 format update 2014-07-24 10:52:44 +08:00
ruil2
d46514bf51 fix crash bugs that too large size local varialbe will cause stack overflow 2014-07-24 09:49:53 +08:00
zhilwang
696ed1888e Merge pull request #1198 from dongzha/AddIDCTResArm64AndUT
Add Unit Test and ARM64 code for block_add (v1.1)
2014-07-21 14:51:56 +08:00
HFVideoMac
c16f60c406 Add Unit Test and ARM64 code for block_add 2014-07-21 12:49:24 +08:00
huili2
5f6d439008 Merge pull request #1189 from ruil2/trace_tag1.1
fix reference frame update issue which will casue crash
2014-07-17 13:40:40 +08:00
ruil2
facc77bad9 fix reference frame update issue which will casue crash 2014-07-17 12:42:55 +08:00
dongzha
66dcbf20bf Merge pull request #1184 from ruil2/trace_tag1.1
add trace tag
2014-07-17 10:43:34 +08:00
ruil2
a1639711c9 modify trace output 2014-07-17 10:24:59 +08:00
dongzha
9a5eb54b0a Merge pull request #1182 from huili2/diff_logic_WME
modify the logic for WME usage
2014-07-17 08:43:59 +08:00
ruil2
62ed30c5b0 add trace tag 2014-07-16 16:52:18 +08:00
huili2
bf037d2576 modify the logic for WME usage 2014-07-15 23:34:52 -07:00
ruil2
118a1939ed Merge pull request #1178 from huili2/ver_ctrl_v1.1
version-generate
2014-07-16 10:35:32 +08:00
huili2
60dd3ea531 Merge pull request #1179 from huili2/dpb_green_issue
solve green issue combined with EC and multi-packet input
2014-07-15 18:00:43 +08:00
huili2
5536071efd version-generate 2014-07-15 01:59:49 -07:00
huili2
6b5d73afc9 solve green issue combined with EC and multi-packet input 2014-07-14 22:19:31 -07:00
ruil2
31c27c57a9 Merge pull request #1164 from huili2/border_green
expand pic for EC
2014-07-15 09:25:50 +08:00
huili2
904c47530d Merge pull request #1168 from ethanhugg/openh264v1.1-gmpapi
Pull gmp-api by branch name
2014-07-15 08:46:46 +08:00
Ethan Hugg
d5ae502ce6 Pull gmp-api by branch name 2014-07-14 07:57:41 -07:00
huili2
eac4f3dec3 expand pic for EC 2014-07-14 00:02:09 -07:00
dongzha
0f74b9951f Merge pull request #1146 from huili2/no_param_reuse
reuse dsNoParamSets in dec
2014-07-10 23:58:51 -07:00
huili2
9bcd596fd4 reuse dsNoParamSets in dec 2014-07-10 21:56:13 -07:00
huili2
01db323b1b Merge pull request #1138 from huili2/parse_fail
add return info for all cases
2014-07-10 17:47:53 +08:00
ruil2
d5ee1efcdb Revert "turn off LTR for screen content. after checking LTR logic, will turn on"
This reverts commit 0fda3d9235.
2014-07-10 16:16:21 +08:00
huili2
52b67fa2a9 add return info for all cases 2014-07-09 23:01:39 -07:00
huili2
c6e2730519 Merge pull request #1129 from ruil2/temporal_bug_fixv1.1
fix bug when temporal layer changes
2014-07-09 17:36:34 +08:00
ruil2
ea70011cd7 fix bug when temporal layer changes 2014-07-09 16:56:48 +08:00
29 changed files with 436 additions and 72 deletions

View File

@@ -17,6 +17,7 @@ SHARED=-shared
OBJ=o
PROJECT_NAME=openh264
MODULE_NAME=gmpopenh264
GMP_API_BRANCH=Firefox32
CCASFLAGS=$(CFLAGS)
ifeq (,$(wildcard ./gmp-api))
@@ -115,6 +116,12 @@ MODULE_INCLUDES += -Igmp-api
all: libraries binaries
generate-version:
sh ./codec/common/generate_version.sh
codec/decoder/plus/src/welsDecoderExt.$(OBJ): | generate-version
codec/encoder/plus/src/welsEncoderExt.$(OBJ): | generate-version
clean:
ifeq (android,$(OS))
clean: clean_Android
@@ -122,7 +129,8 @@ endif
$(QUIET)rm -f $(OBJS) $(OBJS:.$(OBJ)=.d) $(LIBRARIES) $(BINARIES)
gmp-bootstrap:
git clone https://github.com/mozilla/gmp-api gmp-api
if [ ! -d gmp-api ] ; then git clone https://github.com/mozilla/gmp-api gmp-api ; fi
cd gmp-api && git fetch origin && git checkout $(GMP_API_BRANCH)
gtest-bootstrap:
svn co https://googletest.googlecode.com/svn/trunk/ gtest

BIN
OpenH264_API_v1.1.docx Normal file

Binary file not shown.

View File

@@ -1,9 +1,32 @@
Releases
-----------
v1.1.0
------
- Modify some APIs (see API doc for detail)
- Improve the compression ratio of screen content encoding
- ARM64 assembly support for most of core functions in encoder & decoder
- Modify error concealment logic to always return decoding error info until IDR picture comes
- fix some bugs
Binaries
-----------
These binary releases are distributed under this license:
http://www.openh264.org/BINARY_LICENSE.txt
v1.1.0
------
http://ciscobinary.openh264.org/libopenh264-1.1.0-android19.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-ios32.a.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-ios64.a.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux32.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-linux64.so.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-osx32.dylib.bz2
http://ciscobinary.openh264.org/libopenh264-1.1.0-osx64.dylib.bz2
http://ciscobinary.openh264.org/openh264-1.1.0-win32msvc.dll.bz2
http://ciscobinary.openh264.org/openh264-1.1.0-win64msvc.dll.bz2
v1.0.0
------

View File

@@ -30,6 +30,7 @@
4CE4469F18BC5EAB0017DF25 /* welsDecoderExt.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */; };
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A718BC6BE90017DF25 /* block_add_neon.S */; };
4CE447AE18BC6BE90017DF25 /* intra_pred_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */; };
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */ = {isa = PBXBuildFile; fileRef = 6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */; };
9ABF4382193EB60900A6BD61 /* expand_pic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9ABF4381193EB60900A6BD61 /* expand_pic.cpp */; };
9AED66561946A1DE009A3567 /* welsCodecTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */; };
9AED66591946A203009A3567 /* utils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AED66581946A203009A3567 /* utils.cpp */; };
@@ -49,6 +50,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
04FE0680196FD8BE0004D7CE /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../../../common/inc/version.h; sourceTree = "<group>"; };
4CBC1B80194AC4E100214D9E /* intra_pred_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = intra_pred_aarch64_neon.S; path = arm64/intra_pred_aarch64_neon.S; sourceTree = "<group>"; };
4CE4427918B6FC360017DF25 /* libwelsdec.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libwelsdec.a; sourceTree = BUILT_PRODUCTS_DIR; };
4CE4427C18B6FC360017DF25 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -107,6 +109,7 @@
4CE4468518BC5EAB0017DF25 /* welsDecoderExt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = welsDecoderExt.cpp; sourceTree = "<group>"; };
4CE447A718BC6BE90017DF25 /* block_add_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = block_add_neon.S; sourceTree = "<group>"; };
4CE447A918BC6BE90017DF25 /* intra_pred_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_neon.S; sourceTree = "<group>"; };
6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = block_add_aarch64_neon.S; path = arm64/block_add_aarch64_neon.S; sourceTree = "<group>"; };
9ABF4380193EB5F700A6BD61 /* expand_pic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = expand_pic.h; path = ../../../common/inc/expand_pic.h; sourceTree = "<group>"; };
9ABF4381193EB60900A6BD61 /* expand_pic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = expand_pic.cpp; path = ../../../common/src/expand_pic.cpp; sourceTree = "<group>"; };
9AED66551946A1DE009A3567 /* welsCodecTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = welsCodecTrace.cpp; path = ../../../common/src/welsCodecTrace.cpp; sourceTree = "<group>"; };
@@ -132,6 +135,7 @@
4CBC1B7F194AC4A400214D9E /* arm64 */ = {
isa = PBXGroup;
children = (
6C749B69197CC6E600A111F9 /* block_add_aarch64_neon.S */,
4CBC1B80194AC4E100214D9E /* intra_pred_aarch64_neon.S */,
);
name = arm64;
@@ -265,6 +269,7 @@
4CE4467C18BC5EAA0017DF25 /* inc */ = {
isa = PBXGroup;
children = (
04FE0680196FD8BE0004D7CE /* version.h */,
9AED66571946A1EB009A3567 /* welsCodecTrace.h */,
4CE4467E18BC5EAA0017DF25 /* welsDecoderExt.h */,
);
@@ -351,6 +356,7 @@
4CE4468A18BC5EAB0017DF25 /* au_parser.cpp in Sources */,
4CE4469918BC5EAB0017DF25 /* mv_pred.cpp in Sources */,
4CE447AC18BC6BE90017DF25 /* block_add_neon.S in Sources */,
6C749B6A197CC6E600A111F9 /* block_add_aarch64_neon.S in Sources */,
4CE4469418BC5EAB0017DF25 /* get_intra_predictor.cpp in Sources */,
9AED66561946A1DE009A3567 /* welsCodecTrace.cpp in Sources */,
F0B204FC18FD23D8005DA23F /* error_concealment.cpp in Sources */,

View File

@@ -64,6 +64,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
04FE0684196FD9370004D7CE /* version.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = version.h; path = ../../../common/inc/version.h; sourceTree = "<group>"; };
4C23BC5F195A77E0003B81FC /* intra_pred_sad_3_opt_aarch64_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; name = intra_pred_sad_3_opt_aarch64_neon.S; path = arm64/intra_pred_sad_3_opt_aarch64_neon.S; sourceTree = "<group>"; };
4C34066618C57D0400DFA14A /* intra_pred_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_neon.S; sourceTree = "<group>"; };
4C34066718C57D0400DFA14A /* intra_pred_sad_3_opt_neon.S */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.asm; path = intra_pred_sad_3_opt_neon.S; sourceTree = "<group>"; };
@@ -347,6 +348,7 @@
4CE446FC18BC605C0017DF25 /* inc */ = {
isa = PBXGroup;
children = (
04FE0684196FD9370004D7CE /* version.h */,
9AED664819469FAF009A3567 /* welsCodecTrace.h */,
4CE446FE18BC605C0017DF25 /* welsEncoderExt.h */,
);

View File

@@ -0,0 +1,20 @@
#!/bin/bash
rm -f codec/common/inc/version.h
git rev-list HEAD | sort > config.git-hash
LOCALVER=`wc -l config.git-hash | awk '{print $1}'`
if [ $LOCALVER \> 1 ] ; then
VER="$(git rev-list HEAD -n 1 | cut -c 1-7)"
if git status | grep -q "modified:" ; then
VER="${VER}+M"
fi
GIT_VERSION=$VER
else
GIT_VERSION=
VER="x"
fi
GIT_VERSION='"'$GIT_VERSION'"'
rm -f config.git-hash
cat codec/common/inc/version.h.template | sed "s/\$FULL_VERSION/$GIT_VERSION/g" > codec/common/inc/version.h
echo "Generated codec/common/inc/version.h"

View File

@@ -42,7 +42,7 @@
#include <stdarg.h>
#include "typedefs.h"
#define MAX_LOG_SIZE 1024
/*
* Function pointer declaration for various tool sets
*/
@@ -56,7 +56,8 @@ typedef struct TagLogContext {
#ifdef __GNUC__
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...) __attribute__ ((__format__ (__printf__, 3,
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...) __attribute__ ((__format__ (__printf__,
3,
4)));
#else
extern void WelsLog (SLogContext* pCtx, int32_t iLevel, const char* kpFmt, ...);

View File

@@ -0,0 +1,6 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_NUMBER "openh264 default: 1.1"
#endif // VERSION_H

View File

@@ -0,0 +1,6 @@
#ifndef VERSION_H
#define VERSION_H
#define VERSION_NUMBER $FULL_VERSION
#endif // VERSION_H

View File

@@ -39,7 +39,7 @@
*/
#include "utils.h"
#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
#include "codec_app_def.h"
float WelsCalcPsnr (const void* kpTarPic,
const int32_t kiTarStride,
const void* kpRefPic,
@@ -50,8 +50,27 @@ float WelsCalcPsnr (const void* kpTarPic,
void WelsLog (SLogContext* logCtx, int32_t iLevel, const char* kpFmt, ...) {
va_list vl;
char pTraceTag[MAX_LOG_SIZE];
switch (iLevel) {
case WELS_LOG_ERROR:
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Error:");
break;
case WELS_LOG_WARNING:
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Warning:");
break;
case WELS_LOG_INFO:
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Info:");
break;
case WELS_LOG_DEBUG:
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Debug:");
break;
default:
WelsSnprintf (pTraceTag, MAX_LOG_SIZE, "[OpenH264] Detail:");
break;
}
WelsStrcat(pTraceTag,MAX_LOG_SIZE,kpFmt);
va_start (vl, kpFmt);
logCtx->pfLog (logCtx->pLogCtx, iLevel, kpFmt, vl);
logCtx->pfLog (logCtx->pLogCtx, iLevel, pTraceTag, vl);
va_end (vl);
}

View File

@@ -64,7 +64,7 @@ welsCodecTrace::~welsCodecTrace() {
m_fpTrace = NULL;
}
#define MAX_LOG_SIZE 1024
void welsCodecTrace::StaticCodecTrace (void* pCtx, const int32_t iLevel, const char* Str_Format, va_list vl) {
welsCodecTrace* self = (welsCodecTrace*) pCtx;

View File

@@ -0,0 +1,161 @@
/*!
* \copy
* Copyright (c) 2013, Cisco Systems
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifdef HAVE_NEON_AARCH64
.text
#include "arm_arch64_common_macro.S"
#ifdef __APPLE__
.macro ROW_TRANSFORM_1_STEP
// { // input: src_d[0]~[3], output: e_q[0]~[3]; working: $8 $9
saddl $4.4s, $0.4h, $2.4h //int32 e[i][0] = src[0] + src[2];
ssubl $5.4s, $0.4h, $2.4h //int32 e[i][1] = src[0] - src[2];
sshr $8.4h, $1.4h, #1
sshr $9.4h, $3.4h, #1
ssubl $6.4s, $8.4h, $3.4h //int32 e[i][2] = (src[1]>>1)-src[3];
saddl $7.4s, $1.4h, $9.4h //int32 e[i][3] = src[1] + (src[3]>>1);
// }
.endm
.macro TRANSFORM_4BYTES // both row & col transform used
// { // output: f_q[0]~[3], input: e_q[0]~[3];
add $0.4s, $4.4s, $7.4s //int16 f[i][0] = e[i][0] + e[i][3];
add $1.4s, $5.4s, $6.4s //int16 f[i][1] = e[i][1] + e[i][2];
sub $2.4s, $5.4s, $6.4s //int16 f[i][2] = e[i][1] - e[i][2];
sub $3.4s, $4.4s, $7.4s //int16 f[i][3] = e[i][0] - e[i][3];
// }
.endm
.macro COL_TRANSFORM_1_STEP
// { // input: src_q[0]~[3], output: e_q[0]~[3];
add $4.4s, $0.4s, $2.4s //int32 e[0][j] = f[0][j] + f[2][j];
sub $5.4s, $0.4s, $2.4s //int32 e[1][j] = f[0][j] - f[2][j];
sshr $6.4s, $1.4s, #1
sshr $7.4s, $3.4s, #1
sub $6.4s, $6.4s, $3.4s //int32 e[2][j] = (f[1][j]>>1) - f[3][j];
add $7.4s, $1.4s, $7.4s //int32 e[3][j] = f[1][j] + (f[3][j]>>1);
// }
.endm
#else
.macro ROW_TRANSFORM_1_STEP arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9
// { // input: src_d[0]~[3], output: e_q[0]~[3]; working: \arg8\() \arg9\()
saddl \arg4\().4s, \arg0\().4h, \arg2\().4h //int32 e[i][0] = src[0] + src[2];
ssubl \arg5\().4s, \arg0\().4h, \arg2\().4h //int32 e[i][1] = src[0] - src[2];
sshr \arg8\().4h, \arg1\().4h, #1
sshr \arg9\().4h, \arg3\().4h, #1
ssubl \arg6\().4s, \arg8\().4h, \arg3\().4h //int32 e[i][2] = (src[1]>>1)-src[3];
saddl \arg7\().4s, \arg1\().4h, \arg9\().4h //int32 e[i][3] = src[1] + (src[3]>>1);
// }
.endm
.macro TRANSFORM_4BYTES arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7
// both row & col transform used
// { // output: f_q[0]~[3], input: e_q[0]~[3];
add \arg0\().4s, \arg4\().4s, \arg7\().4s //int16 f[i][0] = e[i][0] + e[i][3];
add \arg1\().4s, \arg5\().4s, \arg6\().4s //int16 f[i][1] = e[i][1] + e[i][2];
sub \arg2\().4s, \arg5\().4s, \arg6\().4s //int16 f[i][2] = e[i][1] - e[i][2];
sub \arg3\().4s, \arg4\().4s, \arg7\().4s //int16 f[i][3] = e[i][0] - e[i][3];
// }
.endm
.macro COL_TRANSFORM_1_STEP arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7
// { // input: src_q[0]~[3], output: e_q[0]~[3];
add \arg4\().4s, \arg0\().4s, \arg2\().4s //int32 e[0][j] = f[0][j] + f[2][j];
sub \arg5\().4s, \arg0\().4s, \arg2\().4s //int32 e[1][j] = f[0][j] - f[2][j];
sshr \arg6\().4s, \arg1\().4s, #1
sshr \arg7\().4s, \arg3\().4s, #1
sub \arg6\().4s, \arg6\().4s, \arg3\().4s //int32 e[2][j] = (f[1][j]>>1) - f[3][j];
add \arg7\().4s, \arg1\().4s, \arg7\().4s //int32 e[3][j] = f[1][j] + (f[3][j]>>1);
// }
.endm
#endif
// x0 int8_t* non_zero_count,
WELS_ASM_AARCH64_FUNC_BEGIN SetNonZeroCount_AArch64_neon
mov x1, x0
ld1 {v0.16b}, [x1], #16
ld1 {v1.8b}, [x1]
cmeq v0.16b, v0.16b, #0
cmeq v1.8b, v1.8b, #0
mvn v0.16b, v0.16b
mvn v1.8b, v1.8b
abs v0.16b, v0.16b
abs v1.8b, v1.8b
st1 {v0.16b}, [x0], #16
st1 {v1.8b}, [x0]
WELS_ASM_AARCH64_FUNC_END
// uint8_t *pred, const int32_t stride, int16_t *rs
WELS_ASM_AARCH64_FUNC_BEGIN IdctResAddPred_AArch64_neon
ld4 {v0.4h, v1.4h, v2.4h, v3.4h}, [x2] // cost 3 cycles!
ROW_TRANSFORM_1_STEP v0, v1, v2, v3, v16, v17, v18, v19, v4, v5
TRANSFORM_4BYTES v0, v1, v2, v3, v16, v17, v18, v19
// transform element 32bits
trn1 v16.4s, v0.4s, v1.4s //[0 1 2 3]+[4 5 6 7]-->[0 4 2 6]
trn2 v17.4s, v0.4s, v1.4s //[0 1 2 3]+[4 5 6 7]-->[1 5 3 7]
trn1 v18.4s, v2.4s, v3.4s //[8 9 10 11]+[12 13 14 15]-->[8 12 10 14]
trn2 v19.4s, v2.4s, v3.4s //[8 9 10 11]+[12 13 14 15]-->[9 13 11 15]
trn1 v0.2d, v16.2d, v18.2d //[0 4 2 6]+[8 12 10 14]-->[0 4 8 12]
trn2 v2.2d, v16.2d, v18.2d //[0 4 2 6]+[8 12 10 14]-->[2 6 10 14]
trn1 v1.2d, v17.2d, v19.2d //[1 5 3 7]+[9 13 11 15]-->[1 5 9 13]
trn2 v3.2d, v17.2d, v19.2d //[1 5 3 7]+[9 13 11 15]-->[3 7 11 15]
COL_TRANSFORM_1_STEP v0, v1, v2, v3, v16, v17, v18, v19
TRANSFORM_4BYTES v0, v1, v2, v3, v16, v17, v18, v19
//after clip_table[MAX_NEG_CROP] into [0, 255]
mov x2, x0
ld1 {v16.s}[0],[x0],x1
ld1 {v16.s}[1],[x0],x1
ld1 {v17.s}[0],[x0],x1
ld1 {v17.s}[1],[x0]
rshrn v0.4h, v0.4s, #6
rshrn2 v0.8h, v1.4s, #6
rshrn v1.4h, v2.4s, #6
rshrn2 v1.8h, v3.4s, #6
uxtl v2.8h,v16.8b
uxtl v3.8h,v17.8b
add v2.8h, v2.8h, v0.8h
add v3.8h, v3.8h, v1.8h
sqxtun v0.8b,v2.8h
sqxtun v1.8b,v3.8h
st1 {v0.s}[0],[x2],x1
st1 {v0.s}[1],[x2],x1
st1 {v1.s}[0],[x2],x1
st1 {v1.s}[1],[x2]
WELS_ASM_AARCH64_FUNC_END
#endif

View File

@@ -52,6 +52,11 @@ void IdctResAddPred_mmx (uint8_t* pPred, const int32_t kiStride, int16_t* pRs);
void IdctResAddPred_neon (uint8_t* pred, const int32_t stride, int16_t* rs);
#endif
#if defined(HAVE_NEON_AARCH64)
void IdctResAddPred_AArch64_neon (uint8_t* pred, const int32_t stride, int16_t* rs);
#endif
#if defined(__cplusplus)
}
#endif//__cplusplus

View File

@@ -67,6 +67,9 @@ extern "C" {
void SetNonZeroCount_neon (int8_t* pNonZeroCount);
#endif
#if defined(HAVE_NEON_AARCH64)
void SetNonZeroCount_AArch64_neon (int8_t* pNonZeroCount);
#endif
#ifdef __cplusplus
}
#endif//__cplusplus

View File

@@ -131,6 +131,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
pNalUnitHeader->uiForbiddenZeroBit = (uint8_t) (pNal[0] >> 7); // uiForbiddenZeroBit
if (pNalUnitHeader->uiForbiddenZeroBit) { //2010.4.14
pCtx->iErrorCode |= dsBitstreamError;
return NULL; //uiForbiddenZeroBit should always equal to 0
}
@@ -186,8 +187,6 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
pCurNal = &pCtx->sPrefixNal;
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
pCtx->iErrorCode |= dsBitstreamError;
PAccessUnit pCurAu = pCtx->pAccessUnitList;
uint32_t uiAvailNalNum = pCurAu->uiAvailUnitsNum;
@@ -198,6 +197,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
}
}
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
pCtx->iErrorCode |= dsBitstreamError;
return NULL;
}
@@ -216,7 +216,7 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
}
}
pCurNal->sNalData.sPrefixNal.bPrefixNalCorrectFlag = false;
pCtx->iErrorCode |= dsInvalidArgument;
pCtx->iErrorCode |= dsBitstreamError;
return NULL;
}
@@ -260,14 +260,13 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
if (pNalUnitHeader->eNalUnitType == NAL_UNIT_CODED_SLICE_EXT) {
if (iNalSize < NAL_UNIT_HEADER_EXT_SIZE) {
pCtx->iErrorCode |= dsBitstreamError;
ForceClearCurrentNal (pCurAu);
if (uiAvailNalNum > 1) {
pCurAu->uiEndPos = uiAvailNalNum - 2;
pCtx->bAuReadyFlag = true;
}
pCtx->iErrorCode |= dsBitstreamError;
return NULL;
}
@@ -281,13 +280,13 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
WelsLog (pLogCtx, WELS_LOG_WARNING, "ParseNalHeader():bUseRefBasePicFlag (%d) != 0, MGS not supported!\n",
pCurNal->sNalHeaderExt.bUseRefBasePicFlag);
pCtx->iErrorCode |= dsInvalidArgument;
ForceClearCurrentNal (pCurAu);
if (uiAvailNalNum > 1) {
pCurAu->uiEndPos = uiAvailNalNum - 2;
pCtx->bAuReadyFlag = true;
}
pCtx->iErrorCode |= dsBitstreamError;
return NULL;
}
pNal += NAL_UNIT_HEADER_EXT_SIZE;
@@ -313,6 +312,9 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
InitBits (pBs, pNal, iBitSize);
iErr = ParseSliceHeaderSyntaxs (pCtx, pBs, bExtensionFlag);
if (iErr != ERR_NONE) {
if ((uiAvailNalNum == 1) && (pCurNal->sNalHeaderExt.bIdrFlag)) { //IDR parse error
ResetActiveSPSForEachLayer (pCtx);
}
//if current NAL occur error when parsing, should clean it from pNalUnitsList
//otherwise, when Next good NAL decoding, this corrupt NAL is considered as normal NAL and lead to decoder crash
ForceClearCurrentNal (pCurAu);
@@ -321,11 +323,11 @@ uint8_t* ParseNalHeader (PWelsDecoderContext pCtx, SNalUnitHeader* pNalUnitHeade
pCurAu->uiEndPos = uiAvailNalNum - 2;
pCtx->bAuReadyFlag = true;
}
pCtx->iErrorCode |= dsBitstreamError;
return NULL;
}
if ((uiAvailNalNum == 1) && ((NAL_UNIT_CODED_SLICE_IDR == pNalUnitHeader->eNalUnitType)
|| (pCurNal->sNalHeaderExt.bIdrFlag))) {
if ((uiAvailNalNum == 1) && CheckNextAuNewSeq (pCtx, pCurNal, pCurNal->sNalData.sVclNal.sSliceHeaderExt.sSliceHeader.pSps)) {
ResetActiveSPSForEachLayer (pCtx);
}
if ((uiAvailNalNum > 1) &&
@@ -508,6 +510,8 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
if (ERR_NONE != iErr) { // modified for pSps/pSubsetSps invalid, 12/1/2009
if (pCtx->iErrorConMethod == ERROR_CON_DISABLE)
pCtx->iErrorCode |= dsNoParamSets;
else
pCtx->iErrorCode |= dsBitstreamError;
return iErr;
}
@@ -520,6 +524,8 @@ int32_t ParseNonVclNal (PWelsDecoderContext pCtx, uint8_t* pRbsp, const int32_t
if (ERR_NONE != iErr) { // modified for pps invalid, 12/1/2009
if (pCtx->iErrorConMethod == ERROR_CON_DISABLE)
pCtx->iErrorCode |= dsNoParamSets;
else
pCtx->iErrorCode |= dsBitstreamError;
return iErr;
}

View File

@@ -1063,6 +1063,12 @@ void WelsBlockFuncInit (SBlockFunc* pFunc, int32_t iCpu) {
pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_neon;
}
#endif
#ifdef HAVE_NEON_AARCH64
if (iCpu & WELS_CPU_NEON) {
pFunc->pWelsSetNonZeroCountFunc = SetNonZeroCount_AArch64_neon;
}
#endif
}
void SetNonZeroCount_c (int8_t* pNonZeroCount) {

View File

@@ -433,6 +433,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
if (NULL == DetectStartCodePrefix (kpBsBuf, &iOffset,
kiBsLen)) { //CAN'T find the 00 00 01 start prefix from the source buffer
pCtx->iErrorCode |= dsBitstreamError;
return dsBitstreamError;
}
@@ -461,6 +462,9 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
iConsumedBytes = 0;
pNalPayload = ParseNalHeader (pCtx, &pCtx->sCurNalHead, pDstNal, iDstIdx, pSrcNal - 3, iSrcIdx + 3, &iConsumedBytes);
if ((pCtx->iErrorConMethod != ERROR_CON_DISABLE) && (IS_VCL_NAL (pCtx->sCurNalHead.eNalUnitType, 1))) {
CheckAndDoEC (pCtx, ppDst, pDstBufInfo);
}
if (IS_PARAM_SETS_NALS (pCtx->sCurNalHead.eNalUnitType) && pNalPayload) {
iRet = ParseNonVclNal (pCtx, pNalPayload, iDstIdx - iConsumedBytes);
}
@@ -473,6 +477,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
if (dsOutOfMemory & pCtx->iErrorCode) {
@@ -488,6 +493,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if (pCtx->iErrorConMethod == ERROR_CON_DISABLE)
ResetParameterSetsState (pCtx);
}
return pCtx->iErrorCode;
@@ -531,6 +537,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
@@ -566,6 +573,7 @@ int32_t WelsDecodeBs (PWelsDecoderContext pCtx, const uint8_t* kpBsBuf, const in
#else
pCtx->bReferenceLostAtT0Flag = true;
#endif
if ((pCtx->iErrorConMethod == ERROR_CON_DISABLE) || (dsOutOfMemory & pCtx->iErrorCode))
ResetParameterSetsState (pCtx);
return pCtx->iErrorCode;
}
@@ -682,7 +690,7 @@ void AssignFuncPointerForRec (PWelsDecoderContext pCtx) {
#if defined(HAVE_NEON_AARCH64)
if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
//pCtx->pIdctResAddPredFunc = IdctResAddPred_neon;
pCtx->pIdctResAddPredFunc = IdctResAddPred_AArch64_neon;
pCtx->pGetI16x16LumaPredFunc[I16_PRED_DC] = WelsDecoderI16x16LumaPredDc_AArch64_neon;
pCtx->pGetI16x16LumaPredFunc[I16_PRED_P] = WelsDecoderI16x16LumaPredPlane_AArch64_neon;

View File

@@ -537,6 +537,7 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
//add check PPS available here
if (pCtx->bPpsAvailFlags[iPpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "PPS id is invalid!\n");
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID);
}
@@ -552,11 +553,13 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
pSps = &pSubsetSps->sSps;
if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!\n");
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
}
} else {
if (pCtx->bSpsAvailFlags[pPps->iSpsId] == false) {
WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!\n");
pCtx->iErrorCode |= dsNoParamSets;
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
}
pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
@@ -1973,9 +1976,8 @@ int32_t DecodeCurrentAccessUnit (PWelsDecoderContext pCtx, uint8_t** ppDst, SBuf
return ERR_NONE;
}
pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for EC
if (uiNalRefIdc > 0) {
pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //store latest decoded picture for EC
iRet = WelsMarkAsRef (pCtx);
if (iRet != ERR_NONE) {
if (pCtx->iErrorConMethod == ERROR_CON_DISABLE) {
@@ -2010,8 +2012,10 @@ bool CheckAndDoEC (PWelsDecoderContext pCtx, uint8_t** ppDst, SBufferInfo* pDstI
ImplementErrorCon (pCtx);
pCtx->iTotalNumMbRec = pCtx->pSps->iMbWidth * pCtx->pSps->iMbHeight;
DecodeFrameConstruction (pCtx, ppDst, pDstInfo);
if (pCtx->sLastNalHdrExt.sNalUnitHeader.uiNalRefIdc > 0) {
pCtx->pPreviousDecodedPictureInDpb = pCtx->pDec; //save ECed pic for future use
MarkECFrameAsRef (pCtx);
}
pCtx->iPrevFrameNum = pCtx->sLastSliceHeader.iFrameNum; //save frame_num
if (pCtx->bLastHasMmco5)
pCtx->iPrevFrameNum = 0;

View File

@@ -61,6 +61,13 @@ void InitErrorCon (PWelsDecoderContext pCtx) {
pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_neon; //aligned
}
#endif //HAVE_NEON
#if defined(HAVE_NEON_AARCH64)
if (pCtx->uiCpuFlag & WELS_CPU_NEON) {
pCtx->sCopyFunc.pCopyLumaFunc = WelsCopy16x16_AArch64_neon; //aligned
pCtx->sCopyFunc.pCopyChromaFunc = WelsCopy8x8_AArch64_neon; //aligned
}
#endif //HAVE_NEON_AARCH64
} //TODO add more methods here
return;
}

View File

@@ -121,6 +121,8 @@ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) {
pRef->iFrameNum = 0;
pRef->iFramePoc = 0;
pRef->uiTemporalId = pRef->uiQualityId = 0;
ExpandReferencingPicture (pRef->pData, pRef->iWidthInPixel, pRef->iHeightInPixel, pRef->iLinesize,
pCtx->sExpandPicFunc.pfExpandLumaPicture, pCtx->sExpandPicFunc.pfExpandChromaPicture);
AddShortTermToList (&pCtx->sRefPic, pRef);
} else {
WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "WelsInitRefList()::PrefetchPic for EC errors.\n");

View File

@@ -83,6 +83,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const
iChromaSize = iPicChromaWidth * iPicChromaHeight;
pPic->pBuffer[0] = static_cast<uint8_t*> (WelsMalloc (iLumaSize /* luma */
+ (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));
memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1)));
WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic));
pPic->iLinesize[0] = iPicWidth;

View File

@@ -46,6 +46,7 @@
#include "typedefs.h"
#include "mem_align.h"
#include "utils.h"
#include "version.h"
//#include "macros.h"
#include "decoder.h"
@@ -211,7 +212,7 @@ void CWelsDecoder::UninitDecoder (void) {
if (NULL == m_pDecContext)
return;
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::uninit_decoder()..");
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsDecoder::uninit_decoder(), openh264 codec version = %s.", VERSION_NUMBER);
WelsEndDecoder (m_pDecContext);

View File

@@ -41,6 +41,7 @@ endif
ifeq ($(ASM_ARCH), arm64)
DECODER_ASM_ARM64_SRCS=\
$(DECODER_SRCDIR)/core/arm64/block_add_aarch64_neon.S\
$(DECODER_SRCDIR)/core/arm64/intra_pred_aarch64_neon.S\
DECODER_OBJS += $(DECODER_ASM_ARM64_SRCS:.S=.$(OBJ))

View File

@@ -54,6 +54,8 @@ uint16_t* pLocationPointer; // buffer of position array
int32_t iActualListSize; // actual list size
uint32_t uiSadCostThreshold[BLOCK_SIZE_ALL];
bool bRefBlockFeatureCalculated; // flag of whether pre-process is done
uint16_t**
pFeatureValuePointerList;//uint16_t* pFeatureValuePointerList[WELS_MAX (LIST_SIZE_SUM_16x16, LIST_SIZE_MSE_16x16)]
} SScreenBlockFeatureStorage; //should be stored with RefPic, one for each frame
/*

View File

@@ -102,9 +102,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) {
WelsLog (pLogCtx, WELS_LOG_WARNING,
"ParamValidation(), screen change detection should be turned on,change bEnableSceneChangeDetect as true\n");
}
//LTR logic needs more testing
pCfg->bEnableLongTermReference = false;
pCfg->iLTRRefNum = 0;
}
if (pCfg->iSpatialLayerNum > 1) {
int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;
@@ -3718,7 +3716,10 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
pOldParam->bPrefixNalAddingCtrl = pNewParam->bPrefixNalAddingCtrl;
pOldParam->iNumRefFrame = pNewParam->iNumRefFrame; // number of reference frame used
pOldParam->uiGopSize = pNewParam->uiGopSize;
if (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) {
pOldParam->iTemporalLayerNum = pNewParam->iTemporalLayerNum;
(*ppCtx)->iCodingIndex = 0;
}
pOldParam->iDecompStages = pNewParam->iDecompStages;
/* denoise control */
pOldParam->bEnableDenoise = pNewParam->bEnableDenoise;

View File

@@ -127,6 +127,7 @@ static void DeleteNonSceneLTR (sWelsEncCtx* pCtx) {
(pCtx->uiTemporalId < pRef->uiTemporalId || pCtx->bCurFrameMarkedAsSceneLtr)) {
SetUnref (pRef);
DeleteLTRFromLongList (pCtx, i);
i--;
}
}
}

View File

@@ -622,6 +622,11 @@ int32_t RequestScreenBlockFeatureStorage (CMemoryAlign* pMa, const int32_t kiFra
pScreenBlockFeatureStorage->pLocationPointer = (uint16_t*)pMa->WelsMalloc (2 * kiFrameSize * sizeof (uint16_t),
"pScreenBlockFeatureStorage->pLocationPointer");
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pLocationPointer)
// uint16_t* pFeatureValuePointerList[WELS_MAX (LIST_SIZE_SUM_16x16, LIST_SIZE_MSE_16x16)] = {0};
pScreenBlockFeatureStorage->pFeatureValuePointerList = (uint16_t**)pMa->WelsMalloc (WELS_MAX (LIST_SIZE_SUM_16x16,
LIST_SIZE_MSE_16x16) * sizeof (uint16_t*),
"pScreenBlockFeatureStorage->pFeatureValuePointerList");
WELS_VERIFY_RETURN_IF (ENC_RETURN_MEMALLOCERR, NULL == pScreenBlockFeatureStorage->pFeatureValuePointerList)
pScreenBlockFeatureStorage->pFeatureOfBlockPointer = NULL;
pScreenBlockFeatureStorage->iIs16x16 = !bIsBlock8x8;
@@ -649,6 +654,12 @@ int32_t ReleaseScreenBlockFeatureStorage (CMemoryAlign* pMa, SScreenBlockFeature
pScreenBlockFeatureStorage->pLocationPointer = NULL;
}
if (pScreenBlockFeatureStorage->pFeatureValuePointerList) {
pMa->WelsFree (pScreenBlockFeatureStorage->pFeatureValuePointerList,
"pScreenBlockFeatureStorage->pFeatureValuePointerList");
pScreenBlockFeatureStorage->pFeatureValuePointerList = NULL;
}
return ENC_RETURN_SUCCESS;
}
return ENC_RETURN_UNEXPECTED;
@@ -760,7 +771,6 @@ bool CalculateFeatureOfBlock (SWelsFuncPtrList* pFunc, SPicture* pRef,
const int32_t iWidth = pRef->iWidthInPixel - iEdgeDiscard;
const int32_t kiHeight = pRef->iHeightInPixel - iEdgeDiscard;
const int32_t kiActualListSize = pScreenBlockFeatureStorage->iActualListSize;
uint16_t* pFeatureValuePointerList[WELS_MAX (LIST_SIZE_SUM_16x16, LIST_SIZE_MSE_16x16)] = {0};
memset (pTimesOfFeatureValue, 0, sizeof (int32_t)*kiActualListSize);
(pFunc->pfCalculateBlockFeatureOfFrame[iIs16x16]) (pRefData, iWidth, kiHeight, iRefStride, pFeatureOfBlock,
@@ -768,10 +778,11 @@ bool CalculateFeatureOfBlock (SWelsFuncPtrList* pFunc, SPicture* pRef,
//assign pLocationOfFeature pointer
InitializeHashforFeature_c (pTimesOfFeatureValue, pBuf, kiActualListSize,
pLocationOfFeature, pFeatureValuePointerList);
pLocationOfFeature, pScreenBlockFeatureStorage->pFeatureValuePointerList);
//assign each pixel's pLocationOfFeature
FillQpelLocationByFeatureValue_c (pFeatureOfBlock, iWidth, kiHeight, pFeatureValuePointerList);
FillQpelLocationByFeatureValue_c (pFeatureOfBlock, iWidth, kiHeight,
pScreenBlockFeatureStorage->pFeatureValuePointerList);
return true;
}

View File

@@ -37,7 +37,7 @@
#include "wels_const.h"
#include "utils.h"
#include "macros.h"
#include "version.h"
#include "crt_util_safe_x.h" // Safe CRT routines like util for cross platforms
#include "ref_list_mgr_svc.h"
@@ -174,7 +174,7 @@ void CWelsH264SVCEncoder::InitEncoder (void) {
}
m_pWelsTrace->SetTraceLevel (WELS_LOG_ERROR);
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::InitEncoder(), openh264 codec version = %s", VERSION_NUMBER);
#ifdef REC_FRAME_COUNT
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
"CWelsH264SVCEncoder::InitEncoder, m_uiCountFrameNum= %d, m_iCspInternal= 0x%x\n", m_uiCountFrameNum, m_iCspInternal);

View File

@@ -1,6 +1,7 @@
#include <gtest/gtest.h>
#include "macros.h"
#include "decode_mb_aux.h"
#include "../../codec/decoder/core/src/decode_slice.cpp"
using namespace WelsDec;
void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
int16_t iSrc[16];
@@ -39,6 +40,14 @@ void IdctResAddPred_ref (uint8_t* pPred, const int32_t kiStride, int16_t* pRs) {
}
}
void SetNonZeroCount_ref (int8_t* pNonZeroCount) {
int32_t i;
for (i = 0; i < 24; i++) {
pNonZeroCount[i] = !!pNonZeroCount[i];
}
}
#define GENERATE_IDCTRESADDPRED(pred) \
TEST(DecoderDecodeMbAux, pred) {\
const int32_t kiStride = 32;\
@@ -79,3 +88,47 @@ GENERATE_IDCTRESADDPRED (IdctResAddPred_mmx)
#if defined(HAVE_NEON)
GENERATE_IDCTRESADDPRED (IdctResAddPred_neon)
#endif
#if defined(HAVE_NEON_AARCH64)
GENERATE_IDCTRESADDPRED (IdctResAddPred_AArch64_neon)
#endif
#define GENERATE_SETNONZEROCOUNT(method) \
TEST(DecoderDecodeMbAux, method) \
{\
int8_t iNonZeroCount[2][24];\
for(int32_t i = 0; i < 24; i++) {\
iNonZeroCount[0][i] = iNonZeroCount[1][i] = (rand() % 256)-128;\
}\
method(iNonZeroCount[0]);\
SetNonZeroCount_ref(iNonZeroCount[1]);\
for(int32_t i =0; i<24; i++) {\
ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
}\
for(int32_t i =0; i<24; i++) {\
iNonZeroCount[0][i] = iNonZeroCount[1][i] = -128;\
}\
method(iNonZeroCount[0]);\
SetNonZeroCount_ref(iNonZeroCount[1]);\
for(int32_t i =0; i<24; i++) {\
ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
}\
for(int32_t i =0; i<24; i++) {\
iNonZeroCount[0][i] = iNonZeroCount[1][i] = 127;\
}\
method(iNonZeroCount[0]);\
SetNonZeroCount_ref(iNonZeroCount[1]);\
for(int32_t i =0; i<24; i++) {\
ASSERT_EQ (iNonZeroCount[0][i], iNonZeroCount[1][i]);\
}\
}
GENERATE_SETNONZEROCOUNT (SetNonZeroCount_c)
#if defined(HAVE_NEON)
GENERATE_SETNONZEROCOUNT (SetNonZeroCount_neon)
#endif
#if defined(HAVE_NEON_AARCH64)
GENERATE_SETNONZEROCOUNT (SetNonZeroCount_AArch64_neon)
#endif