diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml index 1b393cb..fddb28f 100644 --- a/.github/workflows/cifuzz.yml +++ b/.github/workflows/cifuzz.yml @@ -20,7 +20,7 @@ jobs: language: c++ fuzz-seconds: 600 - name: Upload Crash - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 if: failure() && steps.build.outcome == 'success' with: name: artifacts diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 0883029..0ec6d70 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,100 +2,22 @@ name: CMake on: push: + branches: [ "main" ] pull_request: + branches: [ "main" ] env: BUILD_TYPE: Release jobs: build: - strategy: - matrix: - include: - - name: ubuntu-latest-gcc-cmake - os: ubuntu-latest - cc: gcc - cxx: g++ - build-system: cmake - cmake-opts: '' - - - name: ubuntu-latest-clang-cmake - os: ubuntu-latest - cc: clang - cxx: clang++ - build-system: cmake - cmake-opts: '' - - - name: ubuntu-24.04-arm-clang-cmake - os: ubuntu-24.04-arm - cc: clang - cxx: clang++ - build-system: cmake - cmake-opts: '' - - - name: ubuntu-latest-clang-cmake-asan-fuzzer - os: ubuntu-latest - cc: clang - cxx: clang++ - build-system: cmake - cmake-opts: '-DSANITIZE=fuzzer-no-link,address' - - - name: ubuntu-latest-clang-cmake-ninja - os: ubuntu-latest - cc: clang - cxx: clang++ - build-system: cmake - cmake-opts: '-G Ninja' - - - name: macos-latest-clang-cmake - os: macos-latest - cc: clang - cxx: clang++ - build-system: cmake - cmake-opts: '' - - - name: ubuntu-latest-cross-aarch64-cmake - os: ubuntu-latest - cc: aarch64-linux-gnu-gcc - cxx: aarch64-linux-gnu-g++ - build-system: cmake - cmake-opts: '-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch64_toolchain.cmake' - - - name: ubuntu-latest-cross-aarch32-cmake - os: ubuntu-latest - cc: arm-linux-gnueabihf-gcc - cxx: arm-linux-gnueabihf-g++ - build-system: cmake - cmake-opts: '-DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake' - - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - - name: Install Linux dependencies - if: startsWith(matrix.os,'ubuntu') && contains(matrix.cmake-opts,'-G Ninja') - run: | - sudo apt-get update - sudo apt-get install -y ninja-build - - - name: Install cross-aarch64 dependencies - if: startsWith(matrix.os,'ubuntu') && contains(matrix.cmake-opts,'aarch64') - run: | - sudo apt-get update - sudo apt-get install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - - - name: Install cross-arm dependencies - if: startsWith(matrix.os,'ubuntu') && contains(matrix.cmake-opts,'aarch32') - run: | - sudo apt-get update - sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf + - uses: actions/checkout@v3 - name: Configure CMake - env: - CC: ${{ matrix.cc }} - CXX: ${{ matrix.cxx }} - run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.cmake-opts }} + run: cmake -B ${{github.workspace}}/out -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ - name: Build run: cmake --build ${{github.workspace}}/out --config ${{env.BUILD_TYPE}} diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json deleted file mode 100644 index 9e7a00e..0000000 --- a/.vscode/c_cpp_properties.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "configurations": [ - { - "name": "Native", - "includePath": [ - "${workspaceFolder}/**", - "${workspaceFolder}/common", - "${workspaceFolder}/decoder", - "${workspaceFolder}/encoder" - ], - "defines": [], - "cStandard": "c17", - "cppStandard": "c++17", - "configurationProvider": "ms-vscode.cmake-tools" - } - ], - "version": 4 -} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index d72be95..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "version": "0.2.0", - "configurations": [ - { - "name": "Run hevcenc - Linux", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/hevcenc", - "args": ["../test/encoder/vid_enc_cfg.txt"], - "stopAtEntry": false, - "cwd": "${workspaceFolder}/build", - "environment": [], - "externalConsole": false, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - }, - { - "name": "Run hevcdec - Linux", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/hevcdec", - "args": ["../test/decoder/test.cfg"], - "stopAtEntry": false, - "cwd": "${workspaceFolder}/build", - "environment": [], - "externalConsole": false, - "MIMode": "gdb", - "setupCommands": [ - { - "description": "Enable pretty-printing for gdb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - }, - { - "name": "Run hevcenc - Mac", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/hevcenc", - "args": ["../test/encoder/vid_enc_cfg.txt"], - "stopAtEntry": false, - "cwd": "${workspaceFolder}/build", - "environment": [], - "externalConsole": false, - "MIMode": "lldb", - "setupCommands": [ - { - "description": "Enable pretty-printing for lldb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - }, - { - "name": "Run hevcdec - Mac", - "type": "cppdbg", - "request": "launch", - "program": "${workspaceFolder}/build/hevcdec", - "args": ["../test/decoder/test.cfg"], - "stopAtEntry": false, - "cwd": "${workspaceFolder}/build", - "environment": [], - "externalConsole": false, - "MIMode": "lldb", - "setupCommands": [ - { - "description": "Enable pretty-printing for lldb", - "text": "-enable-pretty-printing", - "ignoreFailures": true - } - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 5b06b51..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "cmake.buildDirectory": "${workspaceFolder}/build", - "cmake.sourceDirectory": "${workspaceFolder}", - "cmake.configureArgs": [ - "-DENABLE_MVC=OFF", - "-DENABLE_SVC=OFF", - "-DENABLE_TESTS=OFF", - "-DCMAKE_C_COMPILER=clang", - "-DCMAKE_CXX_COMPILER=clang++" - ], - "cmake.preferredGenerators": [ - "Unix Makefiles" - ], - "cmake.debugConfig": { - "hevcenc": "hevcenc", - "hevcdec": "hevcdec" - }, - "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 646fbf8..0000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": "2.0.0", - "tasks": [ - { - "type": "cmake", - "label": "Configure", - "command": "configure", - "problemMatcher": [ - "$gcc" - ], - "group": "build" - }, - { - "type": "cmake", - "label": "Build", - "command": "build", - "problemMatcher": [ - "$gcc" - ], - "group": { - "kind": "build", - "isDefault": true - }, - "dependsOn": [ - "Configure" - ] - } - ] -} \ No newline at end of file diff --git a/Android.bp b/Android.bp index 8b76057..3faede7 100644 --- a/Android.bp +++ b/Android.bp @@ -41,7 +41,6 @@ cc_library_static { cflags: [ "-D_LIB", "-fPIC", - "-DENABLE_MAIN_REXT_PROFILE", "-O3", "-DANDROID", @@ -51,6 +50,8 @@ cc_library_static { // common/x86/ihevc_sao_ssse3_intr.c: implicit conversion from // 'int' to 'char' changes value from 128 to -128 "-Wno-error=constant-conversion", + // #KEEP_THREAD_ACTIVE is experimental + "-UKEEP_THREADS_ACTIVE", ], export_include_dirs: [ @@ -65,7 +66,6 @@ cc_library_static { "common/ihevc_chroma_iquant_itrans_recon.c", "common/ihevc_chroma_iquant_recon.c", "common/ihevc_chroma_itrans_recon.c", - "common/ihevc_chroma_itrans_recon_32x32.c", "common/ihevc_chroma_itrans_recon_16x16.c", "common/ihevc_chroma_itrans_recon_8x8.c", "common/ihevc_chroma_recon.c", @@ -79,7 +79,6 @@ cc_library_static { "common/ihevc_iquant_itrans_recon.c", "common/ihevc_iquant_recon.c", "common/ihevc_itrans.c", - "common/ihevc_itrans_res.c", "common/ihevc_itrans_recon.c", "common/ihevc_itrans_recon_16x16.c", "common/ihevc_itrans_recon_32x32.c", @@ -205,6 +204,7 @@ cc_library_static { "decoder/arm/ihevcd_function_selector_noneon.c", "decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s", "decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s", + "decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s", "decoder/arm64/ihevcd_function_selector_av8.c", "decoder/arm64/ihevcd_itrans_recon_dc_chroma.s", "decoder/arm64/ihevcd_itrans_recon_dc_luma.s", @@ -284,6 +284,7 @@ cc_library_static { "common/arm/ihevc_weighted_pred_uni.s", "decoder/arm/ihevcd_fmt_conv_420sp_to_420p.s", "decoder/arm/ihevcd_fmt_conv_420sp_to_420sp.s", + "decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s", "decoder/arm/ihevcd_function_selector_a9q.c", "decoder/arm/ihevcd_itrans_recon_dc_chroma.s", "decoder/arm/ihevcd_itrans_recon_dc_luma.s", @@ -418,17 +419,19 @@ cc_library_static { min_sdk_version: "29", } -cc_binary { +cc_test { name: "hevcdec", host_supported: true, cflags: [ "-DPROFILE_ENABLE", + "-DDISABLE_SEI", "-DARM", "-fPIC", "-DMD5_DISABLE", "-Wall", "-Werror", ], + gtest: false, srcs: ["test/decoder/main.c"], static_libs: ["libhevcdec"], target: { @@ -461,7 +464,6 @@ cc_library_static { "common/ihevc_cabac_tables.c", "common/ihevc_chroma_intra_pred_filters.c", "common/ihevc_chroma_itrans_recon.c", - "common/ihevc_chroma_itrans_recon_32x32.c", "common/ihevc_chroma_itrans_recon_16x16.c", "common/ihevc_chroma_itrans_recon_8x8.c", "common/ihevc_common_tables.c", @@ -804,15 +806,17 @@ cc_library_static { min_sdk_version: "29", } -cc_binary { +cc_test { name: "hevcenc", host_supported: true, cflags: [ "-DARM", + "-DDISABLE_SEI", "-fPIC", "-Wall", "-Werror", ], + gtest: false, srcs: ["test/encoder/main.c"], static_libs: ["libhevcenc"], sanitize: { diff --git a/CMakeLists.txt b/CMakeLists.txt index 5fe0e2e..590f117 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,6 @@ cmake_minimum_required(VERSION 3.9.1) project(libhevc C CXX) - -if(NOT DEFINED SYSTEM_NAME) - set(SYSTEM_NAME ${CMAKE_HOST_SYSTEM_NAME}) -endif() - -if(NOT DEFINED SYSTEM_PROCESSOR) - set(SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR}) -endif() - -if(NOT "${SYSTEM_NAME}" STREQUAL "Darwin") - enable_language(ASM) -endif() +enable_language(ASM) set(HEVC_ROOT "${CMAKE_CURRENT_SOURCE_DIR}") set(HEVC_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}") @@ -42,7 +31,6 @@ endif() include("${HEVC_ROOT}/cmake/utils.cmake") libhevc_add_compile_options() -libhevc_add_gtest() libhevc_add_definitions() libhevc_set_link_libraries() @@ -55,5 +43,3 @@ include("${HEVC_ROOT}/test/encoder/hevcenc.cmake") include("${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cmake") include("${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cmake") - -include("${HEVC_ROOT}/tests/common/common.cmake") diff --git a/README.md b/README.md index ad3f5b6..a9e5758 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ Supports: - aarch32/aarch64 on Linux. - aarch32/aarch64 on Android. - x86_32/x86_64 on Linux. -- aarch64 on Mac. -- x86_64 on Mac. ## Native Builds Use the following commands for building on the target machine @@ -53,29 +51,3 @@ $ make $ cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/aarch32_toolchain.cmake $ make ``` - -### Building for android -NOTE: This assumes that you are building on a machine that has - [Android NDK](https://developer.android.com/ndk/downloads). - -``` -$ cd external/libhevc -$ mkdir build -$ cd build -``` - -#### Armv7 (32-bit) - - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android_toolchain.cmake\ - -DHEVC_ANDROID_NDK_PATH=/opt/android-ndk-r26d/\ - -DANDROID_ABI=armeabi-v7a\ - -DANDROID_PLATFORM=android-23 ../ - make - -#### Armv8 (64-bit) - - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android_toolchain.cmake\ - -DHEVC_ANDROID_NDK_PATH=/opt/android-ndk-r26d/\ - -DANDROID_ABI=arm64-v8a\ - -DANDROID_PLATFORM=android-23 ../ - make diff --git a/cmake/toolchains/aarch32_toolchain.cmake b/cmake/toolchains/aarch32_toolchain.cmake index 4939299..5fabde2 100644 --- a/cmake/toolchains/aarch32_toolchain.cmake +++ b/cmake/toolchains/aarch32_toolchain.cmake @@ -1,10 +1,7 @@ -set(SYSTEM_NAME Linux) -set(SYSTEM_PROCESSOR aarch32) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR aarch32) # Modify these variables with paths to appropriate compilers that can produce # armv7 targets set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc) set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++) - -# Build all binaries as static, so that they can be run using qemu -set(CMAKE_EXE_LINKER_FLAGS "-static") diff --git a/cmake/toolchains/aarch64_toolchain.cmake b/cmake/toolchains/aarch64_toolchain.cmake index c3fc290..5efbf77 100644 --- a/cmake/toolchains/aarch64_toolchain.cmake +++ b/cmake/toolchains/aarch64_toolchain.cmake @@ -1,5 +1,5 @@ -set(SYSTEM_NAME Linux) -set(SYSTEM_PROCESSOR aarch64) +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR aarch64) # Modify these variables with paths to appropriate compilers that can produce # armv8 targets @@ -11,6 +11,3 @@ set(CMAKE_C_COMPILER_AR set(CMAKE_CXX_COMPILER_AR aarch64-linux-gnu-gcc-ar CACHE FILEPATH "Archiver") - -# Build all binaries as static, so that they can be run using qemu -set(CMAKE_EXE_LINKER_FLAGS "-static") diff --git a/cmake/toolchains/android_toolchain.cmake b/cmake/toolchains/android_toolchain.cmake deleted file mode 100644 index e661b8a..0000000 --- a/cmake/toolchains/android_toolchain.cmake +++ /dev/null @@ -1,34 +0,0 @@ -set(SYSTEM_NAME Android) -set(CMAKE_SYSTEM_NAME Android) - -if(NOT ANDROID_PLATFORM) - set(ANDROID_PLATFORM android-23) -endif() - -# Choose target architecture with: -# -DANDROID_ABI={armeabi-v7a, arm64-v8a, x86, x86_64} -if(NOT ANDROID_ABI) - set(ANDROID_ABI arm64-v8a) -endif() - -if(ANDROID_ABI MATCHES "^armeabi") - set(SYSTEM_PROCESSOR aarch32) -else() - set(SYSTEM_PROCESSOR aarch64) -endif() - -# Toolchain files don't have access to cached variables: -# https://gitlab.kitware.com/cmake/cmake/issues/16170. Set an intermediate -# environment variable when loaded the first time. -if(HEVC_ANDROID_NDK_PATH) - set(ENV{HEVC_ANDROID_NDK_PATH} "${HEVC_ANDROID_NDK_PATH}") -else() - set(HEVC_ANDROID_NDK_PATH "$ENV{HEVC_ANDROID_NDK_PATH}") -endif() - -if(NOT HEVC_ANDROID_NDK_PATH) - message(FATAL_ERROR "HEVC_ANDROID_NDK_PATH not set.") - return() -endif() - -include("${HEVC_ANDROID_NDK_PATH}/build/cmake/android.toolchain.cmake") \ No newline at end of file diff --git a/cmake/utils.cmake b/cmake/utils.cmake index f921656..e8b97ac 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -2,9 +2,9 @@ include(CheckCXXCompilerFlag) # Adds compiler options for all targets function(libhevc_add_compile_options) - if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" STREQUAL "arm64") + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") add_compile_options(-march=armv8-a) - elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch32") + elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch32") add_compile_options(-march=armv7-a -mfpu=neon) else() add_compile_options(-msse4.2 -mno-avx) @@ -32,15 +32,9 @@ endfunction() # Adds defintions for all targets function(libhevc_add_definitions) - if("${SYSTEM_NAME}" STREQUAL "Darwin") - if("${SYSTEM_PROCESSOR}" STREQUAL "arm64") - add_definitions(-DARMV8 -DDARWIN -DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC) - else() - add_definitions(-DX86 -DDARWIN -DDISABLE_AVX2 -DDEFAULT_ARCH=D_ARCH_X86_GENERIC) - endif() - elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch64") + if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch64") add_definitions(-DARMV8 -DDEFAULT_ARCH=D_ARCH_ARMV8_GENERIC -DENABLE_NEON) - elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch32") + elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "aarch32") add_definitions(-DARMV7 -DDEFAULT_ARCH=D_ARCH_ARM_A9Q -DENABLE_NEON -DDISABLE_NEONINTR) else() @@ -118,35 +112,3 @@ endfunction() function(libhevc_add_fuzzer NAME LIB) libhevc_add_executable(${NAME} ${LIB} FUZZER 1 ${ARGV}) endfunction() - -# Adds GoogleTest and Threads dependency -function(libhevc_add_gtest) - include(FetchContent) - FetchContent_Declare( - googletest - URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip - ) - # For Windows: Prevent overriding the parent project's compiler/linker settings - set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) - FetchContent_MakeAvailable(googletest) -endfunction() - -# cmake-format: off -# Adds a target for a gtest executable -# -# Arguments: -# NAME: Name of the executable -# -# Optional Arguments: -# SOURCES: Additional source files -# cmake-format: on -function(libhevc_add_gtest_executable NAME) - set(multi_value_args SOURCES) - cmake_parse_arguments(ARG "" "" "${multi_value_args}" ${ARGN}) - - libhevc_add_executable( - ${NAME} libhevcdec - SOURCES ${HEVC_ROOT}/tests/common/func_selector.cc - ${HEVC_ROOT}/tests/common/tests_common.cc ${ARG_SOURCES} - LIBS GTest::gtest_main) -endfunction() diff --git a/common/arm/ihevc_intra_pred_filters_neon_intr.c b/common/arm/ihevc_intra_pred_filters_neon_intr.c index 11749d1..190cccc 100644 --- a/common/arm/ihevc_intra_pred_filters_neon_intr.c +++ b/common/arm/ihevc_intra_pred_filters_neon_intr.c @@ -438,11 +438,6 @@ void ihevc_intra_pred_luma_ref_substitution_neonintr(UWORD8 *pu1_top_left, * @param[in] mode * integer intraprediction mode * - * @param[in] intra_smoothing_flags - * integer bit 3 indicates if intra smoothing is enabled/disabled - * unconditionally. this is applicable to frext profiles only - * bit 0 indicates strong intra smoothing enabled/disabled - * * @returns * * @remarks @@ -456,7 +451,7 @@ void ihevc_intra_pred_ref_filtering_neonintr(UWORD8 *pu1_src, WORD32 nt, UWORD8 *pu1_dst, WORD32 mode, - WORD32 intra_smoothing_flags) + WORD32 strong_intra_smoothing_enable_flag) { WORD32 filter_flag; WORD32 i = 0; @@ -480,12 +475,10 @@ void ihevc_intra_pred_ref_filtering_neonintr(UWORD8 *pu1_src, WORD32 abs_cond_left_flag = 0; WORD32 abs_cond_top_flag = 0; WORD32 dc_val = 1 << (BIT_DEPTH - 5); - WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3); - WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1; - shift_res = vdup_n_u8(0); - filter_flag = intra_smoothing_disabled ? - 0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2))); + + filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)); + if(0 == filter_flag) { if(pu1_src == pu1_dst) diff --git a/common/arm/ihevc_intra_ref_substitution_a9q.c b/common/arm/ihevc_intra_ref_substitution_a9q.c index a7a3ee8..fcdf0f2 100644 --- a/common/arm/ihevc_intra_ref_substitution_a9q.c +++ b/common/arm/ihevc_intra_ref_substitution_a9q.c @@ -103,8 +103,7 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, WORD32 nt, WORD32 nbr_flags, UWORD8 *pu1_dst, - WORD32 dst_strd, - WORD32 chroma_format_idc) + WORD32 dst_strd) { UWORD8 pu1_ref_u, pu1_ref_v; WORD32 dc_val, i, j; @@ -181,7 +180,7 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, // U-V interleaved Top-top right samples } - if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + if(nt == 4) { /* 1 bit extraction for all the neighboring blocks */ tp_left = (nbr_flags & 0x10000) >> 16; @@ -249,9 +248,8 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, } } - else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + else if(nt == 8) { - WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1; WORD32 nbr_flags_temp = 0; nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4) + ((nbr_flags & 0x300) >> 4) @@ -261,16 +259,16 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, /* compute trailing zeors based on nbr_flag for substitution process of below left see section .*/ /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */ { - nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */ - if(nbr_id_from_bl == 32 * sub_sample) - nbr_id_from_bl = 16 * sub_sample; - if(nbr_id_from_bl == 16 * sub_sample) + nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 4; /* for bottom left and left */ + if(nbr_id_from_bl == 32) + nbr_id_from_bl = 16; + if(nbr_id_from_bl == 16) { /* for top left : 1 pel per nbr bit */ if(!((nbr_flags_temp >> 8) & 0x1)) { nbr_id_from_bl++; - nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4 * sub_sample; /* top and top right; 8 pels per nbr bit */ + nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4; /* top and top right; 8 pels per nbr bit */ } } @@ -289,14 +287,14 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, } /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */ - while(nbr_id_from_bl < ((T8C_4NT * sub_sample)+1)) + while(nbr_id_from_bl < ((T8C_4NT)+1)) { /* To Obtain the next unavailable idx flag after reverse neighbor substitution */ /* Divide by 8 to obtain the original index */ - frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/ + frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/ /* The Top-left flag is at the last bit location of nbr_flags*/ - if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) + if(nbr_id_from_bl == (T8C_4NT / 2)) { get_bits = GET_BIT(nbr_flags_temp, 8); @@ -315,23 +313,22 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, UWORD16 *pu2_dst; /* 8 pel substitution (other than TL) */ pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2]; - ihevc_memset_16bit_a9q((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample); + ihevc_memset_16bit_a9q((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4); } } - nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample; + nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT / 2)) ? 1 : 4; } } - else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + else if(nt == 16) { - WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1; /* compute trailing ones based on mbr_flag for substitution process of below left see section .*/ /* as each bit in nbr flags corresponds to 4 pels for bot_left, left, top and topright but 1 pel for topleft */ { - nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */ + nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4; /* for bottom left and left */ - if(nbr_id_from_bl == 32 * sub_sample) + if(nbr_id_from_bl == 32) { /* for top left : 1 pel per nbr bit */ if(!((nbr_flags >> 16) & 0x1)) @@ -339,7 +336,7 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, /* top left not available */ nbr_id_from_bl++; /* top and top right; 4 pels per nbr bit */ - nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample; + nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4; } } /* Reverse Substitution Process*/ @@ -357,14 +354,14 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, } /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */ - while(nbr_id_from_bl < ((T16C_4NT * sub_sample)+1)) + while(nbr_id_from_bl < ((T16C_4NT)+1)) { /* To Obtain the next unavailable idx flag after reverse neighbor substitution */ /* Devide by 4 to obtain the original index */ - frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/ + frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/ /* The Top-left flag is at the last bit location of nbr_flags*/ - if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) + if(nbr_id_from_bl == (T16C_4NT / 2)) { get_bits = GET_BIT(nbr_flags, 16); /* only pel substitution for TL */ @@ -382,11 +379,11 @@ void ihevc_intra_pred_chroma_ref_substitution_a9q(UWORD8 *pu1_top_left, UWORD16 *pu2_dst; /* 4 pel substitution (other than TL) */ pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2]; - ihevc_memset_16bit_a9q((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample); + ihevc_memset_16bit_a9q((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4); } } - nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample; + nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT / 2)) ? 1 : 4; } } } diff --git a/common/arm64/ihevc_deblk_chroma_horz.s b/common/arm64/ihevc_deblk_chroma_horz.s index 863aca7..7097142 100644 --- a/common/arm64/ihevc_deblk_chroma_horz.s +++ b/common/arm64/ihevc_deblk_chroma_horz.s @@ -45,8 +45,9 @@ // WORD32 filter_flag_q) // -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -56,7 +57,7 @@ .type ihevc_deblk_chroma_horz_av8, %function -ENTRY ihevc_deblk_chroma_horz_av8 +ihevc_deblk_chroma_horz_av8: sxtw x4,w4 sxtw x5,w5 sxtw x6,w6 @@ -165,7 +166,6 @@ l1.3528: l1.3540: ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_deblk_chroma_vert.s b/common/arm64/ihevc_deblk_chroma_vert.s index 6df6f6b..dcb1f25 100644 --- a/common/arm64/ihevc_deblk_chroma_vert.s +++ b/common/arm64/ihevc_deblk_chroma_vert.s @@ -46,8 +46,9 @@ // WORD32 filter_flag_p, // WORD32 filter_flag_q) -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -57,7 +58,7 @@ .type ihevc_deblk_chroma_vert_av8, %function -ENTRY ihevc_deblk_chroma_vert_av8 +ihevc_deblk_chroma_vert_av8: sxtw x4,w4 sxtw x5,w5 sxtw x6,w6 @@ -204,7 +205,6 @@ l1.3204: l1.3228: ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_deblk_luma_horz.s b/common/arm64/ihevc_deblk_luma_horz.s index 0686055..db9e347 100644 --- a/common/arm64/ihevc_deblk_luma_horz.s +++ b/common/arm64/ihevc_deblk_luma_horz.s @@ -36,8 +36,8 @@ //* //*******************************************************************************/ -.include "ihevc_neon_macros.s" .text +.align 4 .extern gai4_ihevc_tc_table @@ -46,7 +46,7 @@ .type ihevc_deblk_luma_horz_av8, %function -ENTRY ihevc_deblk_luma_horz_av8 +ihevc_deblk_luma_horz_av8: // stmfd sp!, {x3-x12,x14} sxtw x5,w5 sxtw x6,w6 @@ -434,7 +434,6 @@ l1.2404: ldp d10,d11,[sp],#16 ldp d8,d9,[sp],#16 // Loading d9 using { ldr d9,[sp]; add sp,sp,#8 } is giving bus error. // d8 is used as dummy register and loaded along with d9 using ldp. d8 is not used in the function. - EXIT_FUNC ret // x4=flag p @@ -585,7 +584,6 @@ l1.2852: ldp d10,d11,[sp],#16 ldp d8,d9,[sp],#16 // Loading d9 using { ldr d9,[sp]; add sp,sp,#8 } is giving bus error. // d8 is used as dummy register and loaded along with d9 using ldp. d8 is not used in the function. - EXIT_FUNC ret diff --git a/common/arm64/ihevc_deblk_luma_vert.s b/common/arm64/ihevc_deblk_luma_vert.s index fbfdeb5..4379a69 100644 --- a/common/arm64/ihevc_deblk_luma_vert.s +++ b/common/arm64/ihevc_deblk_luma_vert.s @@ -37,8 +37,8 @@ //* //*******************************************************************************/ -.include "ihevc_neon_macros.s" .text +.align 4 @@ -49,7 +49,7 @@ .type ihevc_deblk_luma_vert_av8, %function -ENTRY ihevc_deblk_luma_vert_av8 +ihevc_deblk_luma_vert_av8: sxtw x5,w5 sxtw x6,w6 @@ -450,7 +450,6 @@ l1.964: ldp d12,d13,[sp],#16 ldp d10,d11,[sp],#16 ldp d8,d9,[sp],#16 - EXIT_FUNC ret l1.968: @@ -631,7 +630,6 @@ l1.1412: ldp d12,d13,[sp],#16 ldp d10,d11,[sp],#16 ldp d8,d9,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_copy.s b/common/arm64/ihevc_inter_pred_chroma_copy.s index 55ffcc8..7ac6855 100644 --- a/common/arm64/ihevc_inter_pred_chroma_copy.s +++ b/common/arm64/ihevc_inter_pred_chroma_copy.s @@ -91,14 +91,14 @@ //x5 => ht //x6 => wd -.include "ihevc_neon_macros.s" .text +.align 4 .globl ihevc_inter_pred_chroma_copy_av8 .type ihevc_inter_pred_chroma_copy_av8, %function -ENTRY ihevc_inter_pred_chroma_copy_av8 +ihevc_inter_pred_chroma_copy_av8: LSL x12,x6,#1 //wd << 1 CMP x5,#0 //checks ht == 0 @@ -142,8 +142,7 @@ END_INNER_LOOP_WD_4: BGT OUTER_LOOP_WD_4_HT_2 END_LOOPS: - EXIT_FUNC - ret + RET OUTER_LOOP_WD_4_HT_2: SUBS x4,x12,#0 //checks wd == 0 @@ -252,7 +251,6 @@ INNER_LOOP_WD_16_HT_2: LD1 {v1.16b},[x7],x2 //vld1_u8(pu1_src_tmp) ST1 {v1.16b},[x6],x3 //vst1_u8(pu1_dst_tmp, tmp_src) - EXIT_FUNC - ret + RET diff --git a/common/arm64/ihevc_inter_pred_chroma_copy_w16out.s b/common/arm64/ihevc_inter_pred_chroma_copy_w16out.s index 3884a31..180e5f5 100644 --- a/common/arm64/ihevc_inter_pred_chroma_copy_w16out.s +++ b/common/arm64/ihevc_inter_pred_chroma_copy_w16out.s @@ -92,14 +92,16 @@ //x5 => ht //x6 => wd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_inter_pred_chroma_copy_w16out_av8 .type ihevc_inter_pred_chroma_copy_w16out_av8, %function -ENTRY ihevc_inter_pred_chroma_copy_w16out_av8 +ihevc_inter_pred_chroma_copy_w16out_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -171,7 +173,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret @@ -338,7 +339,6 @@ core_loop_wd_8_ht_2: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_horz.s b/common/arm64/ihevc_inter_pred_chroma_horz.s index 2909262..425ac41 100644 --- a/common/arm64/ihevc_inter_pred_chroma_horz.s +++ b/common/arm64/ihevc_inter_pred_chroma_horz.s @@ -93,15 +93,16 @@ //x2 => src_strd //x3 => dst_strd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_chroma_horz_av8 .type ihevc_inter_pred_chroma_horz_av8, %function -ENTRY ihevc_inter_pred_chroma_horz_av8 +ihevc_inter_pred_chroma_horz_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -768,7 +769,6 @@ end_loops: ldp d13,d14,[sp],#16 ldp d11,d12,[sp],#16 ldp d9,d10,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_horz_w16out.s b/common/arm64/ihevc_inter_pred_chroma_horz_w16out.s index 2c4c5da..0f53c08 100644 --- a/common/arm64/ihevc_inter_pred_chroma_horz_w16out.s +++ b/common/arm64/ihevc_inter_pred_chroma_horz_w16out.s @@ -91,16 +91,17 @@ //x3 => dst_strd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_chroma_horz_w16out_av8 .type ihevc_inter_pred_chroma_horz_w16out_av8, %function -ENTRY ihevc_inter_pred_chroma_horz_w16out_av8 +ihevc_inter_pred_chroma_horz_w16out_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -793,7 +794,6 @@ end_loops: ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 ldp d10,d11,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_vert.s b/common/arm64/ihevc_inter_pred_chroma_vert.s index 32b5ba3..dd1fba4 100644 --- a/common/arm64/ihevc_inter_pred_chroma_vert.s +++ b/common/arm64/ihevc_inter_pred_chroma_vert.s @@ -92,15 +92,16 @@ //x1 => *pi2_dst //x2 => src_strd //x3 => dst_strd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_chroma_vert_av8 .type ihevc_inter_pred_chroma_vert_av8, %function -ENTRY ihevc_inter_pred_chroma_vert_av8 +ihevc_inter_pred_chroma_vert_av8: // stmfd sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -398,7 +399,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_vert_w16inp.s b/common/arm64/ihevc_inter_pred_chroma_vert_w16inp.s index 91750d0..e6cc617 100644 --- a/common/arm64/ihevc_inter_pred_chroma_vert_w16inp.s +++ b/common/arm64/ihevc_inter_pred_chroma_vert_w16inp.s @@ -92,14 +92,16 @@ //x2 => src_strd //x3 => dst_strd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_inter_pred_chroma_vert_w16inp_av8 .type ihevc_inter_pred_chroma_vert_w16inp_av8, %function -ENTRY ihevc_inter_pred_chroma_vert_w16inp_av8 +ihevc_inter_pred_chroma_vert_w16inp_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -347,7 +349,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_vert_w16inp_w16out.s b/common/arm64/ihevc_inter_pred_chroma_vert_w16inp_w16out.s index d15bbdb..022f166 100644 --- a/common/arm64/ihevc_inter_pred_chroma_vert_w16inp_w16out.s +++ b/common/arm64/ihevc_inter_pred_chroma_vert_w16inp_w16out.s @@ -92,15 +92,16 @@ //x1 => *pi2_dst //x2 => src_strd //x3 => dst_strd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_chroma_vert_w16inp_w16out_av8 .type ihevc_inter_pred_chroma_vert_w16inp_w16out_av8, %function -ENTRY ihevc_inter_pred_chroma_vert_w16inp_w16out_av8 +ihevc_inter_pred_chroma_vert_w16inp_w16out_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -335,7 +336,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_chroma_vert_w16out.s b/common/arm64/ihevc_inter_pred_chroma_vert_w16out.s index 0bfddf1..352214b 100644 --- a/common/arm64/ihevc_inter_pred_chroma_vert_w16out.s +++ b/common/arm64/ihevc_inter_pred_chroma_vert_w16out.s @@ -93,14 +93,16 @@ //x2 => src_strd //x3 => dst_strd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_inter_pred_chroma_vert_w16out_av8 .type ihevc_inter_pred_chroma_vert_w16out_av8, %function -ENTRY ihevc_inter_pred_chroma_vert_w16out_av8 +ihevc_inter_pred_chroma_vert_w16out_av8: // stmfd sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -384,7 +386,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_filters_luma_horz.s b/common/arm64/ihevc_inter_pred_filters_luma_horz.s index a8a3a84..d4830d6 100644 --- a/common/arm64/ihevc_inter_pred_filters_luma_horz.s +++ b/common/arm64/ihevc_inter_pred_filters_luma_horz.s @@ -103,15 +103,16 @@ // x5 => ht // x6 => wd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_horz_av8 .type ihevc_inter_pred_luma_horz_av8, %function -ENTRY ihevc_inter_pred_luma_horz_av8 +ihevc_inter_pred_luma_horz_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments push_v_regs @@ -285,7 +286,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret @@ -481,7 +481,6 @@ end_loops1: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret @@ -596,7 +595,6 @@ end_inner_loop_4: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_filters_luma_vert.s b/common/arm64/ihevc_inter_pred_filters_luma_vert.s index e8501ea..f8b8031 100644 --- a/common/arm64/ihevc_inter_pred_filters_luma_vert.s +++ b/common/arm64/ihevc_inter_pred_filters_luma_vert.s @@ -103,15 +103,16 @@ // x12 => *pi1_coeff // x5 => ht // x3 => wd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_vert_av8 .type ihevc_inter_pred_luma_vert_av8, %function -ENTRY ihevc_inter_pred_luma_vert_av8 +ihevc_inter_pred_luma_vert_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -427,7 +428,6 @@ end_loops: bne lbl409 ldp x19, x20,[sp], #16 - EXIT_FUNC ret lbl409: mov x5, #4 @@ -518,6 +518,5 @@ end_inner_loop_wd_4: // ldmfd sp!, {x4-x12, x15} //reload the registers from sp ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_filters_luma_vert_w16inp.s b/common/arm64/ihevc_inter_pred_filters_luma_vert_w16inp.s index 0d25915..1c3807e 100644 --- a/common/arm64/ihevc_inter_pred_filters_luma_vert_w16inp.s +++ b/common/arm64/ihevc_inter_pred_filters_luma_vert_w16inp.s @@ -94,15 +94,16 @@ // word32 ht, // word32 wd ) +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_vert_w16inp_av8 .type ihevc_inter_pred_luma_vert_w16inp_av8, %function -ENTRY ihevc_inter_pred_luma_vert_w16inp_av8 +ihevc_inter_pred_luma_vert_w16inp_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -383,7 +384,6 @@ end_loops: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_filters_luma_vert_w16out.s b/common/arm64/ihevc_inter_pred_filters_luma_vert_w16out.s index 56f394b..79a1a9d 100644 --- a/common/arm64/ihevc_inter_pred_filters_luma_vert_w16out.s +++ b/common/arm64/ihevc_inter_pred_filters_luma_vert_w16out.s @@ -62,13 +62,12 @@ .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_vert_w16out_av8 .type ihevc_inter_pred_luma_vert_w16out_av8, %function -ENTRY ihevc_inter_pred_luma_vert_w16out_av8 +ihevc_inter_pred_luma_vert_w16out_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -379,7 +378,6 @@ end_loops_16out: bne lbl355 ldp x19, x20,[sp], #16 - EXIT_FUNC ret lbl355: mov x5, #4 @@ -473,7 +471,6 @@ end_inner_loop_wd_4_16out: // ldmfd sp!, {x4-x12, x15} //reload the registers from sp ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_luma_copy.s b/common/arm64/ihevc_inter_pred_luma_copy.s index 43b0353..dccbb2b 100644 --- a/common/arm64/ihevc_inter_pred_luma_copy.s +++ b/common/arm64/ihevc_inter_pred_luma_copy.s @@ -71,14 +71,16 @@ // x11 => ht // x16 => wd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_inter_pred_luma_copy_av8 .type ihevc_inter_pred_luma_copy_av8, %function -ENTRY ihevc_inter_pred_luma_copy_av8 +ihevc_inter_pred_luma_copy_av8: // stmfd sp!, {x8-x16, lr} //stack stores the values of the arguments stp x19,x20,[sp, #-16]! mov x16,x6 //loads wd @@ -123,7 +125,6 @@ end_loops: // MRS x20,PMCCFILTR_EL0 sub x0,x20,x19 ldp x19,x20,[sp],#16 - EXIT_FUNC ret @@ -158,7 +159,6 @@ end_inner_loop_wd_8: // MRS x20,PMCCFILTR_EL0 sub x0,x20,x19 ldp x19,x20,[sp],#16 - EXIT_FUNC ret core_loop_wd_16: @@ -192,7 +192,6 @@ end_inner_loop_wd_16: // MRS x20,PMCCFILTR_EL0 sub x0,x20,x19 ldp x19,x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_luma_copy_w16out.s b/common/arm64/ihevc_inter_pred_luma_copy_w16out.s index 746af8f..b5498cf 100644 --- a/common/arm64/ihevc_inter_pred_luma_copy_w16out.s +++ b/common/arm64/ihevc_inter_pred_luma_copy_w16out.s @@ -72,15 +72,16 @@ // x7 => ht // x12 => wd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_copy_w16out_av8 .type ihevc_inter_pred_luma_copy_w16out_av8, %function -ENTRY ihevc_inter_pred_luma_copy_w16out_av8 +ihevc_inter_pred_luma_copy_w16out_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -139,7 +140,6 @@ end_loops: ldp x19, x20,[sp], #16 - EXIT_FUNC ret @@ -265,7 +265,6 @@ epilog_end: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_luma_horz_w16out.s b/common/arm64/ihevc_inter_pred_luma_horz_w16out.s index 23d1d52..b39059b 100644 --- a/common/arm64/ihevc_inter_pred_luma_horz_w16out.s +++ b/common/arm64/ihevc_inter_pred_luma_horz_w16out.s @@ -107,15 +107,16 @@ //x15 - #1 //x16 - src_ptx1 //x19 - loop_counter +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_inter_pred_luma_horz_w16out_av8 .type ihevc_inter_pred_luma_horz_w16out_av8, %function -ENTRY ihevc_inter_pred_luma_horz_w16out_av8 +ihevc_inter_pred_luma_horz_w16out_av8: // stmfd sp!, {x8-x16, x19} //stack stores the values of the arguments push_v_regs @@ -304,7 +305,6 @@ height_residue_4: bne lbl280 ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret lbl280: @@ -365,7 +365,6 @@ end_inner_loop_height_residue_4: // ldmfd sp!,{x8-x16,pc} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret outer_loop8_residual: @@ -477,7 +476,6 @@ end_inner_loop_8: // ldmfd sp!,{x8-x16,pc} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret @@ -668,7 +666,6 @@ end_loops1: // ldmfd sp!,{x8-x16,pc} //reload the registers from sp ldp x19, x20,[sp], #16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_inter_pred_luma_vert_w16inp_w16out.s b/common/arm64/ihevc_inter_pred_luma_vert_w16inp_w16out.s index 51e62a9..7147200 100644 --- a/common/arm64/ihevc_inter_pred_luma_vert_w16inp_w16out.s +++ b/common/arm64/ihevc_inter_pred_luma_vert_w16inp_w16out.s @@ -102,14 +102,16 @@ // r5 => ht // r6 => wd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_inter_pred_luma_vert_w16inp_w16out_av8 .type ihevc_inter_pred_luma_vert_w16inp_w16out_av8, %function -ENTRY ihevc_inter_pred_luma_vert_w16inp_w16out_av8 +ihevc_inter_pred_luma_vert_w16inp_w16out_av8: //stmfd sp!, {r4-r12, r14} //stack stores the values of the arguments @@ -406,7 +408,6 @@ end_loops: //ldmfd sp!,{r4-r12,r15} //reload the registers from sp ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_dc.s b/common/arm64/ihevc_intra_pred_chroma_dc.s index 2938586..a6969dd 100644 --- a/common/arm64/ihevc_intra_pred_chroma_dc.s +++ b/common/arm64/ihevc_intra_pred_chroma_dc.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_chroma_dc_av8, %function -ENTRY ihevc_intra_pred_chroma_dc_av8 +ihevc_intra_pred_chroma_dc_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments push_v_regs @@ -292,7 +293,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_horz.s b/common/arm64/ihevc_intra_pred_chroma_horz.s index 9bdc91d..d2f3102 100644 --- a/common/arm64/ihevc_intra_pred_chroma_horz.s +++ b/common/arm64/ihevc_intra_pred_chroma_horz.s @@ -84,15 +84,16 @@ //x2 => *pu1_dst //x3 => dst_strd -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_chroma_horz_av8 .type ihevc_intra_pred_chroma_horz_av8, %function -ENTRY ihevc_intra_pred_chroma_horz_av8 +ihevc_intra_pred_chroma_horz_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -188,7 +189,6 @@ core_loop_16: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b endloop @@ -270,7 +270,6 @@ core_loop_8: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b endloop @@ -319,7 +318,6 @@ core_loop_4: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b endloop @@ -355,7 +353,6 @@ core_loop_4: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret endloop: diff --git a/common/arm64/ihevc_intra_pred_chroma_mode2.s b/common/arm64/ihevc_intra_pred_chroma_mode2.s index 24481a7..aec3da4 100644 --- a/common/arm64/ihevc_intra_pred_chroma_mode2.s +++ b/common/arm64/ihevc_intra_pred_chroma_mode2.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_chroma_mode2_av8, %function -ENTRY ihevc_intra_pred_chroma_mode2_av8 +ihevc_intra_pred_chroma_mode2_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments push_v_regs @@ -302,7 +303,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_mode_18_34.s b/common/arm64/ihevc_intra_pred_chroma_mode_18_34.s index a25db51..aacb35e 100644 --- a/common/arm64/ihevc_intra_pred_chroma_mode_18_34.s +++ b/common/arm64/ihevc_intra_pred_chroma_mode_18_34.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_chroma_mode_18_34_av8, %function -ENTRY ihevc_intra_pred_chroma_mode_18_34_av8 +ihevc_intra_pred_chroma_mode_18_34_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -188,7 +189,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_mode_27_to_33.s b/common/arm64/ihevc_intra_pred_chroma_mode_27_to_33.s index f8c93aa..16d3bde 100644 --- a/common/arm64/ihevc_intra_pred_chroma_mode_27_to_33.s +++ b/common/arm64/ihevc_intra_pred_chroma_mode_27_to_33.s @@ -81,8 +81,9 @@ // word32 nt, // word32 mode) -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_chroma_mode_27_to_33_av8 @@ -91,7 +92,7 @@ .type ihevc_intra_pred_chroma_mode_27_to_33_av8, %function -ENTRY ihevc_intra_pred_chroma_mode_27_to_33_av8 +ihevc_intra_pred_chroma_mode_27_to_33_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -548,7 +549,6 @@ end_loops: ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 ldp d9,d10,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_mode_3_to_9.s b/common/arm64/ihevc_intra_pred_chroma_mode_3_to_9.s index 7142cf8..bf026a3 100644 --- a/common/arm64/ihevc_intra_pred_chroma_mode_3_to_9.s +++ b/common/arm64/ihevc_intra_pred_chroma_mode_3_to_9.s @@ -86,8 +86,10 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" @@ -99,7 +101,7 @@ .type ihevc_intra_pred_chroma_mode_3_to_9_av8, %function -ENTRY ihevc_intra_pred_chroma_mode_3_to_9_av8 +ihevc_intra_pred_chroma_mode_3_to_9_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -487,7 +489,6 @@ end_func: ldp d8,d15,[sp],#16 // Loading d15 using { ldr d15,[sp]; add sp,sp,#8 } is giving bus error. // d8 is used as dummy register and loaded along with d15 using ldp. d8 is not used in the function. ldp d13,d14,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_planar.s b/common/arm64/ihevc_intra_pred_chroma_planar.s index e459472..65c4c56 100644 --- a/common/arm64/ihevc_intra_pred_chroma_planar.s +++ b/common/arm64/ihevc_intra_pred_chroma_planar.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_chroma_planar_av8 @@ -102,7 +103,7 @@ .type ihevc_intra_pred_chroma_planar_av8, %function -ENTRY ihevc_intra_pred_chroma_planar_av8 +ihevc_intra_pred_chroma_planar_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -373,7 +374,6 @@ end_loop: // d8 is used as dummy register and loaded along with d14 using ldp. d8 is not used in the function. ldp d12,d13,[sp],#16 ldp d10,d11,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_chroma_ver.s b/common/arm64/ihevc_intra_pred_chroma_ver.s index 3fcd14d..451cae9 100644 --- a/common/arm64/ihevc_intra_pred_chroma_ver.s +++ b/common/arm64/ihevc_intra_pred_chroma_ver.s @@ -87,15 +87,16 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_chroma_ver_av8 .type ihevc_intra_pred_chroma_ver_av8, %function -ENTRY ihevc_intra_pred_chroma_ver_av8 +ihevc_intra_pred_chroma_ver_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments push_v_regs @@ -225,7 +226,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_filters_chroma_mode_11_to_17.s b/common/arm64/ihevc_intra_pred_filters_chroma_mode_11_to_17.s index f172145..bfb92bc 100644 --- a/common/arm64/ihevc_intra_pred_filters_chroma_mode_11_to_17.s +++ b/common/arm64/ihevc_intra_pred_filters_chroma_mode_11_to_17.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_chroma_mode_11_to_17_av8, %function -ENTRY ihevc_intra_pred_chroma_mode_11_to_17_av8 +ihevc_intra_pred_chroma_mode_11_to_17_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -616,7 +617,6 @@ end_func: ldp x19, x20,[sp],#16 ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_filters_chroma_mode_19_to_25.s b/common/arm64/ihevc_intra_pred_filters_chroma_mode_19_to_25.s index faf5d11..c7feebd 100644 --- a/common/arm64/ihevc_intra_pred_filters_chroma_mode_19_to_25.s +++ b/common/arm64/ihevc_intra_pred_filters_chroma_mode_19_to_25.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_chroma_mode_19_to_25_av8 @@ -99,7 +100,7 @@ .type ihevc_intra_pred_chroma_mode_19_to_25_av8, %function -ENTRY ihevc_intra_pred_chroma_mode_19_to_25_av8 +ihevc_intra_pred_chroma_mode_19_to_25_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -570,7 +571,6 @@ end_loops: ldp d8,d14,[sp],#16 // Loading d14 using { ldr d14,[sp]; add sp,sp,#8 } is giving bus error. // d8 is used as dummy register and loaded along with d14 using ldp. d8 is not used in the function. ldp d12,d13,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_filters_luma_mode_11_to_17.s b/common/arm64/ihevc_intra_pred_filters_luma_mode_11_to_17.s index a167115..c68ed70 100644 --- a/common/arm64/ihevc_intra_pred_filters_luma_mode_11_to_17.s +++ b/common/arm64/ihevc_intra_pred_filters_luma_mode_11_to_17.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_luma_mode_11_to_17_av8, %function -ENTRY ihevc_intra_pred_luma_mode_11_to_17_av8 +ihevc_intra_pred_luma_mode_11_to_17_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -690,7 +691,6 @@ end_func: ldp x19, x20,[sp],#16 ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_filters_luma_mode_19_to_25.s b/common/arm64/ihevc_intra_pred_filters_luma_mode_19_to_25.s index 6769904..322e4c7 100644 --- a/common/arm64/ihevc_intra_pred_filters_luma_mode_19_to_25.s +++ b/common/arm64/ihevc_intra_pred_filters_luma_mode_19_to_25.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -100,7 +101,7 @@ .type ihevc_intra_pred_luma_mode_19_to_25_av8, %function -ENTRY ihevc_intra_pred_luma_mode_19_to_25_av8 +ihevc_intra_pred_luma_mode_19_to_25_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -660,7 +661,6 @@ end_loops: ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 ldp d9,d10,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_dc.s b/common/arm64/ihevc_intra_pred_luma_dc.s index 061c6fd..fc86ffa 100644 --- a/common/arm64/ihevc_intra_pred_luma_dc.s +++ b/common/arm64/ihevc_intra_pred_luma_dc.s @@ -92,15 +92,16 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" .globl ihevc_intra_pred_luma_dc_av8 .type ihevc_intra_pred_luma_dc_av8, %function -ENTRY ihevc_intra_pred_luma_dc_av8 +ihevc_intra_pred_luma_dc_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -510,7 +511,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_horz.s b/common/arm64/ihevc_intra_pred_luma_horz.s index 87b66cf..3d1f27f 100644 --- a/common/arm64/ihevc_intra_pred_luma_horz.s +++ b/common/arm64/ihevc_intra_pred_luma_horz.s @@ -84,8 +84,9 @@ //x2 => *pu1_dst //x3 => dst_strd -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -93,7 +94,7 @@ .type ihevc_intra_pred_luma_horz_av8, %function -ENTRY ihevc_intra_pred_luma_horz_av8 +ihevc_intra_pred_luma_horz_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -188,7 +189,6 @@ core_loop_32: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b end_func @@ -269,7 +269,6 @@ core_loop_16: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b end_func @@ -316,7 +315,6 @@ core_loop_8: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret b end_func @@ -352,7 +350,6 @@ core_loop_4: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret end_func: diff --git a/common/arm64/ihevc_intra_pred_luma_mode2.s b/common/arm64/ihevc_intra_pred_luma_mode2.s index 6e8c256..6eec479 100644 --- a/common/arm64/ihevc_intra_pred_luma_mode2.s +++ b/common/arm64/ihevc_intra_pred_luma_mode2.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_luma_mode2_av8, %function -ENTRY ihevc_intra_pred_luma_mode2_av8 +ihevc_intra_pred_luma_mode2_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -269,7 +270,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_mode_18_34.s b/common/arm64/ihevc_intra_pred_luma_mode_18_34.s index d21d116..11e1792 100644 --- a/common/arm64/ihevc_intra_pred_luma_mode_18_34.s +++ b/common/arm64/ihevc_intra_pred_luma_mode_18_34.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -101,7 +102,7 @@ .type ihevc_intra_pred_luma_mode_18_34_av8, %function -ENTRY ihevc_intra_pred_luma_mode_18_34_av8 +ihevc_intra_pred_luma_mode_18_34_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments push_v_regs @@ -277,7 +278,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_mode_27_to_33.s b/common/arm64/ihevc_intra_pred_luma_mode_27_to_33.s index 1d1bc96..dcc9e43 100644 --- a/common/arm64/ihevc_intra_pred_luma_mode_27_to_33.s +++ b/common/arm64/ihevc_intra_pred_luma_mode_27_to_33.s @@ -85,8 +85,9 @@ //x2 => *pu1_dst //x3 => dst_strd -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -96,7 +97,7 @@ .type ihevc_intra_pred_luma_mode_27_to_33_av8, %function -ENTRY ihevc_intra_pred_luma_mode_27_to_33_av8 +ihevc_intra_pred_luma_mode_27_to_33_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -553,7 +554,6 @@ end_loops: ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 ldp d9,d10,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_mode_3_to_9.s b/common/arm64/ihevc_intra_pred_luma_mode_3_to_9.s index a079247..56d2f6b 100644 --- a/common/arm64/ihevc_intra_pred_luma_mode_3_to_9.s +++ b/common/arm64/ihevc_intra_pred_luma_mode_3_to_9.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -102,7 +103,7 @@ .type ihevc_intra_pred_luma_mode_3_to_9_av8, %function -ENTRY ihevc_intra_pred_luma_mode_3_to_9_av8 +ihevc_intra_pred_luma_mode_3_to_9_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -562,7 +563,6 @@ end_func: ldp x19, x20,[sp],#16 ldp d14,d15,[sp],#16 ldp d12,d13,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_planar.s b/common/arm64/ihevc_intra_pred_luma_planar.s index 5cbcfef..ec9d3ca 100644 --- a/common/arm64/ihevc_intra_pred_luma_planar.s +++ b/common/arm64/ihevc_intra_pred_luma_planar.s @@ -92,8 +92,9 @@ // mode // pi1_coeff -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -103,7 +104,7 @@ .type ihevc_intra_pred_luma_planar_av8, %function -ENTRY ihevc_intra_pred_luma_planar_av8 +ihevc_intra_pred_luma_planar_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -557,7 +558,6 @@ end_loop: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_intra_pred_luma_vert.s b/common/arm64/ihevc_intra_pred_luma_vert.s index 362b06b..a8b111e 100644 --- a/common/arm64/ihevc_intra_pred_luma_vert.s +++ b/common/arm64/ihevc_intra_pred_luma_vert.s @@ -88,8 +88,9 @@ // nt // mode -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -97,7 +98,7 @@ .type ihevc_intra_pred_luma_ver_av8, %function -ENTRY ihevc_intra_pred_luma_ver_av8 +ihevc_intra_pred_luma_ver_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -423,7 +424,6 @@ end_func: // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_itrans_recon_16x16.s b/common/arm64/ihevc_itrans_recon_16x16.s index b7469ea..fe76678 100644 --- a/common/arm64/ihevc_itrans_recon_16x16.s +++ b/common/arm64/ihevc_itrans_recon_16x16.s @@ -105,8 +105,10 @@ // x12 // x11 -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" @@ -121,7 +123,7 @@ .type ihevc_itrans_recon_16x16_av8, %function -ENTRY ihevc_itrans_recon_16x16_av8 +ihevc_itrans_recon_16x16_av8: ldr w11, [sp] // stmfd sp!,{x4-x12,x14} @@ -1224,7 +1226,6 @@ skip_last8rows_stage2_kernel2: // ldmfd sp!,{x4-x12,pc} ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_itrans_recon_32x32.s b/common/arm64/ihevc_itrans_recon_32x32.s index fd38cb7..8f98503 100644 --- a/common/arm64/ihevc_itrans_recon_32x32.s +++ b/common/arm64/ihevc_itrans_recon_32x32.s @@ -124,8 +124,9 @@ //d5[2]= 43 d7[2]=9 //d5[3]= 38 d7[3]=4 -.include "ihevc_neon_macros.s" .text +.align 4 +.include "ihevc_neon_macros.s" @@ -142,7 +143,7 @@ .type ihevc_itrans_recon_32x32_av8, %function -ENTRY ihevc_itrans_recon_32x32_av8 +ihevc_itrans_recon_32x32_av8: ldr w11, [sp] @@ -3041,7 +3042,6 @@ prediction_buffer: // ldmfd sp!,{x0-x12,pc} ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_itrans_recon_4x4.s b/common/arm64/ihevc_itrans_recon_4x4.s index b7909ed..61fa5d7 100644 --- a/common/arm64/ihevc_itrans_recon_4x4.s +++ b/common/arm64/ihevc_itrans_recon_4x4.s @@ -100,8 +100,10 @@ // x6 => dst_strd // x7 => zero_cols -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .set shift_stage1_idct , 7 .set shift_stage2_idct , 12 @@ -114,7 +116,7 @@ .type ihevc_itrans_recon_4x4_av8, %function -ENTRY ihevc_itrans_recon_4x4_av8 +ihevc_itrans_recon_4x4_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -227,7 +229,6 @@ ENTRY ihevc_itrans_recon_4x4_av8 // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_itrans_recon_4x4_ttype1.s b/common/arm64/ihevc_itrans_recon_4x4_ttype1.s index 2dbe5af..c30f358 100644 --- a/common/arm64/ihevc_itrans_recon_4x4_ttype1.s +++ b/common/arm64/ihevc_itrans_recon_4x4_ttype1.s @@ -103,8 +103,10 @@ // x6 => dst_strd // x7 => zero_cols -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .set shift_stage1_idct , 7 .set shift_stage2_idct , 12 @@ -113,7 +115,7 @@ .type ihevc_itrans_recon_4x4_ttype1_av8, %function -ENTRY ihevc_itrans_recon_4x4_ttype1_av8 +ihevc_itrans_recon_4x4_ttype1_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -232,7 +234,6 @@ ENTRY ihevc_itrans_recon_4x4_ttype1_av8 // ldmfd sp!,{x4-x12,x15} //reload the registers from sp ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_itrans_recon_8x8.s b/common/arm64/ihevc_itrans_recon_8x8.s index f0429cd..86ad136 100644 --- a/common/arm64/ihevc_itrans_recon_8x8.s +++ b/common/arm64/ihevc_itrans_recon_8x8.s @@ -105,8 +105,10 @@ // zero_cols -.include "ihevc_neon_macros.s" + .text +.align 4 +.include "ihevc_neon_macros.s" @@ -121,7 +123,7 @@ .type ihevc_itrans_recon_8x8_av8, %function -ENTRY ihevc_itrans_recon_8x8_av8 +ihevc_itrans_recon_8x8_av8: ////register usage.extern - loading and until idct of columns //// cosine constants - d0 //// sine constants - d1 @@ -1028,7 +1030,6 @@ pred_buff_addition: // ldmfd sp!,{x4-x12,pc} ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_mem_fns.s b/common/arm64/ihevc_mem_fns.s index 9138663..5b1026b 100644 --- a/common/arm64/ihevc_mem_fns.s +++ b/common/arm64/ihevc_mem_fns.s @@ -69,14 +69,14 @@ // x1 => *pu1_src // x2 => num_bytes -.include "ihevc_neon_macros.s" .text +.p2align 2 .global ihevc_memcpy_mul_8_av8 .type ihevc_memcpy_mul_8_av8, %function -ENTRY ihevc_memcpy_mul_8_av8 +ihevc_memcpy_mul_8_av8: LOOP_NEON_MEMCPY_MUL_8: // Memcpy 8 bytes @@ -85,7 +85,6 @@ LOOP_NEON_MEMCPY_MUL_8: SUBS x2,x2,#8 BNE LOOP_NEON_MEMCPY_MUL_8 - EXIT_FUNC ret @@ -105,7 +104,7 @@ LOOP_NEON_MEMCPY_MUL_8: .global ihevc_memcpy_av8 .type ihevc_memcpy_av8, %function -ENTRY ihevc_memcpy_av8 +ihevc_memcpy_av8: SUBS x2,x2,#8 BLT ARM_MEMCPY LOOP_NEON_MEMCPY: @@ -127,7 +126,6 @@ LOOP_ARM_MEMCPY: SUBS x2,x2,#1 BNE LOOP_ARM_MEMCPY MEMCPY_RETURN: - EXIT_FUNC ret @@ -142,13 +140,14 @@ MEMCPY_RETURN: // x2 => num_bytes .text +.p2align 2 .global ihevc_memset_mul_8_av8 .type ihevc_memset_mul_8_av8, %function -ENTRY ihevc_memset_mul_8_av8 +ihevc_memset_mul_8_av8: // Assumptions: numbytes is either 8, 16 or 32 dup v0.8b,w1 @@ -159,7 +158,6 @@ LOOP_MEMSET_MUL_8: SUBS x2,x2,#8 BNE LOOP_MEMSET_MUL_8 - EXIT_FUNC ret @@ -178,7 +176,7 @@ LOOP_MEMSET_MUL_8: .global ihevc_memset_av8 .type ihevc_memset_av8, %function -ENTRY ihevc_memset_av8 +ihevc_memset_av8: SUBS x2,x2,#8 BLT ARM_MEMSET dup v0.8b,w1 @@ -200,7 +198,6 @@ LOOP_ARM_MEMSET: BNE LOOP_ARM_MEMSET MEMSET_RETURN: - EXIT_FUNC ret @@ -215,13 +212,14 @@ MEMSET_RETURN: // x2 => num_words .text +.p2align 2 .global ihevc_memset_16bit_mul_8_av8 .type ihevc_memset_16bit_mul_8_av8, %function -ENTRY ihevc_memset_16bit_mul_8_av8 +ihevc_memset_16bit_mul_8_av8: // Assumptions: num_words is either 8, 16 or 32 @@ -233,7 +231,6 @@ LOOP_MEMSET_16BIT_MUL_8: SUBS x2,x2,#8 BNE LOOP_MEMSET_16BIT_MUL_8 - EXIT_FUNC ret @@ -252,7 +249,7 @@ LOOP_MEMSET_16BIT_MUL_8: .global ihevc_memset_16bit_av8 .type ihevc_memset_16bit_av8, %function -ENTRY ihevc_memset_16bit_av8 +ihevc_memset_16bit_av8: SUBS x2,x2,#8 BLT ARM_MEMSET_16BIT dup v0.8h,w1 @@ -274,7 +271,6 @@ LOOP_ARM_MEMSET_16BIT: BNE LOOP_ARM_MEMSET_16BIT MEMSET_16BIT_RETURN: - EXIT_FUNC ret diff --git a/common/arm64/ihevc_neon_macros.s b/common/arm64/ihevc_neon_macros.s index 5235686..c5e65e5 100644 --- a/common/arm64/ihevc_neon_macros.s +++ b/common/arm64/ihevc_neon_macros.s @@ -47,53 +47,3 @@ ldp d10,d11,[sp],#16 ldp d8,d9,[sp],#16 .endm - -// --- Internal Security Dispatchers --- -// These expand to real instructions only if the compiler flags are present. - -.macro BTI_ENABLE -#if defined(__ARM_FEATURE_BTI_DEFAULT) - bti c -#endif -.endm - -.macro PAC_ENTRY -#if defined(__ARM_FEATURE_PAC_DEFAULT) - paciasp -#endif -.endm - -.macro PAC_EXIT -#if defined(__ARM_FEATURE_PAC_DEFAULT) - autiasp -#endif -.endm - -// --- Main ENTRY and EXIT_FUNC Macros --- - -.macro ENTRY name - .p2align 2 -\name: - BTI_ENABLE - PAC_ENTRY -.endm - -.macro EXIT_FUNC - PAC_EXIT -.endm - -// --- GNU Property Note --- -// Signals BTI and PAC support to the Android linker. -#if defined(__linux__) && defined(__aarch64__) - .pushsection .note.gnu.property, "a" // Switch to Note section - .p2align 3 - .word 4 // Name size - .word 16 // Data size - .word 5 // NT_GNU_PROPERTY_TYPE_0 - .asciz "GNU" // Owner - .word 0xc0000000 // GNU_PROPERTY_AARCH64_FEATURE_1_AND - .word 4 // Data size - .word 3 // Value: BTI (Bit 0) | PAC (Bit 1) - .word 0 // Padding - .popsection // Switch back to previous section -#endif diff --git a/common/arm64/ihevc_padding.s b/common/arm64/ihevc_padding.s index e1bf9ab..5a33d0a 100644 --- a/common/arm64/ihevc_padding.s +++ b/common/arm64/ihevc_padding.s @@ -85,14 +85,14 @@ // x2 => ht // x3 => pad_size -.include "ihevc_neon_macros.s" .text +.align 4 .globl ihevc_pad_left_luma_av8 .type ihevc_pad_left_luma_av8, %function -ENTRY ihevc_pad_left_luma_av8 +ihevc_pad_left_luma_av8: loop_start_luma_left: // pad size is assumed to be pad_left = 80 @@ -148,7 +148,6 @@ loop_start_luma_left: bne loop_start_luma_left - EXIT_FUNC ret @@ -210,7 +209,7 @@ loop_start_luma_left: .type ihevc_pad_left_chroma_av8, %function -ENTRY ihevc_pad_left_chroma_av8 +ihevc_pad_left_chroma_av8: loop_start_chroma_left: @@ -267,7 +266,6 @@ loop_start_chroma_left: bne loop_start_chroma_left - EXIT_FUNC ret @@ -339,7 +337,7 @@ loop_start_chroma_left: .type ihevc_pad_right_luma_av8, %function -ENTRY ihevc_pad_right_luma_av8 +ihevc_pad_right_luma_av8: loop_start_luma_right: @@ -397,7 +395,6 @@ loop_start_luma_right: bne loop_start_luma_right - EXIT_FUNC ret @@ -458,7 +455,7 @@ loop_start_luma_right: .type ihevc_pad_right_chroma_av8, %function -ENTRY ihevc_pad_right_chroma_av8 +ihevc_pad_right_chroma_av8: loop_start_chroma_right: @@ -515,7 +512,6 @@ loop_start_chroma_right: bne loop_start_chroma_right - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_band_offset_chroma.s b/common/arm64/ihevc_sao_band_offset_chroma.s index b501c0a..41042ae 100644 --- a/common/arm64/ihevc_sao_band_offset_chroma.s +++ b/common/arm64/ihevc_sao_band_offset_chroma.s @@ -61,13 +61,14 @@ //x9 => wd 60 //x10=> ht 64 -.include "ihevc_neon_macros.s" .text +.p2align 2 +.include "ihevc_neon_macros.s" .globl gu1_table_band_idx .globl ihevc_sao_band_offset_chroma_av8 -ENTRY ihevc_sao_band_offset_chroma_av8 +ihevc_sao_band_offset_chroma_av8: mov x8,#0 mov x9,#0 mov x10,#0 @@ -423,7 +424,6 @@ END_LOOP: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_band_offset_luma.s b/common/arm64/ihevc_sao_band_offset_luma.s index a10525a..d283a90 100644 --- a/common/arm64/ihevc_sao_band_offset_luma.s +++ b/common/arm64/ihevc_sao_band_offset_luma.s @@ -65,11 +65,12 @@ .include "ihevc_neon_macros.s" .text +.p2align 2 .globl gu1_table_band_idx .globl ihevc_sao_band_offset_luma_av8 -ENTRY ihevc_sao_band_offset_luma_av8 +ihevc_sao_band_offset_luma_av8: // STMFD sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -243,7 +244,6 @@ HEIGHT_LOOP: ldp d8,d15,[sp],#16 // Loading d15 using { ldr d15,[sp]; add sp,sp,#8 } is giving bus error. // d8 is used as dummy register and loaded along with d15 using ldp. d8 is not used in the function. ldp d13,d14,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class0.s b/common/arm64/ihevc_sao_edge_offset_class0.s index 2874fbd..7c61aa2 100644 --- a/common/arm64/ihevc_sao_edge_offset_class0.s +++ b/common/arm64/ihevc_sao_edge_offset_class0.s @@ -59,14 +59,15 @@ //x9 => wd //x10=> ht +.text +.p2align 2 .include "ihevc_neon_macros.s" -.text .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class0_av8 -ENTRY ihevc_sao_edge_offset_class0_av8 +ihevc_sao_edge_offset_class0_av8: // STMFD sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -337,7 +338,6 @@ END_LOOPS: // LDMFD sp!,{x4-x12,x15} //Reload the registers from SP ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class0_chroma.s b/common/arm64/ihevc_sao_edge_offset_class0_chroma.s index 1b28d39..2a1eb7e 100644 --- a/common/arm64/ihevc_sao_edge_offset_class0_chroma.s +++ b/common/arm64/ihevc_sao_edge_offset_class0_chroma.s @@ -60,13 +60,14 @@ //x9 => wd //x10=> ht -.include "ihevc_neon_macros.s" .text +.p2align 2 +.include "ihevc_neon_macros.s" .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class0_chroma_av8 -ENTRY ihevc_sao_edge_offset_class0_chroma_av8 +ihevc_sao_edge_offset_class0_chroma_av8: ldr x8,[sp,#0] ldr x9,[sp,#8] @@ -476,7 +477,6 @@ END_LOOPS: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class1.s b/common/arm64/ihevc_sao_edge_offset_class1.s index 348d700..515b349 100644 --- a/common/arm64/ihevc_sao_edge_offset_class1.s +++ b/common/arm64/ihevc_sao_edge_offset_class1.s @@ -58,14 +58,15 @@ //x7 => wd //x8 => ht +.text +.p2align 2 .include "ihevc_neon_macros.s" -.text .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class1_av8 -ENTRY ihevc_sao_edge_offset_class1_av8 +ihevc_sao_edge_offset_class1_av8: // STMFD sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -354,7 +355,6 @@ END_LOOPS: // LDMFD sp!,{x4-x12,x15} //Reload the registers from SP ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class1_chroma.s b/common/arm64/ihevc_sao_edge_offset_class1_chroma.s index 8bb30c8..894e702 100644 --- a/common/arm64/ihevc_sao_edge_offset_class1_chroma.s +++ b/common/arm64/ihevc_sao_edge_offset_class1_chroma.s @@ -60,13 +60,14 @@ //x8 => wd //x9 => ht -.include "ihevc_neon_macros.s" .text +.p2align 2 +.include "ihevc_neon_macros.s" .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class1_chroma_av8 -ENTRY ihevc_sao_edge_offset_class1_chroma_av8 +ihevc_sao_edge_offset_class1_chroma_av8: ldr x8,[sp,#0] @@ -457,7 +458,6 @@ END_LOOPS: ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class2.s b/common/arm64/ihevc_sao_edge_offset_class2.s index bc580e6..5494619 100644 --- a/common/arm64/ihevc_sao_edge_offset_class2.s +++ b/common/arm64/ihevc_sao_edge_offset_class2.s @@ -58,14 +58,15 @@ //x7 => wd //x8=> ht +.text +.p2align 2 .include "ihevc_neon_macros.s" -.text .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class2_av8 -ENTRY ihevc_sao_edge_offset_class2_av8 +ihevc_sao_edge_offset_class2_av8: // STMFD sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -845,7 +846,6 @@ END_LOOPS: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class2_chroma.s b/common/arm64/ihevc_sao_edge_offset_class2_chroma.s index c1d1694..dd4be6f 100644 --- a/common/arm64/ihevc_sao_edge_offset_class2_chroma.s +++ b/common/arm64/ihevc_sao_edge_offset_class2_chroma.s @@ -60,13 +60,14 @@ //x7 => wd //x8=> ht -.include "ihevc_neon_macros.s" .text +.p2align 2 +.include "ihevc_neon_macros.s" .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class2_chroma_av8 -ENTRY ihevc_sao_edge_offset_class2_chroma_av8 +ihevc_sao_edge_offset_class2_chroma_av8: // STMFD sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -1131,7 +1132,6 @@ END_LOOPS: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class3.s b/common/arm64/ihevc_sao_edge_offset_class3.s index 98007ec..924861b 100644 --- a/common/arm64/ihevc_sao_edge_offset_class3.s +++ b/common/arm64/ihevc_sao_edge_offset_class3.s @@ -58,14 +58,15 @@ //x7 => wd //x8=> ht +.text +.p2align 2 .include "ihevc_neon_macros.s" -.text .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class3_av8 -ENTRY ihevc_sao_edge_offset_class3_av8 +ihevc_sao_edge_offset_class3_av8: // STMFD sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -888,7 +889,6 @@ END_LOOPS: ldp x23, x24,[sp], #16 ldp x21, x22,[sp], #16 ldp x19, x20,[sp], #16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_sao_edge_offset_class3_chroma.s b/common/arm64/ihevc_sao_edge_offset_class3_chroma.s index 58d251f..bfdf50c 100644 --- a/common/arm64/ihevc_sao_edge_offset_class3_chroma.s +++ b/common/arm64/ihevc_sao_edge_offset_class3_chroma.s @@ -60,12 +60,13 @@ //x7 => wd //x8=> ht -.include "ihevc_neon_macros.s" .text +.p2align 2 +.include "ihevc_neon_macros.s" .globl gi1_table_edge_idx .globl ihevc_sao_edge_offset_class3_chroma_av8 -ENTRY ihevc_sao_edge_offset_class3_chroma_av8 +ihevc_sao_edge_offset_class3_chroma_av8: // STMFD sp!,{x4-x12,x14} //stack stores the values of the arguments @@ -1166,7 +1167,6 @@ END_LOOPS: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_weighted_pred_bi.s b/common/arm64/ihevc_weighted_pred_bi.s index 5da0df6..299b042 100644 --- a/common/arm64/ihevc_weighted_pred_bi.s +++ b/common/arm64/ihevc_weighted_pred_bi.s @@ -134,14 +134,16 @@ // x14 => ht // x7 => wd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_weighted_pred_bi_av8 .type ihevc_weighted_pred_bi_av8, %function -ENTRY ihevc_weighted_pred_bi_av8 +ihevc_weighted_pred_bi_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -305,7 +307,6 @@ end_loops: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_weighted_pred_bi_default.s b/common/arm64/ihevc_weighted_pred_bi_default.s index 0c1e112..d98e025 100644 --- a/common/arm64/ihevc_weighted_pred_bi_default.s +++ b/common/arm64/ihevc_weighted_pred_bi_default.s @@ -107,15 +107,16 @@ // x7 => lvl_shift2 // x8 => ht // x9 => wd +.text +.align 4 .include "ihevc_neon_macros.s" -.text .globl ihevc_weighted_pred_bi_default_av8 .type ihevc_weighted_pred_bi_default_av8, %function -ENTRY ihevc_weighted_pred_bi_default_av8 +ihevc_weighted_pred_bi_default_av8: ldr w8,[sp,#0] ldr w9,[sp,#8] @@ -533,7 +534,6 @@ end_loops: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/arm64/ihevc_weighted_pred_uni.s b/common/arm64/ihevc_weighted_pred_uni.s index 362a243..c6dee6f 100644 --- a/common/arm64/ihevc_weighted_pred_uni.s +++ b/common/arm64/ihevc_weighted_pred_uni.s @@ -112,14 +112,16 @@ // x8 => ht // x9 => wd -.include "ihevc_neon_macros.s" .text +.align 4 + +.include "ihevc_neon_macros.s" .globl ihevc_weighted_pred_uni_av8 .type ihevc_weighted_pred_uni_av8, %function -ENTRY ihevc_weighted_pred_uni_av8 +ihevc_weighted_pred_uni_av8: // stmfd sp!, {x4-x12, x14} //stack stores the values of the arguments @@ -238,7 +240,6 @@ end_loops: ldp x21, x22,[sp],#16 ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/common/common.cmake b/common/common.cmake index 5a926cc..839bd78 100644 --- a/common/common.cmake +++ b/common/common.cmake @@ -18,7 +18,6 @@ list( "${HEVC_ROOT}/common/ihevc_trans_tables.c" "${HEVC_ROOT}/common/ihevc_recon.c" "${HEVC_ROOT}/common/ihevc_itrans.c" - "${HEVC_ROOT}/common/ihevc_itrans_res.c" "${HEVC_ROOT}/common/ihevc_itrans_recon.c" "${HEVC_ROOT}/common/ihevc_iquant_recon.c" "${HEVC_ROOT}/common/ihevc_iquant_itrans_recon.c" @@ -30,7 +29,6 @@ list( "${HEVC_ROOT}/common/ihevc_chroma_iquant_itrans_recon.c" "${HEVC_ROOT}/common/ihevc_chroma_recon.c" "${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_16x16.c" - "${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_32x32.c" "${HEVC_ROOT}/common/ihevc_chroma_itrans_recon_8x8.c" "${HEVC_ROOT}/common/ihevc_buf_mgr.c" "${HEVC_ROOT}/common/ihevc_disp_mgr.c" @@ -64,7 +62,7 @@ list( include_directories(${HEVC_ROOT}/common) # arm/x86 sources -if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" STREQUAL "arm64") +if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") list( APPEND LIBHEVC_COMMON_ASMS @@ -137,7 +135,7 @@ if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" STREQUAL "a "${HEVC_ROOT}/common/arm64/ihevc_weighted_pred_uni.s") include_directories(${HEVC_ROOT}/common/arm64 ${HEVC_ROOT}/common/arm) -elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch32") +elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch32") list( APPEND LIBHEVC_COMMON_ASMS diff --git a/common/ihevc_cabac_tables.c b/common/ihevc_cabac_tables.c index bb28d75..fb10f3e 100644 --- a/common/ihevc_cabac_tables.c +++ b/common/ihevc_cabac_tables.c @@ -253,12 +253,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 33, 17, 49, 49, 110, 14, 49, 17, 49, 49, 110, 14, 49, 17, 49, 49, 110, 14, 49, 33, 17, 62, 62, 30, 30, 30, 30, 14, 30, 17, - 81, 30, 17, 81, 49, 81, 33, 33, 14, 1, - 33, 30, 1, 17, 14, 1, 78, 33, 17, 17, - 1, 30, 33, 110, 62, 62, 33, 110, 1, 78, - 1, 14, 30, 46, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 81, 81, 81, 81, - + 81, 30, 17, 81, 33, 33, 14, 1, 33, 30, + 1, 17, 14, 1, 78, 33, 17, 17, 1, 30, + 33, 110, 62, 62, 33, 110, 1, 78, 1, 14, + 30, 46, 30, 30, }, { @@ -276,12 +274,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 31, 15, 47, 47, 110, 14, 47, 15, 47, 47, 110, 14, 47, 15, 47, 47, 110, 14, 47, 31, 15, 62, 62, 30, 32, 30, 32, 14, 32, 15, - 79, 32, 15, 79, 47, 79, 31, 29, 16, 0, - 31, 30, 0, 15, 14, 2, 78, 29, 15, 15, - 0, 30, 31, 110, 62, 62, 31, 108, 0, 78, - 0, 14, 32, 46, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 83, 83, 83, 83, - + 79, 32, 15, 79, 31, 29, 16, 0, 31, 30, + 0, 15, 14, 2, 78, 29, 15, 15, 0, 30, + 31, 110, 62, 62, 31, 108, 0, 78, 0, 14, + 32, 46, 30, 30, }, { @@ -299,12 +295,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 29, 13, 45, 47, 108, 14, 45, 13, 45, 47, 108, 14, 45, 13, 45, 47, 108, 14, 45, 31, 15, 60, 60, 30, 32, 30, 32, 14, 32, 15, - 77, 32, 15, 77, 47, 77, 31, 27, 16, 0, - 31, 30, 0, 15, 14, 6, 78, 27, 15, 13, - 2, 30, 31, 108, 62, 60, 31, 104, 2, 76, - 0, 14, 32, 46, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 87, 87, 87, 87, - + 77, 32, 15, 77, 31, 27, 16, 0, 31, 30, + 0, 15, 14, 6, 78, 27, 15, 13, 2, 30, + 31, 108, 62, 60, 31, 104, 2, 76, 0, 14, + 32, 46, 30, 30, }, { @@ -322,12 +316,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 29, 11, 45, 47, 108, 14, 45, 11, 45, 47, 108, 14, 45, 11, 45, 47, 108, 14, 45, 31, 15, 60, 60, 30, 32, 30, 32, 14, 32, 15, - 75, 32, 15, 75, 47, 75, 31, 25, 16, 0, - 31, 30, 0, 15, 14, 8, 78, 25, 15, 11, - 2, 30, 31, 108, 62, 60, 31, 102, 2, 74, - 0, 14, 32, 46, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 91, 91, 91, 91, - + 75, 32, 15, 75, 31, 25, 16, 0, 31, 30, + 0, 15, 14, 8, 78, 25, 15, 11, 2, 30, + 31, 108, 62, 60, 31, 102, 2, 74, 0, 14, + 32, 46, 30, 30, }, { @@ -345,12 +337,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 27, 9, 43, 45, 106, 14, 43, 9, 43, 45, 106, 14, 43, 9, 43, 45, 106, 14, 43, 29, 13, 58, 58, 30, 34, 30, 34, 14, 34, 13, - 73, 34, 13, 73, 45, 73, 29, 23, 18, 2, - 29, 30, 2, 13, 14, 12, 78, 23, 13, 9, - 4, 30, 29, 106, 60, 58, 29, 98, 4, 72, - 2, 14, 34, 44, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 95, 95, 95, 95, - + 73, 34, 13, 73, 29, 23, 18, 2, 29, 30, + 2, 13, 14, 12, 78, 23, 13, 9, 4, 30, + 29, 106, 60, 58, 29, 98, 4, 72, 2, 14, + 34, 44, 30, 30, }, { @@ -368,12 +358,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 25, 7, 41, 45, 104, 14, 41, 7, 41, 45, 104, 14, 41, 7, 41, 45, 104, 14, 41, 29, 13, 56, 56, 30, 34, 30, 34, 14, 34, 13, - 71, 34, 13, 71, 45, 71, 29, 19, 18, 2, - 29, 30, 2, 13, 14, 14, 78, 19, 13, 7, - 6, 30, 29, 104, 60, 56, 29, 96, 6, 70, - 2, 14, 34, 44, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 99, 99, 99, 99, - + 71, 34, 13, 71, 29, 19, 18, 2, 29, 30, + 2, 13, 14, 14, 78, 19, 13, 7, 6, 30, + 29, 104, 60, 56, 29, 96, 6, 70, 2, 14, + 34, 44, 30, 30, }, { @@ -391,12 +379,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 25, 5, 41, 45, 104, 14, 41, 5, 41, 45, 104, 14, 41, 5, 41, 45, 104, 14, 41, 29, 13, 56, 56, 30, 34, 30, 34, 14, 34, 13, - 69, 34, 13, 69, 45, 69, 29, 17, 18, 2, - 29, 30, 2, 13, 14, 18, 78, 17, 13, 5, - 6, 30, 29, 104, 60, 56, 29, 92, 6, 68, - 2, 14, 34, 44, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 103, 103, 103, 103, - + 69, 34, 13, 69, 29, 17, 18, 2, 29, 30, + 2, 13, 14, 18, 78, 17, 13, 5, 6, 30, + 29, 104, 60, 56, 29, 92, 6, 68, 2, 14, + 34, 44, 30, 30, }, { @@ -414,12 +400,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 23, 3, 39, 43, 102, 14, 39, 3, 39, 43, 102, 14, 39, 3, 39, 43, 102, 14, 39, 27, 11, 54, 54, 30, 36, 30, 36, 14, 36, 11, - 67, 36, 11, 67, 43, 67, 27, 15, 20, 4, - 27, 30, 4, 11, 14, 20, 78, 15, 11, 3, - 8, 30, 27, 102, 58, 54, 27, 90, 8, 66, - 4, 14, 36, 42, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 107, 107, 107, 107, - + 67, 36, 11, 67, 27, 15, 20, 4, 27, 30, + 4, 11, 14, 20, 78, 15, 11, 3, 8, 30, + 27, 102, 58, 54, 27, 90, 8, 66, 4, 14, + 36, 42, 30, 30, }, { @@ -437,12 +421,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 23, 1, 39, 43, 100, 14, 39, 1, 39, 43, 100, 14, 39, 1, 39, 43, 100, 14, 39, 27, 11, 52, 52, 30, 36, 30, 36, 14, 36, 11, - 65, 36, 11, 65, 43, 65, 27, 13, 20, 4, - 27, 30, 4, 11, 14, 24, 78, 13, 11, 1, - 8, 30, 27, 100, 58, 52, 27, 86, 8, 64, - 4, 14, 36, 42, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 111, 111, 111, 111, - + 65, 36, 11, 65, 27, 13, 20, 4, 27, 30, + 4, 11, 14, 24, 78, 13, 11, 1, 8, 30, + 27, 100, 58, 52, 27, 86, 8, 64, 4, 14, + 36, 42, 30, 30, }, { @@ -460,12 +442,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 21, 0, 37, 43, 100, 14, 37, 0, 37, 43, 100, 14, 37, 0, 37, 43, 100, 14, 37, 27, 11, 52, 52, 30, 36, 30, 36, 14, 36, 11, - 63, 36, 11, 63, 43, 63, 27, 9, 20, 4, - 27, 30, 4, 11, 14, 28, 78, 9, 11, 0, - 10, 30, 27, 100, 58, 52, 27, 82, 10, 62, - 4, 14, 36, 42, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 113, 113, 113, 113, - + 63, 36, 11, 63, 27, 9, 20, 4, 27, 30, + 4, 11, 14, 28, 78, 9, 11, 0, 10, 30, + 27, 100, 58, 52, 27, 82, 10, 62, 4, 14, + 36, 42, 30, 30, }, { @@ -483,12 +463,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 19, 2, 35, 41, 98, 14, 35, 2, 35, 41, 98, 14, 35, 2, 35, 41, 98, 14, 35, 25, 9, 50, 50, 30, 38, 30, 38, 14, 38, 9, - 61, 38, 9, 61, 41, 61, 25, 7, 22, 6, - 25, 30, 6, 9, 14, 30, 78, 7, 9, 2, - 12, 30, 25, 98, 56, 50, 25, 80, 12, 60, - 6, 14, 38, 40, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 117, 117, 117, 117, - + 61, 38, 9, 61, 25, 7, 22, 6, 25, 30, + 6, 9, 14, 30, 78, 7, 9, 2, 12, 30, + 25, 98, 56, 50, 25, 80, 12, 60, 6, 14, + 38, 40, 30, 30, }, { @@ -506,12 +484,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 19, 4, 35, 41, 98, 14, 35, 4, 35, 41, 98, 14, 35, 4, 35, 41, 98, 14, 35, 25, 9, 50, 50, 30, 38, 30, 38, 14, 38, 9, - 59, 38, 9, 59, 41, 59, 25, 5, 22, 6, - 25, 30, 6, 9, 14, 34, 78, 5, 9, 4, - 12, 30, 25, 98, 56, 50, 25, 76, 12, 58, - 6, 14, 38, 40, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 121, 121, 121, 121, - + 59, 38, 9, 59, 25, 5, 22, 6, 25, 30, + 6, 9, 14, 34, 78, 5, 9, 4, 12, 30, + 25, 98, 56, 50, 25, 76, 12, 58, 6, 14, + 38, 40, 30, 30, }, { @@ -529,12 +505,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 17, 6, 33, 41, 96, 14, 33, 6, 33, 41, 96, 14, 33, 6, 33, 41, 96, 14, 33, 25, 9, 48, 48, 30, 38, 30, 38, 14, 38, 9, - 57, 38, 9, 57, 41, 57, 25, 3, 22, 6, - 25, 30, 6, 9, 14, 36, 78, 3, 9, 6, - 14, 30, 25, 96, 56, 48, 25, 74, 14, 56, - 6, 14, 38, 40, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 57, 38, 9, 57, 25, 3, 22, 6, 25, 30, + 6, 9, 14, 36, 78, 3, 9, 6, 14, 30, + 25, 96, 56, 48, 25, 74, 14, 56, 6, 14, + 38, 40, 30, 30, }, { @@ -552,12 +526,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 15, 8, 31, 39, 94, 14, 31, 8, 31, 39, 94, 14, 31, 8, 31, 39, 94, 14, 31, 23, 7, 46, 46, 30, 40, 30, 40, 14, 40, 7, - 55, 40, 7, 55, 39, 55, 23, 0, 24, 8, - 23, 30, 8, 7, 14, 40, 78, 0, 7, 8, - 16, 30, 23, 94, 54, 46, 23, 70, 16, 54, - 8, 14, 40, 38, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 55, 40, 7, 55, 23, 0, 24, 8, 23, 30, + 8, 7, 14, 40, 78, 0, 7, 8, 16, 30, + 23, 94, 54, 46, 23, 70, 16, 54, 8, 14, + 40, 38, 30, 30, }, { @@ -575,12 +547,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 15, 10, 31, 39, 94, 14, 31, 10, 31, 39, 94, 14, 31, 10, 31, 39, 94, 14, 31, 23, 7, 46, 46, 30, 40, 30, 40, 14, 40, 7, - 53, 40, 7, 53, 39, 53, 23, 2, 24, 8, - 23, 30, 8, 7, 14, 42, 78, 2, 7, 10, - 16, 30, 23, 94, 54, 46, 23, 68, 16, 52, - 8, 14, 40, 38, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 53, 40, 7, 53, 23, 2, 24, 8, 23, 30, + 8, 7, 14, 42, 78, 2, 7, 10, 16, 30, + 23, 94, 54, 46, 23, 68, 16, 52, 8, 14, + 40, 38, 30, 30, }, { @@ -598,12 +568,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 13, 12, 29, 39, 92, 14, 29, 12, 29, 39, 92, 14, 29, 12, 29, 39, 92, 14, 29, 23, 7, 44, 44, 30, 40, 30, 40, 14, 40, 7, - 51, 40, 7, 51, 39, 51, 23, 4, 24, 8, - 23, 30, 8, 7, 14, 46, 78, 4, 7, 12, - 18, 30, 23, 92, 54, 44, 23, 64, 18, 50, - 8, 14, 40, 38, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 51, 40, 7, 51, 23, 4, 24, 8, 23, 30, + 8, 7, 14, 46, 78, 4, 7, 12, 18, 30, + 23, 92, 54, 44, 23, 64, 18, 50, 8, 14, + 40, 38, 30, 30, }, { @@ -621,12 +589,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 13, 12, 29, 39, 90, 14, 29, 12, 29, 39, 90, 14, 29, 12, 29, 39, 90, 14, 29, 23, 7, 42, 42, 30, 40, 30, 40, 14, 40, 7, - 51, 40, 7, 51, 39, 51, 23, 6, 24, 8, - 23, 30, 8, 7, 14, 48, 78, 6, 7, 12, - 18, 30, 23, 90, 52, 42, 23, 60, 18, 48, - 8, 14, 40, 36, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 51, 40, 7, 51, 23, 6, 24, 8, 23, 30, + 8, 7, 14, 48, 78, 6, 7, 12, 18, 30, + 23, 90, 52, 42, 23, 60, 18, 48, 8, 14, + 40, 36, 30, 30, }, { @@ -644,12 +610,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 11, 14, 27, 37, 90, 14, 27, 14, 27, 37, 90, 14, 27, 14, 27, 37, 90, 14, 27, 21, 5, 42, 42, 30, 42, 30, 42, 14, 42, 5, - 49, 42, 5, 49, 37, 49, 21, 10, 26, 10, - 21, 30, 10, 5, 14, 52, 78, 10, 5, 14, - 20, 30, 21, 90, 52, 42, 21, 58, 20, 48, - 10, 14, 42, 36, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 49, 42, 5, 49, 21, 10, 26, 10, 21, 30, + 10, 5, 14, 52, 78, 10, 5, 14, 20, 30, + 21, 90, 52, 42, 21, 58, 20, 48, 10, 14, + 42, 36, 30, 30, }, { @@ -667,12 +631,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 9, 16, 25, 37, 88, 14, 25, 16, 25, 37, 88, 14, 25, 16, 25, 37, 88, 14, 25, 21, 5, 40, 40, 30, 42, 30, 42, 14, 42, 5, - 47, 42, 5, 47, 37, 47, 21, 12, 26, 10, - 21, 30, 10, 5, 14, 56, 78, 12, 5, 16, - 22, 30, 21, 88, 52, 40, 21, 54, 22, 46, - 10, 14, 42, 36, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 47, 42, 5, 47, 21, 12, 26, 10, 21, 30, + 10, 5, 14, 56, 78, 12, 5, 16, 22, 30, + 21, 88, 52, 40, 21, 54, 22, 46, 10, 14, + 42, 36, 30, 30, }, { @@ -690,12 +652,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 9, 18, 25, 37, 88, 14, 25, 18, 25, 37, 88, 14, 25, 18, 25, 37, 88, 14, 25, 21, 5, 40, 40, 30, 42, 30, 42, 14, 42, 5, - 45, 42, 5, 45, 37, 45, 21, 14, 26, 10, - 21, 30, 10, 5, 14, 58, 78, 14, 5, 18, - 22, 30, 21, 88, 52, 40, 21, 52, 22, 44, - 10, 14, 42, 36, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 45, 42, 5, 45, 21, 14, 26, 10, 21, 30, + 10, 5, 14, 58, 78, 14, 5, 18, 22, 30, + 21, 88, 52, 40, 21, 52, 22, 44, 10, 14, + 42, 36, 30, 30, }, { @@ -713,12 +673,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 7, 20, 23, 35, 86, 14, 23, 20, 23, 35, 86, 14, 23, 20, 23, 35, 86, 14, 23, 19, 3, 38, 38, 30, 44, 30, 44, 14, 44, 3, - 43, 44, 3, 43, 35, 43, 19, 16, 28, 12, - 19, 30, 12, 3, 14, 62, 78, 16, 3, 20, - 24, 30, 19, 86, 50, 38, 19, 48, 24, 42, - 12, 14, 44, 34, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 43, 44, 3, 43, 19, 16, 28, 12, 19, 30, + 12, 3, 14, 62, 78, 16, 3, 20, 24, 30, + 19, 86, 50, 38, 19, 48, 24, 42, 12, 14, + 44, 34, 30, 30, }, { @@ -736,12 +694,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 5, 22, 21, 35, 84, 14, 21, 22, 21, 35, 84, 14, 21, 22, 21, 35, 84, 14, 21, 19, 3, 36, 36, 30, 44, 30, 44, 14, 44, 3, - 41, 44, 3, 41, 35, 41, 19, 20, 28, 12, - 19, 30, 12, 3, 14, 64, 78, 20, 3, 22, - 26, 30, 19, 84, 50, 36, 19, 46, 26, 40, - 12, 14, 44, 34, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 41, 44, 3, 41, 19, 20, 28, 12, 19, 30, + 12, 3, 14, 64, 78, 20, 3, 22, 26, 30, + 19, 84, 50, 36, 19, 46, 26, 40, 12, 14, + 44, 34, 30, 30, }, { @@ -759,12 +715,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 5, 24, 21, 35, 84, 14, 21, 24, 21, 35, 84, 14, 21, 24, 21, 35, 84, 14, 21, 19, 3, 36, 36, 30, 44, 30, 44, 14, 44, 3, - 39, 44, 3, 39, 35, 39, 19, 22, 28, 12, - 19, 30, 12, 3, 14, 68, 78, 22, 3, 24, - 26, 30, 19, 84, 50, 36, 19, 42, 26, 38, - 12, 14, 44, 34, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 39, 44, 3, 39, 19, 22, 28, 12, 19, 30, + 12, 3, 14, 68, 78, 22, 3, 24, 26, 30, + 19, 84, 50, 36, 19, 42, 26, 38, 12, 14, + 44, 34, 30, 30, }, { @@ -782,12 +736,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 3, 26, 19, 33, 82, 14, 19, 26, 19, 33, 82, 14, 19, 26, 19, 33, 82, 14, 19, 17, 1, 34, 34, 30, 46, 30, 46, 14, 46, 1, - 37, 46, 1, 37, 33, 37, 17, 24, 30, 14, - 17, 30, 14, 1, 14, 70, 78, 24, 1, 26, - 28, 30, 17, 82, 48, 34, 17, 40, 28, 36, - 14, 14, 46, 32, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 37, 46, 1, 37, 17, 24, 30, 14, 17, 30, + 14, 1, 14, 70, 78, 24, 1, 26, 28, 30, + 17, 82, 48, 34, 17, 40, 28, 36, 14, 14, + 46, 32, 30, 30, }, { @@ -805,12 +757,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 3, 28, 19, 33, 80, 14, 19, 28, 19, 33, 80, 14, 19, 28, 19, 33, 80, 14, 19, 17, 1, 32, 32, 30, 46, 30, 46, 14, 46, 1, - 35, 46, 1, 35, 33, 35, 17, 26, 30, 14, - 17, 30, 14, 1, 14, 74, 78, 26, 1, 28, - 28, 30, 17, 80, 48, 32, 17, 36, 28, 34, - 14, 14, 46, 32, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 35, 46, 1, 35, 17, 26, 30, 14, 17, 30, + 14, 1, 14, 74, 78, 26, 1, 28, 28, 30, + 17, 80, 48, 32, 17, 36, 28, 34, 14, 14, + 46, 32, 30, 30, }, { @@ -828,12 +778,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 1, 30, 17, 33, 80, 14, 17, 30, 17, 33, 80, 14, 17, 30, 17, 33, 80, 14, 17, 17, 1, 32, 32, 30, 46, 30, 46, 14, 46, 1, - 33, 46, 1, 33, 33, 33, 17, 30, 30, 14, - 17, 30, 14, 1, 14, 78, 78, 30, 1, 30, - 30, 30, 17, 80, 48, 32, 17, 32, 30, 32, - 14, 14, 46, 32, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 33, 46, 1, 33, 17, 30, 30, 14, 17, 30, + 14, 1, 14, 78, 78, 30, 1, 30, 30, 30, + 17, 80, 48, 32, 17, 32, 30, 32, 14, 14, + 46, 32, 30, 30, }, { @@ -851,12 +799,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 0, 32, 15, 31, 78, 14, 15, 32, 15, 31, 78, 14, 15, 32, 15, 31, 78, 14, 15, 15, 0, 30, 30, 30, 48, 30, 48, 14, 48, 0, - 31, 48, 0, 31, 31, 31, 15, 32, 32, 16, - 15, 30, 16, 0, 14, 80, 78, 32, 0, 32, - 32, 30, 15, 78, 46, 30, 15, 30, 32, 30, - 16, 14, 48, 30, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 31, 48, 0, 31, 15, 32, 32, 16, 15, 30, + 16, 0, 14, 80, 78, 32, 0, 32, 32, 30, + 15, 78, 46, 30, 15, 30, 32, 30, 16, 14, + 48, 30, 30, 30, }, { @@ -874,12 +820,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 0, 34, 15, 31, 78, 14, 15, 34, 15, 31, 78, 14, 15, 34, 15, 31, 78, 14, 15, 15, 0, 30, 30, 30, 48, 30, 48, 14, 48, 0, - 29, 48, 0, 29, 31, 29, 15, 34, 32, 16, - 15, 30, 16, 0, 14, 84, 78, 34, 0, 34, - 32, 30, 15, 78, 46, 30, 15, 26, 32, 28, - 16, 14, 48, 30, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 29, 48, 0, 29, 15, 34, 32, 16, 15, 30, + 16, 0, 14, 84, 78, 34, 0, 34, 32, 30, + 15, 78, 46, 30, 15, 26, 32, 28, 16, 14, + 48, 30, 30, 30, }, { @@ -897,12 +841,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 2, 36, 13, 31, 76, 14, 13, 36, 13, 31, 76, 14, 13, 36, 13, 31, 76, 14, 13, 15, 0, 28, 28, 30, 48, 30, 48, 14, 48, 0, - 27, 48, 0, 27, 31, 27, 15, 36, 32, 16, - 15, 30, 16, 0, 14, 86, 78, 36, 0, 36, - 34, 30, 15, 76, 46, 28, 15, 24, 34, 26, - 16, 14, 48, 30, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 27, 48, 0, 27, 15, 36, 32, 16, 15, 30, + 16, 0, 14, 86, 78, 36, 0, 36, 34, 30, + 15, 76, 46, 28, 15, 24, 34, 26, 16, 14, + 48, 30, 30, 30, }, { @@ -920,12 +862,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 4, 38, 11, 29, 74, 14, 11, 38, 11, 29, 74, 14, 11, 38, 11, 29, 74, 14, 11, 13, 2, 26, 26, 30, 50, 30, 50, 14, 50, 2, - 25, 50, 2, 25, 29, 25, 13, 40, 34, 18, - 13, 30, 18, 2, 14, 90, 78, 40, 2, 38, - 36, 30, 13, 74, 44, 26, 13, 20, 36, 24, - 18, 14, 50, 28, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 25, 50, 2, 25, 13, 40, 34, 18, 13, 30, + 18, 2, 14, 90, 78, 40, 2, 38, 36, 30, + 13, 74, 44, 26, 13, 20, 36, 24, 18, 14, + 50, 28, 30, 30, }, { @@ -943,12 +883,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 4, 40, 11, 29, 74, 14, 11, 40, 11, 29, 74, 14, 11, 40, 11, 29, 74, 14, 11, 13, 2, 26, 26, 30, 50, 30, 50, 14, 50, 2, - 23, 50, 2, 23, 29, 23, 13, 42, 34, 18, - 13, 30, 18, 2, 14, 92, 78, 42, 2, 40, - 36, 30, 13, 74, 44, 26, 13, 18, 36, 22, - 18, 14, 50, 28, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 23, 50, 2, 23, 13, 42, 34, 18, 13, 30, + 18, 2, 14, 92, 78, 42, 2, 40, 36, 30, + 13, 74, 44, 26, 13, 18, 36, 22, 18, 14, + 50, 28, 30, 30, }, { @@ -966,12 +904,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 6, 42, 9, 29, 72, 14, 9, 42, 9, 29, 72, 14, 9, 42, 9, 29, 72, 14, 9, 13, 2, 24, 24, 30, 50, 30, 50, 14, 50, 2, - 21, 50, 2, 21, 29, 21, 13, 44, 34, 18, - 13, 30, 18, 2, 14, 96, 78, 44, 2, 42, - 38, 30, 13, 72, 44, 24, 13, 14, 38, 20, - 18, 14, 50, 28, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 21, 50, 2, 21, 13, 44, 34, 18, 13, 30, + 18, 2, 14, 96, 78, 44, 2, 42, 38, 30, + 13, 72, 44, 24, 13, 14, 38, 20, 18, 14, + 50, 28, 30, 30, }, { @@ -989,12 +925,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 6, 42, 9, 29, 70, 14, 9, 42, 9, 29, 70, 14, 9, 42, 9, 29, 70, 14, 9, 13, 2, 22, 22, 30, 50, 30, 50, 14, 50, 2, - 21, 50, 2, 21, 29, 21, 13, 46, 34, 18, - 13, 30, 18, 2, 14, 98, 78, 46, 2, 42, - 38, 30, 13, 70, 42, 22, 13, 10, 38, 18, - 18, 14, 50, 26, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 21, 50, 2, 21, 13, 46, 34, 18, 13, 30, + 18, 2, 14, 98, 78, 46, 2, 42, 38, 30, + 13, 70, 42, 22, 13, 10, 38, 18, 18, 14, + 50, 26, 30, 30, }, { @@ -1012,12 +946,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 8, 44, 7, 27, 70, 14, 7, 44, 7, 27, 70, 14, 7, 44, 7, 27, 70, 14, 7, 11, 4, 22, 22, 30, 52, 30, 52, 14, 52, 4, - 19, 52, 4, 19, 27, 19, 11, 50, 36, 20, - 11, 30, 20, 4, 14, 102, 78, 50, 4, 44, - 40, 30, 11, 70, 42, 22, 11, 8, 40, 18, - 20, 14, 52, 26, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 19, 52, 4, 19, 11, 50, 36, 20, 11, 30, + 20, 4, 14, 102, 78, 50, 4, 44, 40, 30, + 11, 70, 42, 22, 11, 8, 40, 18, 20, 14, + 52, 26, 30, 30, }, { @@ -1035,12 +967,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 10, 46, 5, 27, 68, 14, 5, 46, 5, 27, 68, 14, 5, 46, 5, 27, 68, 14, 5, 11, 4, 20, 20, 30, 52, 30, 52, 14, 52, 4, - 17, 52, 4, 17, 27, 17, 11, 52, 36, 20, - 11, 30, 20, 4, 14, 106, 78, 52, 4, 46, - 42, 30, 11, 68, 42, 20, 11, 4, 42, 16, - 20, 14, 52, 26, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 17, 52, 4, 17, 11, 52, 36, 20, 11, 30, + 20, 4, 14, 106, 78, 52, 4, 46, 42, 30, + 11, 68, 42, 20, 11, 4, 42, 16, 20, 14, + 52, 26, 30, 30, }, { @@ -1058,12 +988,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 10, 48, 5, 27, 68, 14, 5, 48, 5, 27, 68, 14, 5, 48, 5, 27, 68, 14, 5, 11, 4, 20, 20, 30, 52, 30, 52, 14, 52, 4, - 15, 52, 4, 15, 27, 15, 11, 54, 36, 20, - 11, 30, 20, 4, 14, 108, 78, 54, 4, 48, - 42, 30, 11, 68, 42, 20, 11, 2, 42, 14, - 20, 14, 52, 26, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 15, 52, 4, 15, 11, 54, 36, 20, 11, 30, + 20, 4, 14, 108, 78, 54, 4, 48, 42, 30, + 11, 68, 42, 20, 11, 2, 42, 14, 20, 14, + 52, 26, 30, 30, }, { @@ -1081,12 +1009,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 12, 50, 3, 25, 66, 14, 3, 50, 3, 25, 66, 14, 3, 50, 3, 25, 66, 14, 3, 9, 6, 18, 18, 30, 54, 30, 54, 14, 54, 6, - 13, 54, 6, 13, 25, 13, 9, 56, 38, 22, - 9, 30, 22, 6, 14, 112, 78, 56, 6, 50, - 44, 30, 9, 66, 40, 18, 9, 1, 44, 12, - 22, 14, 54, 24, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 13, 54, 6, 13, 9, 56, 38, 22, 9, 30, + 22, 6, 14, 112, 78, 56, 6, 50, 44, 30, + 9, 66, 40, 18, 9, 1, 44, 12, 22, 14, + 54, 24, 30, 30, }, { @@ -1104,12 +1030,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 52, 1, 25, 64, 14, 1, 52, 1, 25, 64, 14, 1, 52, 1, 25, 64, 14, 1, 9, 6, 16, 16, 30, 54, 30, 54, 14, 54, 6, - 11, 54, 6, 11, 25, 11, 9, 60, 38, 22, - 9, 30, 22, 6, 14, 114, 78, 60, 6, 52, - 46, 30, 9, 64, 40, 16, 9, 3, 46, 10, - 22, 14, 54, 24, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 11, 54, 6, 11, 9, 60, 38, 22, 9, 30, + 22, 6, 14, 114, 78, 60, 6, 52, 46, 30, + 9, 64, 40, 16, 9, 3, 46, 10, 22, 14, + 54, 24, 30, 30, }, { @@ -1127,12 +1051,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 54, 1, 25, 64, 14, 1, 54, 1, 25, 64, 14, 1, 54, 1, 25, 64, 14, 1, 9, 6, 16, 16, 30, 54, 30, 54, 14, 54, 6, - 9, 54, 6, 9, 25, 9, 9, 62, 38, 22, - 9, 30, 22, 6, 14, 118, 78, 62, 6, 54, - 46, 30, 9, 64, 40, 16, 9, 7, 46, 8, - 22, 14, 54, 24, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 9, 54, 6, 9, 9, 62, 38, 22, 9, 30, + 22, 6, 14, 118, 78, 62, 6, 54, 46, 30, + 9, 64, 40, 16, 9, 7, 46, 8, 22, 14, + 54, 24, 30, 30, }, { @@ -1150,12 +1072,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 16, 56, 0, 23, 62, 14, 0, 56, 0, 23, 62, 14, 0, 56, 0, 23, 62, 14, 0, 7, 8, 14, 14, 30, 56, 30, 56, 14, 56, 8, - 7, 56, 8, 7, 23, 7, 7, 64, 40, 24, - 7, 30, 24, 8, 14, 120, 78, 64, 8, 56, - 48, 30, 7, 62, 38, 14, 7, 9, 48, 6, - 24, 14, 56, 22, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 7, 56, 8, 7, 7, 64, 40, 24, 7, 30, + 24, 8, 14, 120, 78, 64, 8, 56, 48, 30, + 7, 62, 38, 14, 7, 9, 48, 6, 24, 14, + 56, 22, 30, 30, }, { @@ -1173,12 +1093,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 16, 58, 0, 23, 60, 14, 0, 58, 0, 23, 60, 14, 0, 58, 0, 23, 60, 14, 0, 7, 8, 12, 12, 30, 56, 30, 56, 14, 56, 8, - 5, 56, 8, 5, 23, 5, 7, 66, 40, 24, - 7, 30, 24, 8, 14, 124, 78, 66, 8, 58, - 48, 30, 7, 60, 38, 12, 7, 13, 48, 4, - 24, 14, 56, 22, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 5, 56, 8, 5, 7, 66, 40, 24, 7, 30, + 24, 8, 14, 124, 78, 66, 8, 58, 48, 30, + 7, 60, 38, 12, 7, 13, 48, 4, 24, 14, + 56, 22, 30, 30, }, { @@ -1196,12 +1114,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 18, 60, 2, 23, 60, 14, 2, 60, 2, 23, 60, 14, 2, 60, 2, 23, 60, 14, 2, 7, 8, 12, 12, 30, 56, 30, 56, 14, 56, 8, - 3, 56, 8, 3, 23, 3, 7, 70, 40, 24, - 7, 30, 24, 8, 14, 124, 78, 70, 8, 60, - 50, 30, 7, 60, 38, 12, 7, 17, 50, 2, - 24, 14, 56, 22, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 3, 56, 8, 3, 7, 70, 40, 24, 7, 30, + 24, 8, 14, 124, 78, 70, 8, 60, 50, 30, + 7, 60, 38, 12, 7, 17, 50, 2, 24, 14, + 56, 22, 30, 30, }, { @@ -1219,12 +1135,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 20, 62, 4, 21, 58, 14, 4, 62, 4, 21, 58, 14, 4, 62, 4, 21, 58, 14, 4, 5, 10, 10, 10, 30, 58, 30, 58, 14, 58, 10, - 1, 58, 10, 1, 21, 1, 5, 72, 42, 26, - 5, 30, 26, 10, 14, 124, 78, 72, 10, 62, - 52, 30, 5, 58, 36, 10, 5, 19, 52, 0, - 26, 14, 58, 20, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 1, 58, 10, 1, 5, 72, 42, 26, 5, 30, + 26, 10, 14, 124, 78, 72, 10, 62, 52, 30, + 5, 58, 36, 10, 5, 19, 52, 0, 26, 14, + 58, 20, 30, 30, }, { @@ -1242,12 +1156,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 20, 64, 4, 21, 58, 14, 4, 64, 4, 21, 58, 14, 4, 64, 4, 21, 58, 14, 4, 5, 10, 10, 10, 30, 58, 30, 58, 14, 58, 10, - 0, 58, 10, 0, 21, 0, 5, 74, 42, 26, - 5, 30, 26, 10, 14, 124, 78, 74, 10, 64, - 52, 30, 5, 58, 36, 10, 5, 23, 52, 1, - 26, 14, 58, 20, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 0, 58, 10, 0, 5, 74, 42, 26, 5, 30, + 26, 10, 14, 124, 78, 74, 10, 64, 52, 30, + 5, 58, 36, 10, 5, 23, 52, 1, 26, 14, + 58, 20, 30, 30, }, { @@ -1265,12 +1177,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 22, 66, 6, 21, 56, 14, 6, 66, 6, 21, 56, 14, 6, 66, 6, 21, 56, 14, 6, 5, 10, 8, 8, 30, 58, 30, 58, 14, 58, 10, - 2, 58, 10, 2, 21, 2, 5, 76, 42, 26, - 5, 30, 26, 10, 14, 124, 78, 76, 10, 66, - 54, 30, 5, 56, 36, 8, 5, 25, 54, 3, - 26, 14, 58, 20, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 2, 58, 10, 2, 5, 76, 42, 26, 5, 30, + 26, 10, 14, 124, 78, 76, 10, 66, 54, 30, + 5, 56, 36, 8, 5, 25, 54, 3, 26, 14, + 58, 20, 30, 30, }, { @@ -1288,12 +1198,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 24, 68, 8, 19, 54, 14, 8, 68, 8, 19, 54, 14, 8, 68, 8, 19, 54, 14, 8, 3, 12, 6, 6, 30, 60, 30, 60, 14, 60, 12, - 4, 60, 12, 4, 19, 4, 3, 80, 44, 28, - 3, 30, 28, 12, 14, 124, 78, 80, 12, 68, - 56, 30, 3, 54, 34, 6, 3, 29, 56, 5, - 28, 14, 60, 18, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 4, 60, 12, 4, 3, 80, 44, 28, 3, 30, + 28, 12, 14, 124, 78, 80, 12, 68, 56, 30, + 3, 54, 34, 6, 3, 29, 56, 5, 28, 14, + 60, 18, 30, 30, }, { @@ -1311,12 +1219,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 24, 70, 8, 19, 54, 14, 8, 70, 8, 19, 54, 14, 8, 70, 8, 19, 54, 14, 8, 3, 12, 6, 6, 30, 60, 30, 60, 14, 60, 12, - 6, 60, 12, 6, 19, 6, 3, 82, 44, 28, - 3, 30, 28, 12, 14, 124, 78, 82, 12, 70, - 56, 30, 3, 54, 34, 6, 3, 31, 56, 7, - 28, 14, 60, 18, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 6, 60, 12, 6, 3, 82, 44, 28, 3, 30, + 28, 12, 14, 124, 78, 82, 12, 70, 56, 30, + 3, 54, 34, 6, 3, 31, 56, 7, 28, 14, + 60, 18, 30, 30, }, { @@ -1334,12 +1240,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 26, 72, 10, 19, 52, 14, 10, 72, 10, 19, 52, 14, 10, 72, 10, 19, 52, 14, 10, 3, 12, 4, 4, 30, 60, 30, 60, 14, 60, 12, - 8, 60, 12, 8, 19, 8, 3, 84, 44, 28, - 3, 30, 28, 12, 14, 124, 78, 84, 12, 72, - 58, 30, 3, 52, 34, 4, 3, 35, 58, 9, - 28, 14, 60, 18, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 8, 60, 12, 8, 3, 84, 44, 28, 3, 30, + 28, 12, 14, 124, 78, 84, 12, 72, 58, 30, + 3, 52, 34, 4, 3, 35, 58, 9, 28, 14, + 60, 18, 30, 30, }, { @@ -1357,12 +1261,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 26, 72, 10, 19, 50, 14, 10, 72, 10, 19, 50, 14, 10, 72, 10, 19, 50, 14, 10, 3, 12, 2, 2, 30, 60, 30, 60, 14, 60, 12, - 8, 60, 12, 8, 19, 8, 3, 86, 44, 28, - 3, 30, 28, 12, 14, 124, 78, 86, 12, 72, - 58, 30, 3, 50, 32, 2, 3, 39, 58, 11, - 28, 14, 60, 16, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 8, 60, 12, 8, 3, 86, 44, 28, 3, 30, + 28, 12, 14, 124, 78, 86, 12, 72, 58, 30, + 3, 50, 32, 2, 3, 39, 58, 11, 28, 14, + 60, 16, 30, 30, }, { @@ -1380,12 +1282,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 28, 74, 12, 17, 50, 14, 12, 74, 12, 17, 50, 14, 12, 74, 12, 17, 50, 14, 12, 1, 14, 2, 2, 30, 62, 30, 62, 14, 62, 14, - 10, 62, 14, 10, 17, 10, 1, 90, 46, 30, - 1, 30, 30, 14, 14, 124, 78, 90, 14, 74, - 60, 30, 1, 50, 32, 2, 1, 41, 60, 11, - 30, 14, 62, 16, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 10, 62, 14, 10, 1, 90, 46, 30, 1, 30, + 30, 14, 14, 124, 78, 90, 14, 74, 60, 30, + 1, 50, 32, 2, 1, 41, 60, 11, 30, 14, + 62, 16, 30, 30, }, { @@ -1403,12 +1303,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 30, 76, 14, 17, 48, 14, 14, 76, 14, 17, 48, 14, 14, 76, 14, 17, 48, 14, 14, 1, 14, 0, 0, 30, 62, 30, 62, 14, 62, 14, - 12, 62, 14, 12, 17, 12, 1, 92, 46, 30, - 1, 30, 30, 14, 14, 124, 78, 92, 14, 76, - 62, 30, 1, 48, 32, 0, 1, 45, 62, 13, - 30, 14, 62, 16, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 12, 62, 14, 12, 1, 92, 46, 30, 1, 30, + 30, 14, 14, 124, 78, 92, 14, 76, 62, 30, + 1, 48, 32, 0, 1, 45, 62, 13, 30, 14, + 62, 16, 30, 30, }, { @@ -1426,12 +1324,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 30, 78, 14, 17, 48, 14, 14, 78, 14, 17, 48, 14, 14, 78, 14, 17, 48, 14, 14, 1, 14, 0, 0, 30, 62, 30, 62, 14, 62, 14, - 14, 62, 14, 14, 17, 14, 1, 94, 46, 30, - 1, 30, 30, 14, 14, 124, 78, 94, 14, 78, - 62, 30, 1, 48, 32, 0, 1, 47, 62, 15, - 30, 14, 62, 16, 30, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 125, 125, 125, 125, - + 14, 62, 14, 14, 1, 94, 46, 30, 1, 30, + 30, 14, 14, 124, 78, 94, 14, 78, 62, 30, + 1, 48, 32, 0, 1, 47, 62, 15, 30, 14, + 62, 16, 30, 30, }, }, @@ -1452,12 +1348,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 62, 46, 33, 30, 14, 1, 62, 46, 33, 30, 14, 1, 62, 46, 33, 30, 14, 1, 1, 14, 17, 17, 17, 14, 17, 14, 46, 46, 46, - 33, 46, 46, 33, 33, 33, 1, 94, 94, 46, - 1, 30, 46, 62, 62, 62, 78, 30, 14, 14, - 30, 14, 14, 124, 62, 46, 1, 46, 14, 62, - 17, 46, 17, 1, 17, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 17, 17, 17, 17, - + 33, 46, 46, 33, 1, 94, 94, 46, 1, 30, + 46, 62, 62, 62, 78, 30, 14, 14, 30, 14, + 14, 124, 62, 46, 1, 46, 14, 62, 17, 46, + 17, 1, 17, 46, }, { @@ -1475,12 +1369,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 62, 46, 31, 32, 14, 1, 62, 46, 31, 32, 14, 1, 62, 46, 31, 32, 14, 1, 1, 14, 15, 15, 15, 16, 15, 16, 46, 46, 46, - 31, 46, 46, 31, 31, 31, 1, 94, 94, 46, - 1, 30, 46, 62, 62, 64, 78, 32, 14, 16, - 32, 16, 14, 124, 62, 46, 1, 46, 16, 62, - 15, 46, 13, 0, 15, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 46, 31, 1, 94, 94, 46, 1, 30, + 46, 62, 62, 64, 78, 32, 14, 16, 32, 16, + 14, 124, 62, 46, 1, 46, 16, 62, 15, 46, + 13, 0, 15, 46, }, { @@ -1498,12 +1390,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 1, 14, 13, 13, 13, 18, 13, 18, 46, 46, 44, - 31, 46, 44, 31, 31, 31, 1, 92, 92, 46, - 1, 30, 46, 60, 60, 64, 78, 32, 14, 18, - 32, 16, 14, 124, 62, 46, 1, 46, 16, 60, - 13, 46, 11, 2, 13, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 44, 31, 1, 92, 92, 46, 1, 30, + 46, 60, 60, 64, 78, 32, 14, 18, 32, 16, + 14, 124, 62, 46, 1, 46, 16, 60, 13, 46, + 11, 2, 13, 46, }, { @@ -1521,12 +1411,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 1, 14, 13, 13, 11, 18, 11, 18, 46, 46, 44, - 31, 46, 44, 31, 31, 31, 1, 90, 90, 46, - 1, 30, 46, 60, 60, 64, 78, 32, 14, 18, - 32, 16, 14, 122, 62, 46, 1, 46, 16, 60, - 11, 46, 9, 2, 11, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 44, 31, 1, 90, 90, 46, 1, 30, + 46, 60, 60, 64, 78, 32, 14, 18, 32, 16, + 14, 122, 62, 46, 1, 46, 16, 60, 11, 46, + 9, 2, 11, 46, }, { @@ -1544,12 +1432,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 60, 42, 29, 34, 14, 1, 60, 42, 29, 34, 14, 1, 60, 42, 29, 34, 14, 1, 3, 14, 11, 11, 9, 20, 9, 20, 44, 46, 42, - 29, 46, 42, 29, 29, 29, 1, 88, 88, 44, - 1, 30, 44, 58, 58, 66, 78, 34, 14, 20, - 34, 18, 12, 120, 60, 44, 1, 44, 18, 58, - 9, 44, 7, 4, 9, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 42, 29, 1, 88, 88, 44, 1, 30, + 44, 58, 58, 66, 78, 34, 14, 20, 34, 18, + 12, 120, 60, 44, 1, 44, 18, 58, 9, 44, + 7, 4, 9, 44, }, { @@ -1567,12 +1453,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 3, 14, 9, 9, 7, 22, 7, 22, 44, 46, 40, - 29, 46, 40, 29, 29, 29, 1, 86, 86, 44, - 1, 30, 44, 56, 56, 66, 78, 34, 14, 22, - 34, 18, 12, 118, 60, 44, 1, 44, 18, 56, - 7, 44, 3, 6, 7, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 40, 29, 1, 86, 86, 44, 1, 30, + 44, 56, 56, 66, 78, 34, 14, 22, 34, 18, + 12, 118, 60, 44, 1, 44, 18, 56, 7, 44, + 3, 6, 7, 44, }, { @@ -1590,12 +1474,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 3, 14, 9, 9, 5, 22, 5, 22, 44, 46, 40, - 29, 46, 40, 29, 29, 29, 1, 84, 84, 44, - 1, 30, 44, 56, 56, 66, 78, 34, 14, 22, - 34, 18, 12, 116, 60, 44, 1, 44, 18, 56, - 5, 44, 1, 6, 5, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 40, 29, 1, 84, 84, 44, 1, 30, + 44, 56, 56, 66, 78, 34, 14, 22, 34, 18, + 12, 116, 60, 44, 1, 44, 18, 56, 5, 44, + 1, 6, 5, 44, }, { @@ -1613,12 +1495,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 58, 38, 27, 36, 14, 1, 58, 38, 27, 36, 14, 1, 58, 38, 27, 36, 14, 1, 5, 14, 7, 7, 3, 24, 3, 24, 42, 46, 38, - 27, 46, 38, 27, 27, 27, 1, 82, 82, 42, - 1, 30, 42, 54, 54, 68, 78, 36, 14, 24, - 36, 20, 10, 114, 58, 42, 1, 42, 20, 54, - 3, 42, 0, 8, 3, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 38, 27, 1, 82, 82, 42, 1, 30, + 42, 54, 54, 68, 78, 36, 14, 24, 36, 20, + 10, 114, 58, 42, 1, 42, 20, 54, 3, 42, + 0, 8, 3, 42, }, { @@ -1636,12 +1516,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 5, 14, 7, 7, 1, 24, 1, 24, 42, 46, 36, - 27, 46, 36, 27, 27, 27, 1, 80, 80, 42, - 1, 30, 42, 52, 52, 68, 78, 36, 14, 24, - 36, 20, 10, 112, 58, 42, 1, 42, 20, 52, - 1, 42, 2, 8, 1, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 36, 27, 1, 80, 80, 42, 1, 30, + 42, 52, 52, 68, 78, 36, 14, 24, 36, 20, + 10, 112, 58, 42, 1, 42, 20, 52, 1, 42, + 2, 8, 1, 42, }, { @@ -1659,12 +1537,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 5, 14, 5, 5, 0, 26, 0, 26, 42, 46, 36, - 27, 46, 36, 27, 27, 27, 1, 78, 78, 42, - 1, 30, 42, 52, 52, 68, 78, 36, 14, 26, - 36, 20, 10, 110, 58, 42, 1, 42, 20, 52, - 0, 42, 6, 10, 0, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 36, 27, 1, 78, 78, 42, 1, 30, + 42, 52, 52, 68, 78, 36, 14, 26, 36, 20, + 10, 110, 58, 42, 1, 42, 20, 52, 0, 42, + 6, 10, 0, 42, }, { @@ -1682,12 +1558,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 7, 14, 3, 3, 2, 28, 2, 28, 40, 46, 34, - 25, 46, 34, 25, 25, 25, 1, 76, 76, 40, - 1, 30, 40, 50, 50, 70, 78, 38, 14, 28, - 38, 22, 8, 108, 56, 40, 1, 40, 22, 50, - 2, 40, 8, 12, 2, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 34, 25, 1, 76, 76, 40, 1, 30, + 40, 50, 50, 70, 78, 38, 14, 28, 38, 22, + 8, 108, 56, 40, 1, 40, 22, 50, 2, 40, + 8, 12, 2, 40, }, { @@ -1705,12 +1579,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 7, 14, 3, 3, 4, 28, 4, 28, 40, 46, 34, - 25, 46, 34, 25, 25, 25, 1, 74, 74, 40, - 1, 30, 40, 50, 50, 70, 78, 38, 14, 28, - 38, 22, 8, 106, 56, 40, 1, 40, 22, 50, - 4, 40, 10, 12, 4, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 34, 25, 1, 74, 74, 40, 1, 30, + 40, 50, 50, 70, 78, 38, 14, 28, 38, 22, + 8, 106, 56, 40, 1, 40, 22, 50, 4, 40, + 10, 12, 4, 40, }, { @@ -1728,12 +1600,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 56, 32, 25, 38, 14, 1, 56, 32, 25, 38, 14, 1, 56, 32, 25, 38, 14, 1, 7, 14, 1, 1, 6, 30, 6, 30, 40, 46, 32, - 25, 46, 32, 25, 25, 25, 1, 72, 72, 40, - 1, 30, 40, 48, 48, 70, 78, 38, 14, 30, - 38, 22, 8, 104, 56, 40, 1, 40, 22, 48, - 6, 40, 12, 14, 6, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 32, 25, 1, 72, 72, 40, 1, 30, + 40, 48, 48, 70, 78, 38, 14, 30, 38, 22, + 8, 104, 56, 40, 1, 40, 22, 48, 6, 40, + 12, 14, 6, 40, }, { @@ -1751,12 +1621,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 9, 14, 0, 0, 8, 32, 8, 32, 38, 46, 30, - 23, 46, 30, 23, 23, 23, 1, 70, 70, 38, - 1, 30, 38, 46, 46, 72, 78, 40, 14, 32, - 40, 24, 6, 102, 54, 38, 1, 38, 24, 46, - 8, 38, 16, 16, 8, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 30, 23, 1, 70, 70, 38, 1, 30, + 38, 46, 46, 72, 78, 40, 14, 32, 40, 24, + 6, 102, 54, 38, 1, 38, 24, 46, 8, 38, + 16, 16, 8, 38, }, { @@ -1774,12 +1642,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 9, 14, 0, 0, 10, 32, 10, 32, 38, 46, 30, - 23, 46, 30, 23, 23, 23, 1, 68, 68, 38, - 1, 30, 38, 46, 46, 72, 78, 40, 14, 32, - 40, 24, 6, 100, 54, 38, 1, 38, 24, 46, - 10, 38, 18, 16, 10, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 30, 23, 1, 68, 68, 38, 1, 30, + 38, 46, 46, 72, 78, 40, 14, 32, 40, 24, + 6, 100, 54, 38, 1, 38, 24, 46, 10, 38, + 18, 16, 10, 38, }, { @@ -1797,12 +1663,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 54, 28, 23, 40, 14, 1, 54, 28, 23, 40, 14, 1, 54, 28, 23, 40, 14, 1, 9, 14, 2, 2, 12, 34, 12, 34, 38, 46, 28, - 23, 46, 28, 23, 23, 23, 1, 66, 66, 38, - 1, 30, 38, 44, 44, 72, 78, 40, 14, 34, - 40, 24, 6, 98, 54, 38, 1, 38, 24, 44, - 12, 38, 20, 18, 12, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 28, 23, 1, 66, 66, 38, 1, 30, + 38, 44, 44, 72, 78, 40, 14, 34, 40, 24, + 6, 98, 54, 38, 1, 38, 24, 44, 12, 38, + 20, 18, 12, 38, }, { @@ -1820,12 +1684,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 52, 26, 23, 40, 14, 1, 52, 26, 23, 40, 14, 1, 52, 26, 23, 40, 14, 1, 11, 14, 2, 2, 12, 34, 12, 34, 36, 46, 26, - 23, 46, 26, 23, 23, 23, 1, 64, 64, 36, - 1, 30, 36, 42, 42, 72, 78, 40, 14, 34, - 40, 24, 4, 96, 52, 36, 1, 36, 24, 42, - 12, 36, 22, 18, 12, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 26, 23, 1, 64, 64, 36, 1, 30, + 36, 42, 42, 72, 78, 40, 14, 34, 40, 24, + 4, 96, 52, 36, 1, 36, 24, 42, 12, 36, + 22, 18, 12, 36, }, { @@ -1843,12 +1705,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 52, 26, 21, 42, 14, 1, 52, 26, 21, 42, 14, 1, 52, 26, 21, 42, 14, 1, 11, 14, 4, 4, 14, 36, 14, 36, 36, 46, 26, - 21, 46, 26, 21, 21, 21, 1, 64, 64, 36, - 1, 30, 36, 42, 42, 74, 78, 42, 14, 36, - 42, 26, 4, 96, 52, 36, 1, 36, 26, 42, - 14, 36, 26, 20, 14, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 26, 21, 1, 64, 64, 36, 1, 30, + 36, 42, 42, 74, 78, 42, 14, 36, 42, 26, + 4, 96, 52, 36, 1, 36, 26, 42, 14, 36, + 26, 20, 14, 36, }, { @@ -1866,12 +1726,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 11, 14, 6, 6, 16, 38, 16, 38, 36, 46, 24, - 21, 46, 24, 21, 21, 21, 1, 62, 62, 36, - 1, 30, 36, 40, 40, 74, 78, 42, 14, 38, - 42, 26, 4, 94, 52, 36, 1, 36, 26, 40, - 16, 36, 28, 22, 16, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 24, 21, 1, 62, 62, 36, 1, 30, + 36, 40, 40, 74, 78, 42, 14, 38, 42, 26, + 4, 94, 52, 36, 1, 36, 26, 40, 16, 36, + 28, 22, 16, 36, }, { @@ -1889,12 +1747,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 11, 14, 6, 6, 18, 38, 18, 38, 36, 46, 24, - 21, 46, 24, 21, 21, 21, 1, 60, 60, 36, - 1, 30, 36, 40, 40, 74, 78, 42, 14, 38, - 42, 26, 4, 92, 52, 36, 1, 36, 26, 40, - 18, 36, 30, 22, 18, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 24, 21, 1, 60, 60, 36, 1, 30, + 36, 40, 40, 74, 78, 42, 14, 38, 42, 26, + 4, 92, 52, 36, 1, 36, 26, 40, 18, 36, + 30, 22, 18, 36, }, { @@ -1912,12 +1768,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 50, 22, 19, 44, 14, 1, 50, 22, 19, 44, 14, 1, 50, 22, 19, 44, 14, 1, 13, 14, 8, 8, 20, 40, 20, 40, 34, 46, 22, - 19, 46, 22, 19, 19, 19, 1, 58, 58, 34, - 1, 30, 34, 38, 38, 76, 78, 44, 14, 40, - 44, 28, 2, 90, 50, 34, 1, 34, 28, 38, - 20, 34, 32, 24, 20, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 22, 19, 1, 58, 58, 34, 1, 30, + 34, 38, 38, 76, 78, 44, 14, 40, 44, 28, + 2, 90, 50, 34, 1, 34, 28, 38, 20, 34, + 32, 24, 20, 34, }, { @@ -1935,12 +1789,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 13, 14, 10, 10, 22, 42, 22, 42, 34, 46, 20, - 19, 46, 20, 19, 19, 19, 1, 56, 56, 34, - 1, 30, 34, 36, 36, 76, 78, 44, 14, 42, - 44, 28, 2, 88, 50, 34, 1, 34, 28, 36, - 22, 34, 36, 26, 22, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 20, 19, 1, 56, 56, 34, 1, 30, + 34, 36, 36, 76, 78, 44, 14, 42, 44, 28, + 2, 88, 50, 34, 1, 34, 28, 36, 22, 34, + 36, 26, 22, 34, }, { @@ -1958,12 +1810,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 13, 14, 10, 10, 24, 42, 24, 42, 34, 46, 20, - 19, 46, 20, 19, 19, 19, 1, 54, 54, 34, - 1, 30, 34, 36, 36, 76, 78, 44, 14, 42, - 44, 28, 2, 86, 50, 34, 1, 34, 28, 36, - 24, 34, 38, 26, 24, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 20, 19, 1, 54, 54, 34, 1, 30, + 34, 36, 36, 76, 78, 44, 14, 42, 44, 28, + 2, 86, 50, 34, 1, 34, 28, 36, 24, 34, + 38, 26, 24, 34, }, { @@ -1981,12 +1831,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 48, 18, 17, 46, 14, 1, 48, 18, 17, 46, 14, 1, 48, 18, 17, 46, 14, 1, 15, 14, 12, 12, 26, 44, 26, 44, 32, 46, 18, - 17, 46, 18, 17, 17, 17, 1, 52, 52, 32, - 1, 30, 32, 34, 34, 78, 78, 46, 14, 44, - 46, 30, 0, 84, 48, 32, 1, 32, 30, 34, - 26, 32, 40, 28, 26, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 18, 17, 1, 52, 52, 32, 1, 30, + 32, 34, 34, 78, 78, 46, 14, 44, 46, 30, + 0, 84, 48, 32, 1, 32, 30, 34, 26, 32, + 40, 28, 26, 32, }, { @@ -2004,12 +1852,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 15, 14, 12, 12, 28, 44, 28, 44, 32, 46, 16, - 17, 46, 16, 17, 17, 17, 1, 50, 50, 32, - 1, 30, 32, 32, 32, 78, 78, 46, 14, 44, - 46, 30, 0, 82, 48, 32, 1, 32, 30, 32, - 28, 32, 42, 28, 28, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 16, 17, 1, 50, 50, 32, 1, 30, + 32, 32, 32, 78, 78, 46, 14, 44, 46, 30, + 0, 82, 48, 32, 1, 32, 30, 32, 28, 32, + 42, 28, 28, 32, }, { @@ -2027,12 +1873,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 15, 14, 14, 14, 30, 46, 30, 46, 32, 46, 16, - 17, 46, 16, 17, 17, 17, 1, 48, 48, 32, - 1, 30, 32, 32, 32, 78, 78, 46, 14, 46, - 46, 30, 0, 80, 48, 32, 1, 32, 30, 32, - 30, 32, 46, 30, 30, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 16, 17, 1, 48, 48, 32, 1, 30, + 32, 32, 32, 78, 78, 46, 14, 46, 46, 30, + 0, 80, 48, 32, 1, 32, 30, 32, 30, 32, + 46, 30, 30, 32, }, { @@ -2050,12 +1894,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 17, 14, 16, 16, 32, 48, 32, 48, 30, 46, 14, - 15, 46, 14, 15, 15, 15, 1, 46, 46, 30, - 1, 30, 30, 30, 30, 80, 78, 48, 14, 48, - 48, 32, 1, 78, 46, 30, 1, 30, 32, 30, - 32, 30, 48, 32, 32, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 14, 15, 1, 46, 46, 30, 1, 30, + 30, 30, 30, 80, 78, 48, 14, 48, 48, 32, + 1, 78, 46, 30, 1, 30, 32, 30, 32, 30, + 48, 32, 32, 30, }, { @@ -2073,12 +1915,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 17, 14, 16, 16, 34, 48, 34, 48, 30, 46, 14, - 15, 46, 14, 15, 15, 15, 1, 44, 44, 30, - 1, 30, 30, 30, 30, 80, 78, 48, 14, 48, - 48, 32, 1, 76, 46, 30, 1, 30, 32, 30, - 34, 30, 50, 32, 34, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 14, 15, 1, 44, 44, 30, 1, 30, + 30, 30, 30, 80, 78, 48, 14, 48, 48, 32, + 1, 76, 46, 30, 1, 30, 32, 30, 34, 30, + 50, 32, 34, 30, }, { @@ -2096,12 +1936,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 46, 12, 15, 48, 14, 1, 46, 12, 15, 48, 14, 1, 46, 12, 15, 48, 14, 1, 17, 14, 18, 18, 36, 50, 36, 50, 30, 46, 12, - 15, 46, 12, 15, 15, 15, 1, 42, 42, 30, - 1, 30, 30, 28, 28, 80, 78, 48, 14, 50, - 48, 32, 1, 74, 46, 30, 1, 30, 32, 28, - 36, 30, 52, 34, 36, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 12, 15, 1, 42, 42, 30, 1, 30, + 30, 28, 28, 80, 78, 48, 14, 50, 48, 32, + 1, 74, 46, 30, 1, 30, 32, 28, 36, 30, + 52, 34, 36, 30, }, { @@ -2119,12 +1957,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 19, 14, 20, 20, 38, 52, 38, 52, 28, 46, 10, - 13, 46, 10, 13, 13, 13, 1, 40, 40, 28, - 1, 30, 28, 26, 26, 82, 78, 50, 14, 52, - 50, 34, 3, 72, 44, 28, 1, 28, 34, 26, - 38, 28, 56, 36, 38, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 10, 13, 1, 40, 40, 28, 1, 30, + 28, 26, 26, 82, 78, 50, 14, 52, 50, 34, + 3, 72, 44, 28, 1, 28, 34, 26, 38, 28, + 56, 36, 38, 28, }, { @@ -2142,12 +1978,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 19, 14, 20, 20, 40, 52, 40, 52, 28, 46, 10, - 13, 46, 10, 13, 13, 13, 1, 38, 38, 28, - 1, 30, 28, 26, 26, 82, 78, 50, 14, 52, - 50, 34, 3, 70, 44, 28, 1, 28, 34, 26, - 40, 28, 58, 36, 40, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 10, 13, 1, 38, 38, 28, 1, 30, + 28, 26, 26, 82, 78, 50, 14, 52, 50, 34, + 3, 70, 44, 28, 1, 28, 34, 26, 40, 28, + 58, 36, 40, 28, }, { @@ -2165,12 +1999,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 44, 8, 13, 50, 14, 1, 44, 8, 13, 50, 14, 1, 44, 8, 13, 50, 14, 1, 19, 14, 22, 22, 42, 54, 42, 54, 28, 46, 8, - 13, 46, 8, 13, 13, 13, 1, 36, 36, 28, - 1, 30, 28, 24, 24, 82, 78, 50, 14, 54, - 50, 34, 3, 68, 44, 28, 1, 28, 34, 24, - 42, 28, 60, 38, 42, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 8, 13, 1, 36, 36, 28, 1, 30, + 28, 24, 24, 82, 78, 50, 14, 54, 50, 34, + 3, 68, 44, 28, 1, 28, 34, 24, 42, 28, + 60, 38, 42, 28, }, { @@ -2188,12 +2020,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 42, 6, 13, 50, 14, 1, 42, 6, 13, 50, 14, 1, 42, 6, 13, 50, 14, 1, 21, 14, 22, 22, 42, 54, 42, 54, 26, 46, 6, - 13, 46, 6, 13, 13, 13, 1, 34, 34, 26, - 1, 30, 26, 22, 22, 82, 78, 50, 14, 54, - 50, 34, 5, 66, 42, 26, 1, 26, 34, 22, - 42, 26, 62, 38, 42, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 6, 13, 1, 34, 34, 26, 1, 30, + 26, 22, 22, 82, 78, 50, 14, 54, 50, 34, + 5, 66, 42, 26, 1, 26, 34, 22, 42, 26, + 62, 38, 42, 26, }, { @@ -2211,12 +2041,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 42, 6, 11, 52, 14, 1, 42, 6, 11, 52, 14, 1, 42, 6, 11, 52, 14, 1, 21, 14, 24, 24, 44, 56, 44, 56, 26, 46, 6, - 11, 46, 6, 11, 11, 11, 1, 34, 34, 26, - 1, 30, 26, 22, 22, 84, 78, 52, 14, 56, - 52, 36, 5, 66, 42, 26, 1, 26, 36, 22, - 44, 26, 66, 40, 44, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 6, 11, 1, 34, 34, 26, 1, 30, + 26, 22, 22, 84, 78, 52, 14, 56, 52, 36, + 5, 66, 42, 26, 1, 26, 36, 22, 44, 26, + 66, 40, 44, 26, }, { @@ -2234,12 +2062,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 21, 14, 26, 26, 46, 58, 46, 58, 26, 46, 4, - 11, 46, 4, 11, 11, 11, 1, 32, 32, 26, - 1, 30, 26, 20, 20, 84, 78, 52, 14, 58, - 52, 36, 5, 64, 42, 26, 1, 26, 36, 20, - 46, 26, 68, 42, 46, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 4, 11, 1, 32, 32, 26, 1, 30, + 26, 20, 20, 84, 78, 52, 14, 58, 52, 36, + 5, 64, 42, 26, 1, 26, 36, 20, 46, 26, + 68, 42, 46, 26, }, { @@ -2257,12 +2083,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 21, 14, 26, 26, 48, 58, 48, 58, 26, 46, 4, - 11, 46, 4, 11, 11, 11, 1, 30, 30, 26, - 1, 30, 26, 20, 20, 84, 78, 52, 14, 58, - 52, 36, 5, 62, 42, 26, 1, 26, 36, 20, - 48, 26, 70, 42, 48, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 4, 11, 1, 30, 30, 26, 1, 30, + 26, 20, 20, 84, 78, 52, 14, 58, 52, 36, + 5, 62, 42, 26, 1, 26, 36, 20, 48, 26, + 70, 42, 48, 26, }, { @@ -2280,12 +2104,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 40, 2, 9, 54, 14, 1, 40, 2, 9, 54, 14, 1, 40, 2, 9, 54, 14, 1, 23, 14, 28, 28, 50, 60, 50, 60, 24, 46, 2, - 9, 46, 2, 9, 9, 9, 1, 28, 28, 24, - 1, 30, 24, 18, 18, 86, 78, 54, 14, 60, - 54, 38, 7, 60, 40, 24, 1, 24, 38, 18, - 50, 24, 72, 44, 50, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 2, 9, 1, 28, 28, 24, 1, 30, + 24, 18, 18, 86, 78, 54, 14, 60, 54, 38, + 7, 60, 40, 24, 1, 24, 38, 18, 50, 24, + 72, 44, 50, 24, }, { @@ -2303,12 +2125,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 23, 14, 30, 30, 52, 62, 52, 62, 24, 46, 0, - 9, 46, 0, 9, 9, 9, 1, 26, 26, 24, - 1, 30, 24, 16, 16, 86, 78, 54, 14, 62, - 54, 38, 7, 58, 40, 24, 1, 24, 38, 16, - 52, 24, 76, 46, 52, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 0, 9, 1, 26, 26, 24, 1, 30, + 24, 16, 16, 86, 78, 54, 14, 62, 54, 38, + 7, 58, 40, 24, 1, 24, 38, 16, 52, 24, + 76, 46, 52, 24, }, { @@ -2326,12 +2146,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 23, 14, 30, 30, 54, 62, 54, 62, 24, 46, 0, - 9, 46, 0, 9, 9, 9, 1, 24, 24, 24, - 1, 30, 24, 16, 16, 86, 78, 54, 14, 62, - 54, 38, 7, 56, 40, 24, 1, 24, 38, 16, - 54, 24, 78, 46, 54, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 0, 9, 1, 24, 24, 24, 1, 30, + 24, 16, 16, 86, 78, 54, 14, 62, 54, 38, + 7, 56, 40, 24, 1, 24, 38, 16, 54, 24, + 78, 46, 54, 24, }, { @@ -2349,12 +2167,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 38, 1, 7, 56, 14, 1, 38, 1, 7, 56, 14, 1, 38, 1, 7, 56, 14, 1, 25, 14, 32, 32, 56, 64, 56, 64, 22, 46, 1, - 7, 46, 1, 7, 7, 7, 1, 22, 22, 22, - 1, 30, 22, 14, 14, 88, 78, 56, 14, 64, - 56, 40, 9, 54, 38, 22, 1, 22, 40, 14, - 56, 22, 80, 48, 56, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 1, 7, 1, 22, 22, 22, 1, 30, + 22, 14, 14, 88, 78, 56, 14, 64, 56, 40, + 9, 54, 38, 22, 1, 22, 40, 14, 56, 22, + 80, 48, 56, 22, }, { @@ -2372,12 +2188,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 25, 14, 32, 32, 58, 64, 58, 64, 22, 46, 3, - 7, 46, 3, 7, 7, 7, 1, 20, 20, 22, - 1, 30, 22, 12, 12, 88, 78, 56, 14, 64, - 56, 40, 9, 52, 38, 22, 1, 22, 40, 12, - 58, 22, 82, 48, 58, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 3, 7, 1, 20, 20, 22, 1, 30, + 22, 12, 12, 88, 78, 56, 14, 64, 56, 40, + 9, 52, 38, 22, 1, 22, 40, 12, 58, 22, + 82, 48, 58, 22, }, { @@ -2395,12 +2209,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 25, 14, 34, 34, 60, 66, 60, 66, 22, 46, 3, - 7, 46, 3, 7, 7, 7, 1, 18, 18, 22, - 1, 30, 22, 12, 12, 88, 78, 56, 14, 66, - 56, 40, 9, 50, 38, 22, 1, 22, 40, 12, - 60, 22, 86, 50, 60, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 3, 7, 1, 18, 18, 22, 1, 30, + 22, 12, 12, 88, 78, 56, 14, 66, 56, 40, + 9, 50, 38, 22, 1, 22, 40, 12, 60, 22, + 86, 50, 60, 22, }, { @@ -2418,12 +2230,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 27, 14, 36, 36, 62, 68, 62, 68, 20, 46, 5, - 5, 46, 5, 5, 5, 5, 1, 16, 16, 20, - 1, 30, 20, 10, 10, 90, 78, 58, 14, 68, - 58, 42, 11, 48, 36, 20, 1, 20, 42, 10, - 62, 20, 88, 52, 62, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 5, 5, 1, 16, 16, 20, 1, 30, + 20, 10, 10, 90, 78, 58, 14, 68, 58, 42, + 11, 48, 36, 20, 1, 20, 42, 10, 62, 20, + 88, 52, 62, 20, }, { @@ -2441,12 +2251,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 27, 14, 36, 36, 64, 68, 64, 68, 20, 46, 5, - 5, 46, 5, 5, 5, 5, 1, 14, 14, 20, - 1, 30, 20, 10, 10, 90, 78, 58, 14, 68, - 58, 42, 11, 46, 36, 20, 1, 20, 42, 10, - 64, 20, 90, 52, 64, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 5, 5, 1, 14, 14, 20, 1, 30, + 20, 10, 10, 90, 78, 58, 14, 68, 58, 42, + 11, 46, 36, 20, 1, 20, 42, 10, 64, 20, + 90, 52, 64, 20, }, { @@ -2464,12 +2272,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 36, 7, 5, 58, 14, 1, 36, 7, 5, 58, 14, 1, 36, 7, 5, 58, 14, 1, 27, 14, 38, 38, 66, 70, 66, 70, 20, 46, 7, - 5, 46, 7, 5, 5, 5, 1, 12, 12, 20, - 1, 30, 20, 8, 8, 90, 78, 58, 14, 70, - 58, 42, 11, 44, 36, 20, 1, 20, 42, 8, - 66, 20, 92, 54, 66, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 7, 5, 1, 12, 12, 20, 1, 30, + 20, 8, 8, 90, 78, 58, 14, 70, 58, 42, + 11, 44, 36, 20, 1, 20, 42, 8, 66, 20, + 92, 54, 66, 20, }, { @@ -2487,12 +2293,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 29, 14, 40, 40, 68, 72, 68, 72, 18, 46, 9, - 3, 46, 9, 3, 3, 3, 1, 10, 10, 18, - 1, 30, 18, 6, 6, 92, 78, 60, 14, 72, - 60, 44, 13, 42, 34, 18, 1, 18, 44, 6, - 68, 18, 96, 56, 68, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 9, 3, 1, 10, 10, 18, 1, 30, + 18, 6, 6, 92, 78, 60, 14, 72, 60, 44, + 13, 42, 34, 18, 1, 18, 44, 6, 68, 18, + 96, 56, 68, 18, }, { @@ -2510,12 +2314,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 29, 14, 40, 40, 70, 72, 70, 72, 18, 46, 9, - 3, 46, 9, 3, 3, 3, 1, 8, 8, 18, - 1, 30, 18, 6, 6, 92, 78, 60, 14, 72, - 60, 44, 13, 40, 34, 18, 1, 18, 44, 6, - 70, 18, 98, 56, 70, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 9, 3, 1, 8, 8, 18, 1, 30, + 18, 6, 6, 92, 78, 60, 14, 72, 60, 44, + 13, 40, 34, 18, 1, 18, 44, 6, 70, 18, + 98, 56, 70, 18, }, { @@ -2533,12 +2335,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 34, 11, 3, 60, 14, 1, 34, 11, 3, 60, 14, 1, 34, 11, 3, 60, 14, 1, 29, 14, 42, 42, 72, 74, 72, 74, 18, 46, 11, - 3, 46, 11, 3, 3, 3, 1, 6, 6, 18, - 1, 30, 18, 4, 4, 92, 78, 60, 14, 74, - 60, 44, 13, 38, 34, 18, 1, 18, 44, 4, - 72, 18, 100, 58, 72, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 11, 3, 1, 6, 6, 18, 1, 30, + 18, 4, 4, 92, 78, 60, 14, 74, 60, 44, + 13, 38, 34, 18, 1, 18, 44, 4, 72, 18, + 100, 58, 72, 18, }, { @@ -2556,12 +2356,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 32, 13, 3, 60, 14, 1, 32, 13, 3, 60, 14, 1, 32, 13, 3, 60, 14, 1, 31, 14, 42, 42, 72, 74, 72, 74, 16, 46, 13, - 3, 46, 13, 3, 3, 3, 1, 4, 4, 16, - 1, 30, 16, 2, 2, 92, 78, 60, 14, 74, - 60, 44, 15, 36, 32, 16, 1, 16, 44, 2, - 72, 16, 102, 58, 72, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 13, 3, 1, 4, 4, 16, 1, 30, + 16, 2, 2, 92, 78, 60, 14, 74, 60, 44, + 15, 36, 32, 16, 1, 16, 44, 2, 72, 16, + 102, 58, 72, 16, }, { @@ -2579,12 +2377,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 32, 13, 1, 62, 14, 1, 32, 13, 1, 62, 14, 1, 32, 13, 1, 62, 14, 1, 31, 14, 44, 44, 74, 76, 74, 76, 16, 46, 13, - 1, 46, 13, 1, 1, 1, 1, 4, 4, 16, - 1, 30, 16, 2, 2, 94, 78, 62, 14, 76, - 62, 46, 15, 36, 32, 16, 1, 16, 46, 2, - 74, 16, 106, 60, 74, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 13, 1, 1, 4, 4, 16, 1, 30, + 16, 2, 2, 94, 78, 62, 14, 76, 62, 46, + 15, 36, 32, 16, 1, 16, 46, 2, 74, 16, + 106, 60, 74, 16, }, { @@ -2602,12 +2398,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 31, 14, 46, 46, 76, 78, 76, 78, 16, 46, 15, - 1, 46, 15, 1, 1, 1, 1, 2, 2, 16, - 1, 30, 16, 0, 0, 94, 78, 62, 14, 78, - 62, 46, 15, 34, 32, 16, 1, 16, 46, 0, - 76, 16, 108, 62, 76, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 15, 1, 1, 2, 2, 16, 1, 30, + 16, 0, 0, 94, 78, 62, 14, 78, 62, 46, + 15, 34, 32, 16, 1, 16, 46, 0, 76, 16, + 108, 62, 76, 16, }, { @@ -2625,12 +2419,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 31, 14, 46, 46, 78, 78, 78, 78, 16, 46, 15, - 1, 46, 15, 1, 1, 1, 1, 0, 0, 16, - 1, 30, 16, 0, 0, 94, 78, 62, 14, 78, - 62, 46, 15, 32, 32, 16, 1, 16, 46, 0, - 78, 16, 110, 62, 78, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 15, 1, 1, 0, 0, 16, 1, 30, + 16, 0, 0, 94, 78, 62, 14, 78, 62, 46, + 15, 32, 32, 16, 1, 16, 46, 0, 78, 16, + 110, 62, 78, 16, }, }, @@ -2651,12 +2443,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 33, 62, 46, 33, 30, 14, 1, 62, 46, 33, 30, 14, 1, 62, 46, 33, 30, 14, 1, 1, 14, 1, 1, 1, 14, 1, 14, 46, 46, 46, - 33, 46, 46, 33, 33, 33, 1, 94, 46, 46, - 1, 30, 46, 62, 62, 62, 78, 30, 14, 14, - 30, 1, 14, 124, 62, 46, 1, 30, 46, 62, - 17, 46, 17, 17, 17, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 17, 17, 17, 17, - + 33, 46, 46, 33, 1, 94, 46, 46, 1, 30, + 46, 62, 62, 62, 78, 30, 14, 14, 30, 1, + 14, 124, 62, 46, 1, 30, 46, 62, 17, 46, + 17, 17, 17, 46, }, { @@ -2674,12 +2464,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 31, 62, 46, 31, 32, 14, 1, 62, 46, 31, 32, 14, 1, 62, 46, 31, 32, 14, 1, 1, 14, 0, 0, 0, 16, 0, 16, 46, 46, 46, - 31, 46, 46, 31, 31, 31, 1, 94, 46, 46, - 1, 30, 46, 62, 62, 64, 78, 32, 14, 16, - 32, 0, 14, 124, 62, 46, 1, 30, 46, 62, - 15, 46, 13, 15, 15, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 46, 31, 1, 94, 46, 46, 1, 30, + 46, 62, 62, 64, 78, 32, 14, 16, 32, 0, + 14, 124, 62, 46, 1, 30, 46, 62, 15, 46, + 13, 15, 15, 46, }, { @@ -2697,12 +2485,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 29, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 1, 14, 0, 0, 2, 18, 2, 18, 46, 46, 44, - 31, 46, 44, 31, 31, 31, 1, 92, 46, 46, - 1, 30, 46, 60, 60, 64, 78, 32, 14, 18, - 32, 2, 14, 124, 62, 46, 1, 30, 46, 60, - 13, 46, 11, 13, 13, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 44, 31, 1, 92, 46, 46, 1, 30, + 46, 60, 60, 64, 78, 32, 14, 18, 32, 2, + 14, 124, 62, 46, 1, 30, 46, 60, 13, 46, + 11, 13, 13, 46, }, { @@ -2720,12 +2506,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 29, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 62, 44, 31, 32, 14, 1, 1, 14, 0, 0, 2, 18, 2, 18, 46, 46, 44, - 31, 46, 44, 31, 31, 31, 1, 90, 46, 46, - 1, 30, 46, 60, 60, 64, 78, 32, 14, 18, - 32, 2, 14, 124, 62, 46, 1, 30, 46, 60, - 11, 46, 9, 11, 11, 46, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 15, 15, 15, 15, - + 31, 46, 44, 31, 1, 90, 46, 46, 1, 30, + 46, 60, 60, 64, 78, 32, 14, 18, 32, 2, + 14, 124, 62, 46, 1, 30, 46, 60, 11, 46, + 9, 11, 11, 46, }, { @@ -2743,12 +2527,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 27, 60, 42, 29, 34, 14, 1, 60, 42, 29, 34, 14, 1, 60, 42, 29, 34, 14, 1, 3, 14, 2, 2, 4, 20, 4, 20, 44, 46, 42, - 29, 46, 42, 29, 29, 29, 1, 88, 44, 44, - 1, 30, 44, 58, 58, 66, 78, 34, 14, 20, - 34, 4, 12, 124, 60, 44, 1, 30, 44, 58, - 9, 44, 7, 9, 9, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 42, 29, 1, 88, 44, 44, 1, 30, + 44, 58, 58, 66, 78, 34, 14, 20, 34, 4, + 12, 124, 60, 44, 1, 30, 44, 58, 9, 44, + 7, 9, 9, 44, }, { @@ -2766,12 +2548,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 25, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 3, 14, 2, 2, 6, 22, 6, 22, 44, 46, 40, - 29, 46, 40, 29, 29, 29, 1, 86, 44, 44, - 1, 30, 44, 56, 56, 66, 78, 34, 14, 22, - 34, 6, 12, 124, 60, 44, 1, 30, 44, 56, - 7, 44, 3, 7, 7, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 40, 29, 1, 86, 44, 44, 1, 30, + 44, 56, 56, 66, 78, 34, 14, 22, 34, 6, + 12, 124, 60, 44, 1, 30, 44, 56, 7, 44, + 3, 7, 7, 44, }, { @@ -2789,12 +2569,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 25, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 60, 40, 29, 34, 14, 1, 3, 14, 2, 2, 6, 22, 6, 22, 44, 46, 40, - 29, 46, 40, 29, 29, 29, 1, 84, 44, 44, - 1, 30, 44, 56, 56, 66, 78, 34, 14, 22, - 34, 6, 12, 124, 60, 44, 1, 30, 44, 56, - 5, 44, 1, 5, 5, 44, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 13, 13, 13, 13, - + 29, 46, 40, 29, 1, 84, 44, 44, 1, 30, + 44, 56, 56, 66, 78, 34, 14, 22, 34, 6, + 12, 124, 60, 44, 1, 30, 44, 56, 5, 44, + 1, 5, 5, 44, }, { @@ -2812,12 +2590,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 23, 58, 38, 27, 36, 14, 1, 58, 38, 27, 36, 14, 1, 58, 38, 27, 36, 14, 1, 5, 14, 4, 4, 8, 24, 8, 24, 42, 46, 38, - 27, 46, 38, 27, 27, 27, 1, 82, 42, 42, - 1, 30, 42, 54, 54, 68, 78, 36, 14, 24, - 36, 8, 10, 124, 58, 42, 1, 30, 42, 54, - 3, 42, 0, 3, 3, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 38, 27, 1, 82, 42, 42, 1, 30, + 42, 54, 54, 68, 78, 36, 14, 24, 36, 8, + 10, 124, 58, 42, 1, 30, 42, 54, 3, 42, + 0, 3, 3, 42, }, { @@ -2835,12 +2611,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 23, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 5, 14, 4, 4, 8, 24, 8, 24, 42, 46, 36, - 27, 46, 36, 27, 27, 27, 1, 80, 42, 42, - 1, 30, 42, 52, 52, 68, 78, 36, 14, 24, - 36, 8, 10, 124, 58, 42, 1, 30, 42, 52, - 1, 42, 2, 1, 1, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 36, 27, 1, 80, 42, 42, 1, 30, + 42, 52, 52, 68, 78, 36, 14, 24, 36, 8, + 10, 124, 58, 42, 1, 30, 42, 52, 1, 42, + 2, 1, 1, 42, }, { @@ -2858,12 +2632,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 21, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 58, 36, 27, 36, 14, 1, 5, 14, 4, 4, 10, 26, 10, 26, 42, 46, 36, - 27, 46, 36, 27, 27, 27, 1, 78, 42, 42, - 1, 30, 42, 52, 52, 68, 78, 36, 14, 26, - 36, 10, 10, 124, 58, 42, 1, 30, 42, 52, - 0, 42, 6, 0, 0, 42, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 11, 11, 11, 11, - + 27, 46, 36, 27, 1, 78, 42, 42, 1, 30, + 42, 52, 52, 68, 78, 36, 14, 26, 36, 10, + 10, 124, 58, 42, 1, 30, 42, 52, 0, 42, + 6, 0, 0, 42, }, { @@ -2881,12 +2653,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 19, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 7, 14, 6, 6, 12, 28, 12, 28, 40, 46, 34, - 25, 46, 34, 25, 25, 25, 1, 76, 40, 40, - 1, 30, 40, 50, 50, 70, 78, 38, 14, 28, - 38, 12, 8, 124, 56, 40, 1, 30, 40, 50, - 2, 40, 8, 2, 2, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 34, 25, 1, 76, 40, 40, 1, 30, + 40, 50, 50, 70, 78, 38, 14, 28, 38, 12, + 8, 124, 56, 40, 1, 30, 40, 50, 2, 40, + 8, 2, 2, 40, }, { @@ -2904,12 +2674,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 19, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 56, 34, 25, 38, 14, 1, 7, 14, 6, 6, 12, 28, 12, 28, 40, 46, 34, - 25, 46, 34, 25, 25, 25, 1, 74, 40, 40, - 1, 30, 40, 50, 50, 70, 78, 38, 14, 28, - 38, 12, 8, 124, 56, 40, 1, 30, 40, 50, - 4, 40, 10, 4, 4, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 34, 25, 1, 74, 40, 40, 1, 30, + 40, 50, 50, 70, 78, 38, 14, 28, 38, 12, + 8, 124, 56, 40, 1, 30, 40, 50, 4, 40, + 10, 4, 4, 40, }, { @@ -2927,12 +2695,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 17, 56, 32, 25, 38, 14, 1, 56, 32, 25, 38, 14, 1, 56, 32, 25, 38, 14, 1, 7, 14, 6, 6, 14, 30, 14, 30, 40, 46, 32, - 25, 46, 32, 25, 25, 25, 1, 72, 40, 40, - 1, 30, 40, 48, 48, 70, 78, 38, 14, 30, - 38, 14, 8, 124, 56, 40, 1, 30, 40, 48, - 6, 40, 12, 6, 6, 40, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, - + 25, 46, 32, 25, 1, 72, 40, 40, 1, 30, + 40, 48, 48, 70, 78, 38, 14, 30, 38, 14, + 8, 124, 56, 40, 1, 30, 40, 48, 6, 40, + 12, 6, 6, 40, }, { @@ -2950,12 +2716,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 15, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 9, 14, 8, 8, 16, 32, 16, 32, 38, 46, 30, - 23, 46, 30, 23, 23, 23, 1, 70, 38, 38, - 1, 30, 38, 46, 46, 72, 78, 40, 14, 32, - 40, 16, 6, 124, 54, 38, 1, 30, 38, 46, - 8, 38, 16, 8, 8, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 30, 23, 1, 70, 38, 38, 1, 30, + 38, 46, 46, 72, 78, 40, 14, 32, 40, 16, + 6, 124, 54, 38, 1, 30, 38, 46, 8, 38, + 16, 8, 8, 38, }, { @@ -2973,12 +2737,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 15, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 54, 30, 23, 40, 14, 1, 9, 14, 8, 8, 16, 32, 16, 32, 38, 46, 30, - 23, 46, 30, 23, 23, 23, 1, 68, 38, 38, - 1, 30, 38, 46, 46, 72, 78, 40, 14, 32, - 40, 16, 6, 124, 54, 38, 1, 30, 38, 46, - 10, 38, 18, 10, 10, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 30, 23, 1, 68, 38, 38, 1, 30, + 38, 46, 46, 72, 78, 40, 14, 32, 40, 16, + 6, 124, 54, 38, 1, 30, 38, 46, 10, 38, + 18, 10, 10, 38, }, { @@ -2996,12 +2758,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 13, 54, 28, 23, 40, 14, 1, 54, 28, 23, 40, 14, 1, 54, 28, 23, 40, 14, 1, 9, 14, 8, 8, 18, 34, 18, 34, 38, 46, 28, - 23, 46, 28, 23, 23, 23, 1, 66, 38, 38, - 1, 30, 38, 44, 44, 72, 78, 40, 14, 34, - 40, 18, 6, 122, 54, 38, 1, 30, 38, 44, - 12, 38, 20, 12, 12, 38, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 28, 23, 1, 66, 38, 38, 1, 30, + 38, 44, 44, 72, 78, 40, 14, 34, 40, 18, + 6, 122, 54, 38, 1, 30, 38, 44, 12, 38, + 20, 12, 12, 38, }, { @@ -3019,12 +2779,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 13, 52, 26, 23, 40, 14, 1, 52, 26, 23, 40, 14, 1, 52, 26, 23, 40, 14, 1, 11, 14, 8, 8, 18, 34, 18, 34, 36, 46, 26, - 23, 46, 26, 23, 23, 23, 1, 64, 36, 36, - 1, 30, 36, 42, 42, 72, 78, 40, 14, 34, - 40, 18, 4, 118, 52, 36, 1, 30, 36, 42, - 12, 36, 22, 12, 12, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 7, 7, 7, 7, - + 23, 46, 26, 23, 1, 64, 36, 36, 1, 30, + 36, 42, 42, 72, 78, 40, 14, 34, 40, 18, + 4, 118, 52, 36, 1, 30, 36, 42, 12, 36, + 22, 12, 12, 36, }, { @@ -3042,12 +2800,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 11, 52, 26, 21, 42, 14, 1, 52, 26, 21, 42, 14, 1, 52, 26, 21, 42, 14, 1, 11, 14, 10, 10, 20, 36, 20, 36, 36, 46, 26, - 21, 46, 26, 21, 21, 21, 1, 64, 36, 36, - 1, 30, 36, 42, 42, 74, 78, 42, 14, 36, - 42, 20, 4, 116, 52, 36, 1, 30, 36, 42, - 14, 36, 26, 14, 14, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 26, 21, 1, 64, 36, 36, 1, 30, + 36, 42, 42, 74, 78, 42, 14, 36, 42, 20, + 4, 116, 52, 36, 1, 30, 36, 42, 14, 36, + 26, 14, 14, 36, }, { @@ -3065,12 +2821,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 9, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 11, 14, 10, 10, 22, 38, 22, 38, 36, 46, 24, - 21, 46, 24, 21, 21, 21, 1, 62, 36, 36, - 1, 30, 36, 40, 40, 74, 78, 42, 14, 38, - 42, 22, 4, 114, 52, 36, 1, 30, 36, 40, - 16, 36, 28, 16, 16, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 24, 21, 1, 62, 36, 36, 1, 30, + 36, 40, 40, 74, 78, 42, 14, 38, 42, 22, + 4, 114, 52, 36, 1, 30, 36, 40, 16, 36, + 28, 16, 16, 36, }, { @@ -3088,12 +2842,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 9, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 52, 24, 21, 42, 14, 1, 11, 14, 10, 10, 22, 38, 22, 38, 36, 46, 24, - 21, 46, 24, 21, 21, 21, 1, 60, 36, 36, - 1, 30, 36, 40, 40, 74, 78, 42, 14, 38, - 42, 22, 4, 112, 52, 36, 1, 30, 36, 40, - 18, 36, 30, 18, 18, 36, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 5, 5, 5, 5, - + 21, 46, 24, 21, 1, 60, 36, 36, 1, 30, + 36, 40, 40, 74, 78, 42, 14, 38, 42, 22, + 4, 112, 52, 36, 1, 30, 36, 40, 18, 36, + 30, 18, 18, 36, }, { @@ -3111,12 +2863,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 7, 50, 22, 19, 44, 14, 1, 50, 22, 19, 44, 14, 1, 50, 22, 19, 44, 14, 1, 13, 14, 12, 12, 24, 40, 24, 40, 34, 46, 22, - 19, 46, 22, 19, 19, 19, 1, 58, 34, 34, - 1, 30, 34, 38, 38, 76, 78, 44, 14, 40, - 44, 24, 2, 108, 50, 34, 1, 30, 34, 38, - 20, 34, 32, 20, 20, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 22, 19, 1, 58, 34, 34, 1, 30, + 34, 38, 38, 76, 78, 44, 14, 40, 44, 24, + 2, 108, 50, 34, 1, 30, 34, 38, 20, 34, + 32, 20, 20, 34, }, { @@ -3134,12 +2884,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 5, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 13, 14, 12, 12, 26, 42, 26, 42, 34, 46, 20, - 19, 46, 20, 19, 19, 19, 1, 56, 34, 34, - 1, 30, 34, 36, 36, 76, 78, 44, 14, 42, - 44, 26, 2, 106, 50, 34, 1, 30, 34, 36, - 22, 34, 36, 22, 22, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 20, 19, 1, 56, 34, 34, 1, 30, + 34, 36, 36, 76, 78, 44, 14, 42, 44, 26, + 2, 106, 50, 34, 1, 30, 34, 36, 22, 34, + 36, 22, 22, 34, }, { @@ -3157,12 +2905,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 5, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 50, 20, 19, 44, 14, 1, 13, 14, 12, 12, 26, 42, 26, 42, 34, 46, 20, - 19, 46, 20, 19, 19, 19, 1, 54, 34, 34, - 1, 30, 34, 36, 36, 76, 78, 44, 14, 42, - 44, 26, 2, 104, 50, 34, 1, 30, 34, 36, - 24, 34, 38, 24, 24, 34, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 3, 3, 3, - + 19, 46, 20, 19, 1, 54, 34, 34, 1, 30, + 34, 36, 36, 76, 78, 44, 14, 42, 44, 26, + 2, 104, 50, 34, 1, 30, 34, 36, 24, 34, + 38, 24, 24, 34, }, { @@ -3180,12 +2926,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 3, 48, 18, 17, 46, 14, 1, 48, 18, 17, 46, 14, 1, 48, 18, 17, 46, 14, 1, 15, 14, 14, 14, 28, 44, 28, 44, 32, 46, 18, - 17, 46, 18, 17, 17, 17, 1, 52, 32, 32, - 1, 30, 32, 34, 34, 78, 78, 46, 14, 44, - 46, 28, 0, 102, 48, 32, 1, 30, 32, 34, - 26, 32, 40, 26, 26, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 18, 17, 1, 52, 32, 32, 1, 30, + 32, 34, 34, 78, 78, 46, 14, 44, 46, 28, + 0, 102, 48, 32, 1, 30, 32, 34, 26, 32, + 40, 26, 26, 32, }, { @@ -3203,12 +2947,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 3, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 15, 14, 14, 14, 28, 44, 28, 44, 32, 46, 16, - 17, 46, 16, 17, 17, 17, 1, 50, 32, 32, - 1, 30, 32, 32, 32, 78, 78, 46, 14, 44, - 46, 28, 0, 98, 48, 32, 1, 30, 32, 32, - 28, 32, 42, 28, 28, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 16, 17, 1, 50, 32, 32, 1, 30, + 32, 32, 32, 78, 78, 46, 14, 44, 46, 28, + 0, 98, 48, 32, 1, 30, 32, 32, 28, 32, + 42, 28, 28, 32, }, { @@ -3226,12 +2968,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 1, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 48, 16, 17, 46, 14, 1, 15, 14, 14, 14, 30, 46, 30, 46, 32, 46, 16, - 17, 46, 16, 17, 17, 17, 1, 48, 32, 32, - 1, 30, 32, 32, 32, 78, 78, 46, 14, 46, - 46, 30, 0, 96, 48, 32, 1, 30, 32, 32, - 30, 32, 46, 30, 30, 32, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - + 17, 46, 16, 17, 1, 48, 32, 32, 1, 30, + 32, 32, 32, 78, 78, 46, 14, 46, 46, 30, + 0, 96, 48, 32, 1, 30, 32, 32, 30, 32, + 46, 30, 30, 32, }, { @@ -3249,12 +2989,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 0, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 17, 14, 16, 16, 32, 48, 32, 48, 30, 46, 14, - 15, 46, 14, 15, 15, 15, 1, 46, 30, 30, - 1, 30, 30, 30, 30, 80, 78, 48, 14, 48, - 48, 32, 1, 94, 46, 30, 1, 30, 30, 30, - 32, 30, 48, 32, 32, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 14, 15, 1, 46, 30, 30, 1, 30, + 30, 30, 30, 80, 78, 48, 14, 48, 48, 32, + 1, 94, 46, 30, 1, 30, 30, 30, 32, 30, + 48, 32, 32, 30, }, { @@ -3272,12 +3010,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 0, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 46, 14, 15, 48, 14, 1, 17, 14, 16, 16, 32, 48, 32, 48, 30, 46, 14, - 15, 46, 14, 15, 15, 15, 1, 44, 30, 30, - 1, 30, 30, 30, 30, 80, 78, 48, 14, 48, - 48, 32, 1, 92, 46, 30, 1, 30, 30, 30, - 34, 30, 50, 34, 34, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 14, 15, 1, 44, 30, 30, 1, 30, + 30, 30, 30, 80, 78, 48, 14, 48, 48, 32, + 1, 92, 46, 30, 1, 30, 30, 30, 34, 30, + 50, 34, 34, 30, }, { @@ -3295,12 +3031,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 2, 46, 12, 15, 48, 14, 1, 46, 12, 15, 48, 14, 1, 46, 12, 15, 48, 14, 1, 17, 14, 16, 16, 34, 50, 34, 50, 30, 46, 12, - 15, 46, 12, 15, 15, 15, 1, 42, 30, 30, - 1, 30, 30, 28, 28, 80, 78, 48, 14, 50, - 48, 34, 1, 88, 46, 30, 1, 30, 30, 28, - 36, 30, 52, 36, 36, 30, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - + 15, 46, 12, 15, 1, 42, 30, 30, 1, 30, + 30, 28, 28, 80, 78, 48, 14, 50, 48, 34, + 1, 88, 46, 30, 1, 30, 30, 28, 36, 30, + 52, 36, 36, 30, }, { @@ -3318,12 +3052,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 4, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 19, 14, 18, 18, 36, 52, 36, 52, 28, 46, 10, - 13, 46, 10, 13, 13, 13, 1, 40, 28, 28, - 1, 30, 28, 26, 26, 82, 78, 50, 14, 52, - 50, 36, 3, 86, 44, 28, 1, 30, 28, 26, - 38, 28, 56, 38, 38, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 10, 13, 1, 40, 28, 28, 1, 30, + 28, 26, 26, 82, 78, 50, 14, 52, 50, 36, + 3, 86, 44, 28, 1, 30, 28, 26, 38, 28, + 56, 38, 38, 28, }, { @@ -3341,12 +3073,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 4, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 44, 10, 13, 50, 14, 1, 19, 14, 18, 18, 36, 52, 36, 52, 28, 46, 10, - 13, 46, 10, 13, 13, 13, 1, 38, 28, 28, - 1, 30, 28, 26, 26, 82, 78, 50, 14, 52, - 50, 36, 3, 84, 44, 28, 1, 30, 28, 26, - 40, 28, 58, 40, 40, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 10, 13, 1, 38, 28, 28, 1, 30, + 28, 26, 26, 82, 78, 50, 14, 52, 50, 36, + 3, 84, 44, 28, 1, 30, 28, 26, 40, 28, + 58, 40, 40, 28, }, { @@ -3364,12 +3094,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 6, 44, 8, 13, 50, 14, 1, 44, 8, 13, 50, 14, 1, 44, 8, 13, 50, 14, 1, 19, 14, 18, 18, 38, 54, 38, 54, 28, 46, 8, - 13, 46, 8, 13, 13, 13, 1, 36, 28, 28, - 1, 30, 28, 24, 24, 82, 78, 50, 14, 54, - 50, 38, 3, 82, 44, 28, 1, 30, 28, 24, - 42, 28, 60, 42, 42, 28, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 8, 13, 1, 36, 28, 28, 1, 30, + 28, 24, 24, 82, 78, 50, 14, 54, 50, 38, + 3, 82, 44, 28, 1, 30, 28, 24, 42, 28, + 60, 42, 42, 28, }, { @@ -3387,12 +3115,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 6, 42, 6, 13, 50, 14, 1, 42, 6, 13, 50, 14, 1, 42, 6, 13, 50, 14, 1, 21, 14, 18, 18, 38, 54, 38, 54, 26, 46, 6, - 13, 46, 6, 13, 13, 13, 1, 34, 26, 26, - 1, 30, 26, 22, 22, 82, 78, 50, 14, 54, - 50, 38, 5, 78, 42, 26, 1, 30, 26, 22, - 42, 26, 62, 42, 42, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - + 13, 46, 6, 13, 1, 34, 26, 26, 1, 30, + 26, 22, 22, 82, 78, 50, 14, 54, 50, 38, + 5, 78, 42, 26, 1, 30, 26, 22, 42, 26, + 62, 42, 42, 26, }, { @@ -3410,12 +3136,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 8, 42, 6, 11, 52, 14, 1, 42, 6, 11, 52, 14, 1, 42, 6, 11, 52, 14, 1, 21, 14, 20, 20, 40, 56, 40, 56, 26, 46, 6, - 11, 46, 6, 11, 11, 11, 1, 34, 26, 26, - 1, 30, 26, 22, 22, 84, 78, 52, 14, 56, - 52, 40, 5, 76, 42, 26, 1, 30, 26, 22, - 44, 26, 66, 44, 44, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 6, 11, 1, 34, 26, 26, 1, 30, + 26, 22, 22, 84, 78, 52, 14, 56, 52, 40, + 5, 76, 42, 26, 1, 30, 26, 22, 44, 26, + 66, 44, 44, 26, }, { @@ -3433,12 +3157,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 10, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 21, 14, 20, 20, 42, 58, 42, 58, 26, 46, 4, - 11, 46, 4, 11, 11, 11, 1, 32, 26, 26, - 1, 30, 26, 20, 20, 84, 78, 52, 14, 58, - 52, 42, 5, 74, 42, 26, 1, 30, 26, 20, - 46, 26, 68, 46, 46, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 4, 11, 1, 32, 26, 26, 1, 30, + 26, 20, 20, 84, 78, 52, 14, 58, 52, 42, + 5, 74, 42, 26, 1, 30, 26, 20, 46, 26, + 68, 46, 46, 26, }, { @@ -3456,12 +3178,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 10, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 42, 4, 11, 52, 14, 1, 21, 14, 20, 20, 42, 58, 42, 58, 26, 46, 4, - 11, 46, 4, 11, 11, 11, 1, 30, 26, 26, - 1, 30, 26, 20, 20, 84, 78, 52, 14, 58, - 52, 42, 5, 72, 42, 26, 1, 30, 26, 20, - 48, 26, 70, 48, 48, 26, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, - + 11, 46, 4, 11, 1, 30, 26, 26, 1, 30, + 26, 20, 20, 84, 78, 52, 14, 58, 52, 42, + 5, 72, 42, 26, 1, 30, 26, 20, 48, 26, + 70, 48, 48, 26, }, { @@ -3479,12 +3199,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 12, 40, 2, 9, 54, 14, 1, 40, 2, 9, 54, 14, 1, 40, 2, 9, 54, 14, 1, 23, 14, 22, 22, 44, 60, 44, 60, 24, 46, 2, - 9, 46, 2, 9, 9, 9, 1, 28, 24, 24, - 1, 30, 24, 18, 18, 86, 78, 54, 14, 60, - 54, 44, 7, 68, 40, 24, 1, 30, 24, 18, - 50, 24, 72, 50, 50, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 2, 9, 1, 28, 24, 24, 1, 30, + 24, 18, 18, 86, 78, 54, 14, 60, 54, 44, + 7, 68, 40, 24, 1, 30, 24, 18, 50, 24, + 72, 50, 50, 24, }, { @@ -3502,12 +3220,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 23, 14, 22, 22, 46, 62, 46, 62, 24, 46, 0, - 9, 46, 0, 9, 9, 9, 1, 26, 24, 24, - 1, 30, 24, 16, 16, 86, 78, 54, 14, 62, - 54, 46, 7, 66, 40, 24, 1, 30, 24, 16, - 52, 24, 76, 52, 52, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 0, 9, 1, 26, 24, 24, 1, 30, + 24, 16, 16, 86, 78, 54, 14, 62, 54, 46, + 7, 66, 40, 24, 1, 30, 24, 16, 52, 24, + 76, 52, 52, 24, }, { @@ -3525,12 +3241,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 14, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 40, 0, 9, 54, 14, 1, 23, 14, 22, 22, 46, 62, 46, 62, 24, 46, 0, - 9, 46, 0, 9, 9, 9, 1, 24, 24, 24, - 1, 30, 24, 16, 16, 86, 78, 54, 14, 62, - 54, 46, 7, 64, 40, 24, 1, 30, 24, 16, - 54, 24, 78, 54, 54, 24, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 6, 6, 6, - + 9, 46, 0, 9, 1, 24, 24, 24, 1, 30, + 24, 16, 16, 86, 78, 54, 14, 62, 54, 46, + 7, 64, 40, 24, 1, 30, 24, 16, 54, 24, + 78, 54, 54, 24, }, { @@ -3548,12 +3262,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 16, 38, 1, 7, 56, 14, 1, 38, 1, 7, 56, 14, 1, 38, 1, 7, 56, 14, 1, 25, 14, 24, 24, 48, 64, 48, 64, 22, 46, 1, - 7, 46, 1, 7, 7, 7, 1, 22, 22, 22, - 1, 30, 22, 14, 14, 88, 78, 56, 14, 64, - 56, 48, 9, 62, 38, 22, 1, 30, 22, 14, - 56, 22, 80, 56, 56, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 1, 7, 1, 22, 22, 22, 1, 30, + 22, 14, 14, 88, 78, 56, 14, 64, 56, 48, + 9, 62, 38, 22, 1, 30, 22, 14, 56, 22, + 80, 56, 56, 22, }, { @@ -3571,12 +3283,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 16, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 25, 14, 24, 24, 48, 64, 48, 64, 22, 46, 3, - 7, 46, 3, 7, 7, 7, 1, 20, 22, 22, - 1, 30, 22, 12, 12, 88, 78, 56, 14, 64, - 56, 48, 9, 58, 38, 22, 1, 30, 22, 12, - 58, 22, 82, 58, 58, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 3, 7, 1, 20, 22, 22, 1, 30, + 22, 12, 12, 88, 78, 56, 14, 64, 56, 48, + 9, 58, 38, 22, 1, 30, 22, 12, 58, 22, + 82, 58, 58, 22, }, { @@ -3594,12 +3304,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 18, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 38, 3, 7, 56, 14, 1, 25, 14, 24, 24, 50, 66, 50, 66, 22, 46, 3, - 7, 46, 3, 7, 7, 7, 1, 18, 22, 22, - 1, 30, 22, 12, 12, 88, 78, 56, 14, 66, - 56, 50, 9, 56, 38, 22, 1, 30, 22, 12, - 60, 22, 86, 60, 60, 22, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 8, 8, 8, 8, - + 7, 46, 3, 7, 1, 18, 22, 22, 1, 30, + 22, 12, 12, 88, 78, 56, 14, 66, 56, 50, + 9, 56, 38, 22, 1, 30, 22, 12, 60, 22, + 86, 60, 60, 22, }, { @@ -3617,12 +3325,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 20, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 27, 14, 26, 26, 52, 68, 52, 68, 20, 46, 5, - 5, 46, 5, 5, 5, 5, 1, 16, 20, 20, - 1, 30, 20, 10, 10, 90, 78, 58, 14, 68, - 58, 52, 11, 54, 36, 20, 1, 30, 20, 10, - 62, 20, 88, 62, 62, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 5, 5, 1, 16, 20, 20, 1, 30, + 20, 10, 10, 90, 78, 58, 14, 68, 58, 52, + 11, 54, 36, 20, 1, 30, 20, 10, 62, 20, + 88, 62, 62, 20, }, { @@ -3640,12 +3346,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 20, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 36, 5, 5, 58, 14, 1, 27, 14, 26, 26, 52, 68, 52, 68, 20, 46, 5, - 5, 46, 5, 5, 5, 5, 1, 14, 20, 20, - 1, 30, 20, 10, 10, 90, 78, 58, 14, 68, - 58, 52, 11, 52, 36, 20, 1, 30, 20, 10, - 64, 20, 90, 64, 64, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 5, 5, 1, 14, 20, 20, 1, 30, + 20, 10, 10, 90, 78, 58, 14, 68, 58, 52, + 11, 52, 36, 20, 1, 30, 20, 10, 64, 20, + 90, 64, 64, 20, }, { @@ -3663,12 +3367,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 22, 36, 7, 5, 58, 14, 1, 36, 7, 5, 58, 14, 1, 36, 7, 5, 58, 14, 1, 27, 14, 26, 26, 54, 70, 54, 70, 20, 46, 7, - 5, 46, 7, 5, 5, 5, 1, 12, 20, 20, - 1, 30, 20, 8, 8, 90, 78, 58, 14, 70, - 58, 54, 11, 48, 36, 20, 1, 30, 20, 8, - 66, 20, 92, 66, 66, 20, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, - + 5, 46, 7, 5, 1, 12, 20, 20, 1, 30, + 20, 8, 8, 90, 78, 58, 14, 70, 58, 54, + 11, 48, 36, 20, 1, 30, 20, 8, 66, 20, + 92, 66, 66, 20, }, { @@ -3686,12 +3388,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 24, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 29, 14, 28, 28, 56, 72, 56, 72, 18, 46, 9, - 3, 46, 9, 3, 3, 3, 1, 10, 18, 18, - 1, 30, 18, 6, 6, 92, 78, 60, 14, 72, - 60, 56, 13, 46, 34, 18, 1, 30, 18, 6, - 68, 18, 96, 68, 68, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 9, 3, 1, 10, 18, 18, 1, 30, + 18, 6, 6, 92, 78, 60, 14, 72, 60, 56, + 13, 46, 34, 18, 1, 30, 18, 6, 68, 18, + 96, 68, 68, 18, }, { @@ -3709,12 +3409,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 24, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 34, 9, 3, 60, 14, 1, 29, 14, 28, 28, 56, 72, 56, 72, 18, 46, 9, - 3, 46, 9, 3, 3, 3, 1, 8, 18, 18, - 1, 30, 18, 6, 6, 92, 78, 60, 14, 72, - 60, 56, 13, 44, 34, 18, 1, 30, 18, 6, - 70, 18, 98, 70, 70, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 9, 3, 1, 8, 18, 18, 1, 30, + 18, 6, 6, 92, 78, 60, 14, 72, 60, 56, + 13, 44, 34, 18, 1, 30, 18, 6, 70, 18, + 98, 70, 70, 18, }, { @@ -3732,12 +3430,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 26, 34, 11, 3, 60, 14, 1, 34, 11, 3, 60, 14, 1, 34, 11, 3, 60, 14, 1, 29, 14, 28, 28, 58, 74, 58, 74, 18, 46, 11, - 3, 46, 11, 3, 3, 3, 1, 6, 18, 18, - 1, 30, 18, 4, 4, 92, 78, 60, 14, 74, - 60, 58, 13, 42, 34, 18, 1, 30, 18, 4, - 72, 18, 100, 72, 72, 18, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 11, 3, 1, 6, 18, 18, 1, 30, + 18, 4, 4, 92, 78, 60, 14, 74, 60, 58, + 13, 42, 34, 18, 1, 30, 18, 4, 72, 18, + 100, 72, 72, 18, }, { @@ -3755,12 +3451,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 26, 32, 13, 3, 60, 14, 1, 32, 13, 3, 60, 14, 1, 32, 13, 3, 60, 14, 1, 31, 14, 28, 28, 58, 74, 58, 74, 16, 46, 13, - 3, 46, 13, 3, 3, 3, 1, 4, 16, 16, - 1, 30, 16, 2, 2, 92, 78, 60, 14, 74, - 60, 58, 15, 38, 32, 16, 1, 30, 16, 2, - 72, 16, 102, 72, 72, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 12, 12, 12, 12, - + 3, 46, 13, 3, 1, 4, 16, 16, 1, 30, + 16, 2, 2, 92, 78, 60, 14, 74, 60, 58, + 15, 38, 32, 16, 1, 30, 16, 2, 72, 16, + 102, 72, 72, 16, }, { @@ -3778,12 +3472,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 28, 32, 13, 1, 62, 14, 1, 32, 13, 1, 62, 14, 1, 32, 13, 1, 62, 14, 1, 31, 14, 30, 30, 60, 76, 60, 76, 16, 46, 13, - 1, 46, 13, 1, 1, 1, 1, 4, 16, 16, - 1, 30, 16, 2, 2, 94, 78, 62, 14, 76, - 62, 60, 15, 36, 32, 16, 1, 30, 16, 2, - 74, 16, 106, 74, 74, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 13, 1, 1, 4, 16, 16, 1, 30, + 16, 2, 2, 94, 78, 62, 14, 76, 62, 60, + 15, 36, 32, 16, 1, 30, 16, 2, 74, 16, + 106, 74, 74, 16, }, { @@ -3801,12 +3493,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 30, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 31, 14, 30, 30, 62, 78, 62, 78, 16, 46, 15, - 1, 46, 15, 1, 1, 1, 1, 2, 16, 16, - 1, 30, 16, 0, 0, 94, 78, 62, 14, 78, - 62, 62, 15, 34, 32, 16, 1, 30, 16, 0, - 76, 16, 108, 76, 76, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 15, 1, 1, 2, 16, 16, 1, 30, + 16, 0, 0, 94, 78, 62, 14, 78, 62, 62, + 15, 34, 32, 16, 1, 30, 16, 0, 76, 16, + 108, 76, 76, 16, }, { @@ -3824,14 +3514,10 @@ const UWORD8 gau1_ihevc_cab_ctxts[IHEVC_NUM_CAB_IDC][IHEVC_MAX_QP][IHEVC_CAB_CTX 30, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 32, 15, 1, 62, 14, 1, 31, 14, 30, 30, 62, 78, 62, 78, 16, 46, 15, - 1, 46, 15, 1, 1, 1, 1, 0, 16, 16, - 1, 30, 16, 0, 0, 94, 78, 62, 14, 78, - 62, 62, 15, 32, 32, 16, 1, 30, 16, 0, - 78, 16, 110, 78, 78, 16, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 14, 14, 14, 14, - + 1, 46, 15, 1, 1, 0, 16, 16, 1, 30, + 16, 0, 0, 94, 78, 62, 14, 78, 62, 62, + 15, 32, 32, 16, 1, 30, 16, 0, 78, 16, + 110, 78, 78, 16, }, - }, - }; diff --git a/common/ihevc_cabac_tables.h b/common/ihevc_cabac_tables.h index 7feac7a..9ed1a2c 100644 --- a/common/ihevc_cabac_tables.h +++ b/common/ihevc_cabac_tables.h @@ -92,13 +92,9 @@ typedef enum IHEVC_CAB_COEFFY_PREFIX = IHEVC_CAB_COEFFX_PREFIX + 18, IHEVC_CAB_CODED_SUBLK_IDX = IHEVC_CAB_COEFFY_PREFIX + 18, IHEVC_CAB_COEFF_FLAG = IHEVC_CAB_CODED_SUBLK_IDX + 4, - IHEVC_CAB_COEFABS_GRTR1_FLAG = IHEVC_CAB_COEFF_FLAG + 44, + IHEVC_CAB_COEFABS_GRTR1_FLAG = IHEVC_CAB_COEFF_FLAG + 42, IHEVC_CAB_COEFABS_GRTR2_FLAG = IHEVC_CAB_COEFABS_GRTR1_FLAG + 24, - IHEVC_CAB_CCP_LOG2_RES_ABS = IHEVC_CAB_COEFABS_GRTR2_FLAG + 6, - IHEVC_CAB_CCP_RES_SIGN_FLAG = IHEVC_CAB_CCP_LOG2_RES_ABS + 8, - IHEVC_CAB_EXPLICIT_RDPCM_FLAG = IHEVC_CAB_CCP_RES_SIGN_FLAG + 2, - IHEVC_CAB_EXPLICIT_RDPCM_DIR = IHEVC_CAB_EXPLICIT_RDPCM_FLAG + 2, - IHEVC_CAB_CTXT_END = IHEVC_CAB_EXPLICIT_RDPCM_DIR + 2, + IHEVC_CAB_CTXT_END = IHEVC_CAB_COEFABS_GRTR2_FLAG + 6 }IHEVC_CABAC_CTXT_OFFSETS; diff --git a/common/ihevc_chroma_intra_pred.h b/common/ihevc_chroma_intra_pred.h index 8ffa888..c4ca13b 100644 --- a/common/ihevc_chroma_intra_pred.h +++ b/common/ihevc_chroma_intra_pred.h @@ -126,14 +126,7 @@ typedef void ihevc_intra_pred_chroma_ref_substitution_ft(UWORD8 *pu1_top_left, WORD32 nt, WORD32 nbr_flags, UWORD8 *pu1_dst, - WORD32 dst_strd, - WORD32 chroma_format_idc); - -typedef void ihevc_intra_pred_chroma_ref_filtering_ft(UWORD8 *pu1_src, - WORD32 nt, - UWORD8 *pu1_dst, - WORD32 mode, - WORD32 intra_smoothing_flags); + WORD32 dst_strd); typedef void ihevc_hbd_intra_pred_chroma_planar_ft( UWORD16 *pu2_ref, @@ -247,7 +240,6 @@ ihevc_intra_pred_chroma_mode_11_to_17_ft ihevc_intra_pred_chroma_mode_11_to_17; ihevc_intra_pred_chroma_mode_19_to_25_ft ihevc_intra_pred_chroma_mode_19_to_25; ihevc_intra_pred_chroma_mode_27_to_33_ft ihevc_intra_pred_chroma_mode_27_to_33; ihevc_intra_pred_chroma_ref_substitution_ft ihevc_intra_pred_chroma_ref_substitution; -ihevc_intra_pred_chroma_ref_filtering_ft ihevc_intra_pred_chroma_ref_filtering; ihevc_hbd_intra_pred_chroma_planar_ft ihevc_hbd_intra_pred_chroma_planar; ihevc_hbd_intra_pred_chroma_dc_ft ihevc_hbd_intra_pred_chroma_dc; diff --git a/common/ihevc_chroma_intra_pred_filters.c b/common/ihevc_chroma_intra_pred_filters.c index 8df5115..fe14d8a 100644 --- a/common/ihevc_chroma_intra_pred_filters.c +++ b/common/ihevc_chroma_intra_pred_filters.c @@ -64,7 +64,6 @@ #include "ihevc_typedefs.h" #include "ihevc_macros.h" -#include "ihevc_defs.h" #include "ihevc_func_selector.h" #include "ihevc_platform_macros.h" #include "ihevc_intra_pred.h" @@ -130,8 +129,7 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, WORD32 nt, WORD32 nbr_flags, UWORD8 *pu1_dst, - WORD32 dst_strd, - WORD32 chroma_format_idc) + WORD32 dst_strd) { UWORD8 pu1_ref_u, pu1_ref_v; WORD32 dc_val, i, j; @@ -208,7 +206,7 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, // U-V interleaved Top-top right samples } - if(nt == 4 || (nt == 8 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + if(nt == 4) { /* 1 bit extraction for all the neighboring blocks */ tp_left = (nbr_flags & 0x10000) >> 16; @@ -276,9 +274,8 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, } } - else if(nt == 8 || (nt == 16 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + else if(nt == 8) { - WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1; WORD32 nbr_flags_temp = 0; nbr_flags_temp = ((nbr_flags & 0xC) >> 2) + ((nbr_flags & 0xC0) >> 4) + ((nbr_flags & 0x300) >> 4) @@ -288,16 +285,16 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, /* compute trailing zeors based on nbr_flag for substitution process of below left see section .*/ /* as each bit in nbr flags corresponds to 8 pels for bot_left, left, top and topright but 1 pel for topleft */ { - nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * (4 * sub_sample); /* for bottom left and left */ - if(nbr_id_from_bl == 32 * sub_sample) - nbr_id_from_bl = 16 * sub_sample; - if(nbr_id_from_bl == 16 * sub_sample) + nbr_id_from_bl = look_up_trailing_zeros(nbr_flags_temp & 0XF) * 4; /* for bottom left and left */ + if(nbr_id_from_bl == 32) + nbr_id_from_bl = 16; + if(nbr_id_from_bl == 16) { /* for top left : 1 pel per nbr bit */ if(!((nbr_flags_temp >> 8) & 0x1)) { nbr_id_from_bl++; - nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4 * sub_sample; /* top and top right; 8 pels per nbr bit */ + nbr_id_from_bl += look_up_trailing_zeros((nbr_flags_temp >> 4) & 0xF) * 4; /* top and top right; 8 pels per nbr bit */ } } @@ -316,14 +313,14 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, } /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */ - while(nbr_id_from_bl < ((T8C_4NT * sub_sample)+1)) + while(nbr_id_from_bl < ((T8C_4NT)+1)) { /* To Obtain the next unavailable idx flag after reverse neighbor substitution */ /* Divide by 8 to obtain the original index */ - frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/ + frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/ /* The Top-left flag is at the last bit location of nbr_flags*/ - if(nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) + if(nbr_id_from_bl == (T8C_4NT / 2)) { get_bits = GET_BIT(nbr_flags_temp, 8); @@ -342,23 +339,22 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, UWORD16 *pu2_dst; /* 8 pel substitution (other than TL) */ pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2]; - ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample); + ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4); } } - nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample; + nbr_id_from_bl += (nbr_id_from_bl == (T8C_4NT / 2)) ? 1 : 4; } } - else if(nt == 16 || (nt == 32 && chroma_format_idc == CHROMA_FMT_IDC_YUV444)) + else if(nt == 16) { - WORD32 sub_sample = chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 2 : 1; /* compute trailing ones based on mbr_flag for substitution process of below left see section .*/ /* as each bit in nbr flags corresponds to 4 pels for bot_left, left, top and topright but 1 pel for topleft */ { - nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4 * sub_sample; /* for bottom left and left */ + nbr_id_from_bl = look_up_trailing_zeros((nbr_flags & 0XFF)) * 4; /* for bottom left and left */ - if(nbr_id_from_bl == 32 * sub_sample) + if(nbr_id_from_bl == 32) { /* for top left : 1 pel per nbr bit */ if(!((nbr_flags >> 16) & 0x1)) @@ -366,7 +362,7 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, /* top left not available */ nbr_id_from_bl++; /* top and top right; 4 pels per nbr bit */ - nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4 * sub_sample; + nbr_id_from_bl += look_up_trailing_zeros((nbr_flags >> 8) & 0xFF) * 4; } } /* Reverse Substitution Process*/ @@ -384,14 +380,14 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, } /* for the loop of 4*Nt+1 pixels (excluding pixels computed from reverse substitution) */ - while(nbr_id_from_bl < ((T16C_4NT * sub_sample)+1)) + while(nbr_id_from_bl < ((T16C_4NT)+1)) { /* To Obtain the next unavailable idx flag after reverse neighbor substitution */ /* Devide by 4 to obtain the original index */ - frwd_nbr_flag = (nbr_id_from_bl >> (chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 3 : 2)); /*+ (nbr_id_from_bl & 0x1);*/ + frwd_nbr_flag = (nbr_id_from_bl >> 2); /*+ (nbr_id_from_bl & 0x1);*/ /* The Top-left flag is at the last bit location of nbr_flags*/ - if(nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) + if(nbr_id_from_bl == (T16C_4NT / 2)) { get_bits = GET_BIT(nbr_flags, 16); /* only pel substitution for TL */ @@ -409,110 +405,17 @@ void ihevc_intra_pred_chroma_ref_substitution(UWORD8 *pu1_top_left, UWORD16 *pu2_dst; /* 4 pel substitution (other than TL) */ pu2_dst = (UWORD16 *)&pu1_dst[(2 * nbr_id_from_bl) - 2]; - ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4 * sub_sample); + ihevc_memset_16bit((UWORD16 *)(pu1_dst + (2 * nbr_id_from_bl)), pu2_dst[0], 4); } } - nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT * sub_sample / 2)) ? 1 : 4 * sub_sample; + nbr_id_from_bl += (nbr_id_from_bl == (T16C_4NT / 2)) ? 1 : 4; } } } } -/** -******************************************************************************* -* -* @brief -* Intra prediction interpolation filter for chroma ref_filtering (4:4:4) -* -* -* @par Description: -* Reference DC filtering for neighboring chroma samples dependent on TU size and -* mode Refer to section 8.4.4.2.3 in the standard -* -* @param[in] pu1_src -* UWORD8 pointer to the source -* -* @param[out] pu1_dst -* UWORD8 pointer to the destination -* -* @param[in] nt -* integer Transform Block size -* -* @param[in] mode -* integer intraprediction mode -* -* @param[in] strong_intra_smoothing_enable_flag -* integer containing intra_smoothing_disabled_flag and strong_smoothing_enable_flag -* -* @returns -* -* @remarks -* None -* -******************************************************************************* -*/ - -void ihevc_intra_pred_chroma_ref_filtering(UWORD8 *pu1_src, - WORD32 nt, - UWORD8 *pu1_dst, - WORD32 mode, - WORD32 intra_smoothing_flag) -{ - WORD32 filter_flag; - WORD32 i; /* Generic indexing variable */ - WORD32 four_nt = 4 * nt; - UWORD8 au1_flt[((4 * MAX_CU_SIZE) + 1) * 2]; - WORD32 intra_smoothing_disabled_flag = (intra_smoothing_flag >> 3) & 0x1; - WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flag & 0x1; - UNUSED(strong_intra_smoothing_enable_flag); - - if(intra_smoothing_disabled_flag) - { - if(pu1_src == pu1_dst) return; - for(i = 0; i < (2 * (four_nt + 1)); i += 2) - { - pu1_dst[i] = pu1_src[i]; - pu1_dst[i + 1] = pu1_src[i + 1]; - } - return; - } - - filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)); - if(0 == filter_flag) - { - if(pu1_src == pu1_dst) return; - for(i = 0; i < (2 * (four_nt + 1)); i += 2) - { - pu1_dst[i] = pu1_src[i]; - pu1_dst[i + 1] = pu1_src[i + 1]; - } - } - else - { - /* Extremities Untouched*/ - au1_flt[0] = pu1_src[0]; - au1_flt[1] = pu1_src[1]; - au1_flt[four_nt * 2] = pu1_src[four_nt * 2]; - au1_flt[(four_nt * 2) + 1] = pu1_src[(four_nt * 2) + 1]; - - for(i = 2; i < four_nt * 2; i += 2) - { - au1_flt[i] = (pu1_src[i - 2] + 2 * pu1_src[i] + pu1_src[i + 2] + 2) >> 2; - au1_flt[i + 1] = (pu1_src[i - 1] + 2 * pu1_src[i + 1] + pu1_src[i + 3] + 2) >> 2; - } - - for(i = 0; i < (2 * (four_nt + 1)); i += 2) - { - pu1_dst[i] = au1_flt[i]; - pu1_dst[i + 1] = au1_flt[i + 1]; - } - } -} - - - /** ******************************************************************************* * diff --git a/common/ihevc_chroma_itrans_recon.h b/common/ihevc_chroma_itrans_recon.h index cbb2c7a..7d4958b 100644 --- a/common/ihevc_chroma_itrans_recon.h +++ b/common/ihevc_chroma_itrans_recon.h @@ -94,15 +94,6 @@ typedef void ihevc_hbd_chroma_itrans_recon_16x16_ft(WORD16 *pi2_src, WORD32 zero_cols, WORD32 zero_rows, UWORD8 bit_depth); -typedef void ihevc_chroma_itrans_recon_32x32_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 src_strd, - WORD32 pred_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); ihevc_chroma_itrans_recon_4x4_ft ihevc_chroma_itrans_recon_4x4; ihevc_hbd_chroma_itrans_recon_4x4_ft ihevc_hbd_chroma_itrans_recon_4x4; @@ -110,7 +101,6 @@ ihevc_chroma_itrans_recon_8x8_ft ihevc_chroma_itrans_recon_8x8; ihevc_hbd_chroma_itrans_recon_8x8_ft ihevc_hbd_chroma_itrans_recon_8x8; ihevc_chroma_itrans_recon_16x16_ft ihevc_chroma_itrans_recon_16x16; ihevc_hbd_chroma_itrans_recon_16x16_ft ihevc_hbd_chroma_itrans_recon_16x16; -ihevc_chroma_itrans_recon_32x32_ft ihevc_chroma_itrans_recon_32x32; /* A9 Q Function Declarations */ ihevc_chroma_itrans_recon_4x4_ft ihevc_chroma_itrans_recon_4x4_a9q; diff --git a/common/ihevc_chroma_itrans_recon_32x32.c b/common/ihevc_chroma_itrans_recon_32x32.c deleted file mode 100644 index ef28452..0000000 --- a/common/ihevc_chroma_itrans_recon_32x32.c +++ /dev/null @@ -1,1135 +0,0 @@ -/****************************************************************************** -* -* Copyright (C) 2025 Ittiam Systems Pvt Ltd, Bangalore -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at: -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -******************************************************************************/ -/** - ******************************************************************************* - * @file - * ihevc_chroma_itrans_recon_32x32.c - * - * @brief - * Contains function definitions for 32x32 inverse transform and reconstruction - * of chroma interleaved data. - * - * @author - * 100927 - * - * @par List of Functions: - * - ihevc_chroma_itrans_recon_32x32() - * - * @remarks - * None - * - ******************************************************************************* - */ - -#include -#include -#include "ihevc_typedefs.h" -#include "ihevc_macros.h" -#include "ihevc_platform_macros.h" -#include "ihevc_defs.h" -#include "ihevc_trans_tables.h" -#include "ihevc_chroma_itrans_recon.h" -#include "ihevc_func_selector.h" -#include "ihevc_trans_macros.h" - -/* All the functions work one component(U or V) of interleaved data depending upon pointers passed to it */ -/* Data visualization */ -/* U V U V U V U V */ -/* U V U V U V U V */ -/* U V U V U V U V */ -/* U V U V U V U V */ -/* If the pointer points to first byte of above stream (U) , functions will operate on U component */ -/* If the pointer points to second byte of above stream (V) , functions will operate on V component */ - - -/** - ******************************************************************************* - * - * @brief - * This function performs Inverse transform and reconstruction for 32x32 - * input block - * - * @par Description: - * Performs inverse transform and adds the prediction data and clips output - * to 8 bit - * - * @param[in] pi2_src - * Input 32x32 coefficients - * - * @param[in] pi2_tmp - * Temporary 32x32 buffer for storing inverse transform - * 1st stage output - * - * @param[in] pu1_pred - * Prediction 32x32 block - * - * @param[out] pu1_dst - * Output 32x32 block - * - * @param[in] src_strd - * Input stride - * - * @param[in] pred_strd - * Prediction stride - * - * @param[in] dst_strd - * Output Stride - * - * @param[in] shift - * Output shift - * - * @param[in] zero_cols - * Zero columns in pi2_src - * - * @returns Void - * - * @remarks - * None - * - ******************************************************************************* - */ - - -void ihevc_chroma_itrans_recon_32x32(WORD16 *pi2_src, - WORD16 *pi2_tmp, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 src_strd, - WORD32 pred_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) -{ - WORD32 j, k; - WORD32 e[16], o[16]; - WORD32 ee[8], eo[8]; - WORD32 eee[4], eeo[4]; - WORD32 eeee[2], eeeo[2]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - WORD32 row_limit_2nd_stage, zero_rows_2nd_stage = zero_cols; - - trans_size = TRANS_SIZE_32; - pi2_tmp_orig = pi2_tmp; - - if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0) - row_limit_2nd_stage = 4; - else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00) - row_limit_2nd_stage = 8; - else - row_limit_2nd_stage = TRANS_SIZE_32; - - if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } - else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_32[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_32[7][k] - * pi2_src[7 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_32[6][k] - * pi2_src[6 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } - else /* All rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_32[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_32[7][k] - * pi2_src[7 * src_strd] - + g_ai2_ihevc_trans_32[9][k] - * pi2_src[9 * src_strd] - + g_ai2_ihevc_trans_32[11][k] - * pi2_src[11 * src_strd] - + g_ai2_ihevc_trans_32[13][k] - * pi2_src[13 * src_strd] - + g_ai2_ihevc_trans_32[15][k] - * pi2_src[15 * src_strd] - + g_ai2_ihevc_trans_32[17][k] - * pi2_src[17 * src_strd] - + g_ai2_ihevc_trans_32[19][k] - * pi2_src[19 * src_strd] - + g_ai2_ihevc_trans_32[21][k] - * pi2_src[21 * src_strd] - + g_ai2_ihevc_trans_32[23][k] - * pi2_src[23 * src_strd] - + g_ai2_ihevc_trans_32[25][k] - * pi2_src[25 * src_strd] - + g_ai2_ihevc_trans_32[27][k] - * pi2_src[27 * src_strd] - + g_ai2_ihevc_trans_32[29][k] - * pi2_src[29 * src_strd] - + g_ai2_ihevc_trans_32[31][k] - * pi2_src[31 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_32[6][k] - * pi2_src[6 * src_strd] - + g_ai2_ihevc_trans_32[10][k] - * pi2_src[10 * src_strd] - + g_ai2_ihevc_trans_32[14][k] - * pi2_src[14 * src_strd] - + g_ai2_ihevc_trans_32[18][k] - * pi2_src[18 * src_strd] - + g_ai2_ihevc_trans_32[22][k] - * pi2_src[22 * src_strd] - + g_ai2_ihevc_trans_32[26][k] - * pi2_src[26 * src_strd] - + g_ai2_ihevc_trans_32[30][k] - * pi2_src[30 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd] - + g_ai2_ihevc_trans_32[12][k] - * pi2_src[12 * src_strd] - + g_ai2_ihevc_trans_32[20][k] - * pi2_src[20 * src_strd] - + g_ai2_ihevc_trans_32[28][k] - * pi2_src[28 * src_strd]; - } - eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd] - + g_ai2_ihevc_trans_32[24][0] - * pi2_src[24 * src_strd]; - eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd] - + g_ai2_ihevc_trans_32[24][1] - * pi2_src[24 * src_strd]; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_src[16 * src_strd]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_src[16 * src_strd]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - WORD32 itrans_out; - itrans_out = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pu1_dst[k * 2] = CLIP_U8((itrans_out + pu1_pred[k * 2])); - itrans_out = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - pu1_dst[(k + 16) * 2] = CLIP_U8((itrans_out + pu1_pred[(k + 16) * 2])); - } - pi2_tmp++; - pu1_pred += pred_strd; - pu1_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } -} - diff --git a/common/ihevc_chroma_recon.c b/common/ihevc_chroma_recon.c index d78a476..4a1e9ee 100644 --- a/common/ihevc_chroma_recon.c +++ b/common/ihevc_chroma_recon.c @@ -306,157 +306,3 @@ void ihevc_chroma_recon_16x16(WORD16 *pi2_src, } } -/** - ******************************************************************************* - * - * @brief - * This function performs reconstruction for 32x32 input block - * - * @par Description: - * Performs reconstruction of 32x32 input block by adding adding prediction - * data to input and clipping it to 8 bit - * - * @param[in] pi2_src - * Input 32x32 coefficients - * - * @param[in] pu1_pred - * Prediction 32x32 block - * - * @param[out] pu1_dst - * Output 32x32 block - * - * @param[in] src_strd - * Input stride - * - * @param[in] pred_strd - * Prediction stride - * - * @param[in] dst_strd - * Output Stride - * - * @param[in] shift - * Output shift - * - * @param[in] zero_cols - * Zero columns in pi2_tmp - * - * @returns Void - * - * @remarks - * None - * - ******************************************************************************* - */ - - -void ihevc_chroma_recon_32x32(WORD16 *pi2_src, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 src_strd, - WORD32 pred_strd, - WORD32 dst_strd, - WORD32 zero_cols) -{ - WORD32 i, j; - WORD32 trans_size; - - trans_size = TRANS_SIZE_32; - - /* Reconstruction */ - - for(i = 0; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pu1_dst[j * dst_strd] = pu1_pred[j * pred_strd]; - } - } - else - { - for(j = 0; j < trans_size; j++) - { - pu1_dst[j * dst_strd] = - CLIP_U8(pi2_src[j * src_strd] + pu1_pred[j * pred_strd]); - } - } - pi2_src++; - pu1_dst += 2; - pu1_pred += 2; - zero_cols = zero_cols >> 1; - } -} - -/** - ****************************************************************************** - * - * @brief Constructs chroma recon with Cross Component Prediction (CCP) - * - * @par Description - * This routine uses reconstructed luma residual samples to predict chroma - * residual samples as per HEVC Specification Section 8.6.6. It scales the - * luma residual by a signaled alpha value and adds it to the chroma residual - * prior to final reconstruction. - * - * @param[in] pi2_luma_res - * pointer to the luma residual - * - * @param[in] pi2_chroma_res - * pointer to the chroma residual - * - * @param[in] pu1_pred - * prediction block - * - * @param[in] pu1_dst - * destination block - * - * @param[in] alpha - * scaling factor for the luma residual - * - * @param[in] trans_size - * transform size - * - * @param[in] luma_res_stride - * stride of the luma residual buffer - * - * @param[in] chroma_res_stride - * stride of the chroma residual buffer - * - * @param[in] pred_strd - * Prediction stride - * - * @param[in] dst_strd - * Output Stride - * - * @return success or failure error code - * - ****************************************************************************** - */ -void ihevc_chroma_recon_nxn_ccp(WORD16 *pi2_luma_res, - WORD16 *pi2_chroma_res, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 alpha, - WORD32 trans_size, - WORD32 luma_res_stride, - WORD32 chroma_res_stride, - WORD32 pred_stride, - WORD32 dst_stride) -{ - WORD32 i, j; - - for(i = 0; i < trans_size; i++) - { - for(j = 0; j < trans_size; j++) - { - WORD32 res = (alpha * pi2_luma_res[j]) >> 3; - pu1_dst[j * 2] = CLIP_U8(pu1_pred[j * 2] + (pi2_chroma_res[j] + res)); - } - pi2_luma_res += luma_res_stride; - pi2_chroma_res += chroma_res_stride; - pu1_dst += dst_stride; - pu1_pred += pred_stride; - } -} diff --git a/common/ihevc_chroma_recon.h b/common/ihevc_chroma_recon.h index 5363d3c..b4ece06 100644 --- a/common/ihevc_chroma_recon.h +++ b/common/ihevc_chroma_recon.h @@ -88,13 +88,6 @@ typedef void ihevc_hbd_chroma_recon_16x16_ft(WORD16 *pi2_src, WORD32 dst_strd, WORD32 zero_cols, UWORD8 bit_depth); -typedef void ihevc_chroma_recon_32x32_ft(WORD16 *pi2_src, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 src_strd, - WORD32 pred_strd, - WORD32 dst_strd, - WORD32 zero_cols); ihevc_chroma_recon_4x4_ft ihevc_chroma_recon_4x4; ihevc_hbd_chroma_recon_4x4_ft ihevc_hbd_chroma_recon_4x4; @@ -102,17 +95,5 @@ ihevc_chroma_recon_8x8_ft ihevc_chroma_recon_8x8; ihevc_hbd_chroma_recon_8x8_ft ihevc_hbd_chroma_recon_8x8; ihevc_chroma_recon_16x16_ft ihevc_chroma_recon_16x16; ihevc_hbd_chroma_recon_16x16_ft ihevc_hbd_chroma_recon_16x16; -ihevc_chroma_recon_32x32_ft ihevc_chroma_recon_32x32; - -void ihevc_chroma_recon_nxn_ccp(WORD16 *pi2_luma_res, - WORD16 *pi2_chroma_res, - UWORD8 *pu1_pred, - UWORD8 *pu1_dst, - WORD32 alpha, - WORD32 trans_size, - WORD32 luma_res_stride, - WORD32 chroma_res_stride, - WORD32 pred_stride, - WORD32 dst_stride); #endif /*_IHEVC_CHROMA_RECON_H_*/ diff --git a/common/ihevc_defs.h b/common/ihevc_defs.h index d0b11b7..faa3704 100644 --- a/common/ihevc_defs.h +++ b/common/ihevc_defs.h @@ -40,10 +40,7 @@ /*****************************************************************************/ enum { - IHEVC_PROFILE_UNKNOWN = -1, IHEVC_PROFILE_MAIN = 0, - IHEVC_PROFILE_MAIN_STILL = 1, - IHEVC_PROFILE_MAIN_REXT = 2, }; enum diff --git a/common/ihevc_inter_pred.h b/common/ihevc_inter_pred.h index d75d3f3..e84e912 100644 --- a/common/ihevc_inter_pred.h +++ b/common/ihevc_inter_pred.h @@ -46,9 +46,6 @@ #define REF_WIDTH 1280 #define REF_HEIGHT 720 -extern WORD8 gai1_ihevc_luma_filter[4][NTAPS_LUMA]; -extern WORD8 gai1_ihevc_chroma_filter[8][NTAPS_LUMA]; - /*****************************************************************************/ /* Function Declarations */ /*****************************************************************************/ diff --git a/common/ihevc_inter_pred_filters.c b/common/ihevc_inter_pred_filters.c index 75d0ed9..717bb53 100644 --- a/common/ihevc_inter_pred_filters.c +++ b/common/ihevc_inter_pred_filters.c @@ -61,26 +61,6 @@ #include "ihevc_func_selector.h" #include "ihevc_inter_pred.h" - -WORD8 gai1_ihevc_luma_filter[4][NTAPS_LUMA] = -{ - { 0, 0, 0, 64, 0, 0, 0, 0 }, - { -1, 4, -10, 58, 17, -5, 1, 0 }, - { -1, 4, -11, 40, 40, -11, 4, -1 }, - { 0, 1, -5, 17, 58, -10, 4, -1 } }; - -/* The filter uses only the first four elements in each array */ -WORD8 gai1_ihevc_chroma_filter[8][NTAPS_LUMA] = -{ - { 0, 64, 0, 0, 0, 0, 0, 0 }, - { -2, 58, 10, -2, 0, 0, 0, 0 }, - { -4, 54, 16, -2, 0, 0, 0, 0 }, - { -6, 46, 28, -4, 0, 0, 0, 0 }, - { -4, 36, 36, -4, 0, 0, 0, 0 }, - { -4, 28, 46, -6, 0, 0, 0, 0 }, - { -2, 16, 54, -4, 0, 0, 0, 0 }, - { -2, 10, 58, -2, 0, 0, 0, 0 } }; - /*****************************************************************************/ /* Function Definitions */ /*****************************************************************************/ diff --git a/common/ihevc_intra_pred.h b/common/ihevc_intra_pred.h index 6cd285b..c2902ea 100644 --- a/common/ihevc_intra_pred.h +++ b/common/ihevc_intra_pred.h @@ -159,7 +159,7 @@ typedef void ihevc_intra_pred_ref_filtering_ft(UWORD8 *pu1_src, WORD32 nt, UWORD8 *pu1_dst, WORD32 mode, - WORD32 intra_smoothing_flags); + WORD32 strong_intra_smoothing_enable_flag); typedef void ihevc_hbd_intra_pred_luma_planar_ft( UWORD16 *pu2_ref, diff --git a/common/ihevc_intra_pred_filters.c b/common/ihevc_intra_pred_filters.c index 1610385..41e4a1f 100644 --- a/common/ihevc_intra_pred_filters.c +++ b/common/ihevc_intra_pred_filters.c @@ -627,11 +627,6 @@ void ihevc_intra_pred_luma_ref_substitution(UWORD8 *pu1_top_left, * @param[in] mode * integer intraprediction mode * -* @param[in] intra_smoothing_flags -* integer bit 3 indicates if intra smoothing is enabled/disabled -* unconditionally. this is applicable to frext profiles only -* bit 0 indicates strong intra smoothing enabled/disabled -* * @returns * * @remarks @@ -645,7 +640,7 @@ void ihevc_intra_pred_ref_filtering(UWORD8 *pu1_src, WORD32 nt, UWORD8 *pu1_dst, WORD32 mode, - WORD32 intra_smoothing_flags) + WORD32 strong_intra_smoothing_enable_flag) { WORD32 filter_flag; WORD32 i; /* Generic indexing variable */ @@ -656,11 +651,9 @@ void ihevc_intra_pred_ref_filtering(UWORD8 *pu1_src, WORD32 abs_cond_top_flag = 0; /*WORD32 dc_val = 1 << (BIT_DEPTH - 5);*/ WORD32 dc_val = 1 << (8 - 5); - WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3); - WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1; + //WORD32 strong_intra_smoothing_enable_flag = 1; - filter_flag = intra_smoothing_disabled ? - 0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2))); + filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)); if(0 == filter_flag) { if(pu1_src == pu1_dst) @@ -950,8 +943,8 @@ void ihevc_intra_pred_luma_dc(UWORD8 *pu1_ref, * @param[in] nt * integer Transform Block size * -* @param[in] disable_boundary_filter -* disable boundary filtering +* @param[in] mode +* integer intraprediction mode * * @returns * @@ -967,16 +960,17 @@ void ihevc_intra_pred_luma_horz(UWORD8 *pu1_ref, UWORD8 *pu1_dst, WORD32 dst_strd, WORD32 nt, - WORD32 disable_boundary_filter) + WORD32 mode) { WORD32 row, col; WORD32 two_nt; WORD16 s2_predpixel; + UNUSED(mode); UNUSED(src_strd); two_nt = 2 * nt; - if(nt == 32 || disable_boundary_filter) + if(nt == 32) { for(row = 0; row < nt; row++) for(col = 0; col < nt; col++) @@ -1029,8 +1023,8 @@ void ihevc_intra_pred_luma_horz(UWORD8 *pu1_ref, * @param[in] nt * integer Transform Block size * -* @param[in] disable_boundary_filter -* disable boundary filtering +* @param[in] mode +* integer intraprediction mode * * @returns * @@ -1046,14 +1040,15 @@ void ihevc_intra_pred_luma_ver(UWORD8 *pu1_ref, UWORD8 *pu1_dst, WORD32 dst_strd, WORD32 nt, - WORD32 disable_boundary_filter) + WORD32 mode) { WORD32 row, col; WORD16 s2_predpixel; WORD32 two_nt = 2 * nt; + UNUSED(mode); UNUSED(src_strd); - if(nt == 32 || disable_boundary_filter) + if(nt == 32) { /* Replication to next columns*/ for(row = 0; row < nt; row++) diff --git a/common/ihevc_itrans_res.c b/common/ihevc_itrans_res.c deleted file mode 100644 index c10450a..0000000 --- a/common/ihevc_itrans_res.c +++ /dev/null @@ -1,2493 +0,0 @@ -/****************************************************************************** -* -* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at: -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -* -******************************************************************************/ -/** - ******************************************************************************* - * @file - * ihevc_itrans_res.c - * - * @brief - * Contains function definitions for inverse transform - * - * @author - * 100470 - * - * @par List of Functions: - * - ihevc_itrans_res_4x4_ttype1() - * - ihevc_itrans_res_4x4() - * - ihevcd_itrans_res_dc() - * - ihevc_itrans_res_8x8() - * - ihevc_itrans_res_16x16() - * - ihevc_itrans_res_32x32() - * - ihevc_res_4x4_rotate() - * - ihevc_res_nxn_copy() - * - ihevc_res_nxn_rdpcm_horz() - * - ihevc_res_nxn_rdpcm_vert() - * - * @remarks - * None - * - ******************************************************************************* - */ - -#include -#include - -#include "ihevc_typedefs.h" -#include "ihevc_macros.h" -#include "ihevc_platform_macros.h" -#include "ihevc_defs.h" -#include "ihevc_trans_tables.h" -#include "ihevc_func_selector.h" -#include "ihevc_trans_macros.h" -#include "ihevc_itrans_res.h" - - -void ihevc_itrans_res_4x4_ttype1(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) -{ - WORD32 i, c[4]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - UNUSED(zero_rows); - trans_size = TRANS_SIZE_4; - - pi2_tmp_orig = pi2_tmp; - - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(i = 0; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - // Intermediate Variables - c[0] = pi2_src[0] + pi2_src[2 * src_strd]; - c[1] = pi2_src[2 * src_strd] + pi2_src[3 * src_strd]; - c[2] = pi2_src[0] - pi2_src[3 * src_strd]; - c[3] = 74 * pi2_src[src_strd]; - - pi2_tmp[0] = - CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift); - pi2_tmp[1] = - CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift); - pi2_tmp[2] = - CLIP_S16((74 * (pi2_src[0] - pi2_src[2 * src_strd] + pi2_src[3 * src_strd]) + add) >> shift); - pi2_tmp[3] = - CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift); - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - - for(i = 0; i < trans_size; i++) - { - WORD32 itrans_out; - // Intermediate Variables - c[0] = pi2_tmp[0] + pi2_tmp[2 * trans_size]; - c[1] = pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]; - c[2] = pi2_tmp[0] - pi2_tmp[3 * trans_size]; - c[3] = 74 * pi2_tmp[trans_size]; - - pi2_dst[0] = - CLIP_S16((29 * c[0] + 55 * c[1] + c[3] + add) >> shift); - - pi2_dst[1] = - CLIP_S16((55 * c[2] - 29 * c[1] + c[3] + add) >> shift); - - pi2_dst[2] = - CLIP_S16((74 * (pi2_tmp[0] - pi2_tmp[2 * trans_size] + pi2_tmp[3 * trans_size]) + add) >> shift); - - pi2_dst[3] = - CLIP_S16((55 * c[0] + 29 * c[2] - c[3] + add) >> shift); - - pi2_tmp++; - pi2_dst += dst_strd; - } -} - - -void ihevc_itrans_res_4x4(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) - -{ - WORD32 j; - WORD32 e[2], o[2]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - UNUSED(zero_rows); - trans_size = TRANS_SIZE_4; - - pi2_tmp_orig = pi2_tmp; - - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < trans_size; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_src[src_strd] - + g_ai2_ihevc_trans_4[3][0] * pi2_src[3 * src_strd]; - o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_src[src_strd] - + g_ai2_ihevc_trans_4[3][1] * pi2_src[3 * src_strd]; - e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_src[0] - + g_ai2_ihevc_trans_4[2][0] * pi2_src[2 * src_strd]; - e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_src[0] - + g_ai2_ihevc_trans_4[2][1] * pi2_src[2 * src_strd]; - - pi2_tmp[0] = - CLIP_S16(((e[0] + o[0] + add) >> shift)); - pi2_tmp[1] = - CLIP_S16(((e[1] + o[1] + add) >> shift)); - pi2_tmp[2] = - CLIP_S16(((e[1] - o[1] + add) >> shift)); - pi2_tmp[3] = - CLIP_S16(((e[0] - o[0] + add) >> shift)); - - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - - for(j = 0; j < trans_size; j++) - { - WORD32 itrans_out; - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - o[0] = g_ai2_ihevc_trans_4[1][0] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_4[3][0] * pi2_tmp[3 * trans_size]; - o[1] = g_ai2_ihevc_trans_4[1][1] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_4[3][1] * pi2_tmp[3 * trans_size]; - e[0] = g_ai2_ihevc_trans_4[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_4[2][0] * pi2_tmp[2 * trans_size]; - e[1] = g_ai2_ihevc_trans_4[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_4[2][1] * pi2_tmp[2 * trans_size]; - - pi2_dst[0] = - CLIP_S16(((e[0] + o[0] + add) >> shift)); - - pi2_dst[1] = - CLIP_S16(((e[1] + o[1] + add) >> shift)); - - pi2_dst[2] = - CLIP_S16(((e[1] - o[1] + add) >> shift)); - - pi2_dst[3] = - CLIP_S16(((e[0] - o[0] + add) >> shift)); - - pi2_tmp++; - pi2_dst += dst_strd; - - } -} - - -void ihevcd_itrans_res_dc(WORD16 *pi2_dst, - WORD32 dst_strd, - WORD32 log2_trans_size, - WORD16 i2_coeff_value) -{ - WORD32 row, col; - WORD32 add, shift; - WORD32 dc_value, quant_out; - WORD32 trans_size; - - trans_size = (1 << log2_trans_size); - - quant_out = i2_coeff_value; - - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - dc_value = CLIP_S16((quant_out * 64 + add) >> shift); - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - dc_value = CLIP_S16((dc_value * 64 + add) >> shift); - - for(row = 0; row < trans_size; row++) - for(col = 0; col < trans_size; col++) - pi2_dst[row * dst_strd + col] = dc_value; - -} - - -void ihevc_itrans_res_8x8(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) -{ - WORD32 j, k; - WORD32 e[4], o[4]; - WORD32 ee[2], eo[2]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - WORD32 zero_rows_2nd_stage = zero_cols; - WORD32 row_limit_2nd_stage; - - trans_size = TRANS_SIZE_8; - - pi2_tmp_orig = pi2_tmp; - - if((zero_cols & 0xF0) == 0xF0) - row_limit_2nd_stage = 4; - else - row_limit_2nd_stage = TRANS_SIZE_8; - - - if((zero_rows & 0xF0) == 0xF0) /* First 4 rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_8x8******************************************/ - /************************************************************************************************/ - - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_8[3][k] - * pi2_src[3 * src_strd]; - } - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size]; - } - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_8[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_8[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_8[7][k] - * pi2_tmp[7 * trans_size]; - } - - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_8x8******************************************/ - /************************************************************************************************/ - } - else /* All rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_8x8******************************************/ - /************************************************************************************************/ - - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_8[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_8[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_8[7][k] - * pi2_src[7 * src_strd]; - } - - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_8[6][0] * pi2_src[6 * src_strd]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_8[6][1] * pi2_src[6 * src_strd]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_src[0] - + g_ai2_ihevc_trans_8[4][0] * pi2_src[4 * src_strd]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_src[0] - + g_ai2_ihevc_trans_8[4][1] * pi2_src[4 * src_strd]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xF0) == 0xF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_8[3][k] * pi2_tmp[3 * trans_size]; - } - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 4; k++) - { - o[k] = g_ai2_ihevc_trans_8[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_8[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_8[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_8[7][k] - * pi2_tmp[7 * trans_size]; - } - - eo[0] = g_ai2_ihevc_trans_8[2][0] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_8[6][0] * pi2_tmp[6 * trans_size]; - eo[1] = g_ai2_ihevc_trans_8[2][1] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_8[6][1] * pi2_tmp[6 * trans_size]; - ee[0] = g_ai2_ihevc_trans_8[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_8[4][0] * pi2_tmp[4 * trans_size]; - ee[1] = g_ai2_ihevc_trans_8[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_8[4][1] * pi2_tmp[4 * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - e[0] = ee[0] + eo[0]; - e[3] = ee[0] - eo[0]; - e[1] = ee[1] + eo[1]; - e[2] = ee[1] - eo[1]; - for(k = 0; k < 4; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 4] = - CLIP_S16(((e[3 - k] - o[3 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_8x8******************************************/ - /************************************************************************************************/ - } -} - - -void ihevc_itrans_res_16x16(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) -{ - WORD32 j, k; - WORD32 e[8], o[8]; - WORD32 ee[4], eo[4]; - WORD32 eee[2], eeo[2]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - WORD32 zero_rows_2nd_stage = zero_cols; - WORD32 row_limit_2nd_stage; - - if((zero_cols & 0xFFF0) == 0xFFF0) - row_limit_2nd_stage = 4; - else if((zero_cols & 0xFF00) == 0xFF00) - row_limit_2nd_stage = 8; - else - row_limit_2nd_stage = TRANS_SIZE_16; - - trans_size = TRANS_SIZE_16; - pi2_tmp_orig = pi2_tmp; - if((zero_rows & 0xFFF0) == 0xFFF0) /* First 4 rows of input are non-zero */ - { - /* Inverse Transform 1st stage */ - /************************************************************************************************/ - /**********************************START - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_16[3][k] - * pi2_src[3 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd]; - } - eeo[0] = 0; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0]; - eeo[1] = 0; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - - if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]; - } - eeo[0] = 0; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = 0; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size]; - } - eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_16[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_16[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_16[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_16[15][k] - * pi2_tmp[15 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_16[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_16[14][k] - * pi2_tmp[14 * trans_size]; - } - eeo[0] = - g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][0] - * pi2_tmp[12 - * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size]; - eeo[1] = - g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][1] - * pi2_tmp[12 - * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - } - else if((zero_rows & 0xFF00) == 0xFF00) /* First 8 rows of input are non-zero */ - { - /* Inverse Transform 1st stage */ - /************************************************************************************************/ - /**********************************START - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_16[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_16[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_16[7][k] - * pi2_src[7 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_16[6][k] - * pi2_src[6 * src_strd]; - } - eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_src[0]; - eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - - if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]; - } - eeo[0] = 0; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = 0; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size]; - } - eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_16[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_16[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_16[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_16[15][k] - * pi2_tmp[15 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_16[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_16[14][k] - * pi2_tmp[14 * trans_size]; - } - eeo[0] = - g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][0] - * pi2_tmp[12 - * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size]; - eeo[1] = - g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][1] - * pi2_tmp[12 - * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - } - else /* All rows of input are non-zero */ - { - /* Inverse Transform 1st stage */ - /************************************************************************************************/ - /**********************************START - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_16[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_16[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_16[7][k] - * pi2_src[7 * src_strd] - + g_ai2_ihevc_trans_16[9][k] - * pi2_src[9 * src_strd] - + g_ai2_ihevc_trans_16[11][k] - * pi2_src[11 * src_strd] - + g_ai2_ihevc_trans_16[13][k] - * pi2_src[13 * src_strd] - + g_ai2_ihevc_trans_16[15][k] - * pi2_src[15 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_16[6][k] - * pi2_src[6 * src_strd] - + g_ai2_ihevc_trans_16[10][k] - * pi2_src[10 * src_strd] - + g_ai2_ihevc_trans_16[14][k] - * pi2_src[14 * src_strd]; - } - eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_src[4 * src_strd] - + g_ai2_ihevc_trans_16[12][0] - * pi2_src[12 * src_strd]; - eee[0] = - g_ai2_ihevc_trans_16[0][0] * pi2_src[0] - + g_ai2_ihevc_trans_16[8][0] - * pi2_src[8 - * src_strd]; - eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_src[4 * src_strd] - + g_ai2_ihevc_trans_16[12][1] - * pi2_src[12 * src_strd]; - eee[1] = - g_ai2_ihevc_trans_16[0][1] * pi2_src[0] - + g_ai2_ihevc_trans_16[8][1] - * pi2_src[8 - * src_strd]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - - if((zero_rows_2nd_stage & 0xFFF0) == 0xFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size]; - } - eeo[0] = 0; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = 0; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFF00) == 0xFF00) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size]; - } - eeo[0] = g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0]; - eeo[1] = g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 8; k++) - { - o[k] = g_ai2_ihevc_trans_16[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_16[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_16[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_16[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_16[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_16[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_16[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_16[15][k] - * pi2_tmp[15 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eo[k] = g_ai2_ihevc_trans_16[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_16[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_16[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_16[14][k] - * pi2_tmp[14 * trans_size]; - } - eeo[0] = - g_ai2_ihevc_trans_16[4][0] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][0] - * pi2_tmp[12 - * trans_size]; - eee[0] = g_ai2_ihevc_trans_16[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][0] * pi2_tmp[8 * trans_size]; - eeo[1] = - g_ai2_ihevc_trans_16[4][1] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_16[12][1] - * pi2_tmp[12 - * trans_size]; - eee[1] = g_ai2_ihevc_trans_16[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_16[8][1] * pi2_tmp[8 * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - for(k = 0; k < 2; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 2] = eee[1 - k] - eeo[1 - k]; - } - for(k = 0; k < 4; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 4] = ee[3 - k] - eo[3 - k]; - } - for(k = 0; k < 8; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 8] = - CLIP_S16(((e[7 - k] - o[7 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_16x16****************************************/ - /************************************************************************************************/ - } - -} - - -void ihevc_itrans_res_32x32(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows) -{ - WORD32 j, k; - WORD32 e[16], o[16]; - WORD32 ee[8], eo[8]; - WORD32 eee[4], eeo[4]; - WORD32 eeee[2], eeeo[2]; - WORD32 add; - WORD32 shift; - WORD16 *pi2_tmp_orig; - WORD32 trans_size; - WORD32 zero_rows_2nd_stage = zero_cols; - WORD32 row_limit_2nd_stage; - - trans_size = TRANS_SIZE_32; - pi2_tmp_orig = pi2_tmp; - - if((zero_cols & 0xFFFFFFF0) == 0xFFFFFFF0) - row_limit_2nd_stage = 4; - else if((zero_cols & 0xFFFFFF00) == 0xFFFFFF00) - row_limit_2nd_stage = 8; - else - row_limit_2nd_stage = TRANS_SIZE_32; - - if((zero_rows & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } - else if((zero_rows & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_32[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_32[7][k] - * pi2_src[7 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_32[6][k] - * pi2_src[6 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } - else /* All rows of input are non-zero */ - { - /************************************************************************************************/ - /**********************************START - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - /* Inverse Transform 1st stage */ - shift = IT_SHIFT_STAGE_1; - add = 1 << (shift - 1); - - for(j = 0; j < row_limit_2nd_stage; j++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - memset(pi2_tmp, 0, trans_size * sizeof(WORD16)); - } - else - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_src[src_strd] - + g_ai2_ihevc_trans_32[3][k] - * pi2_src[3 * src_strd] - + g_ai2_ihevc_trans_32[5][k] - * pi2_src[5 * src_strd] - + g_ai2_ihevc_trans_32[7][k] - * pi2_src[7 * src_strd] - + g_ai2_ihevc_trans_32[9][k] - * pi2_src[9 * src_strd] - + g_ai2_ihevc_trans_32[11][k] - * pi2_src[11 * src_strd] - + g_ai2_ihevc_trans_32[13][k] - * pi2_src[13 * src_strd] - + g_ai2_ihevc_trans_32[15][k] - * pi2_src[15 * src_strd] - + g_ai2_ihevc_trans_32[17][k] - * pi2_src[17 * src_strd] - + g_ai2_ihevc_trans_32[19][k] - * pi2_src[19 * src_strd] - + g_ai2_ihevc_trans_32[21][k] - * pi2_src[21 * src_strd] - + g_ai2_ihevc_trans_32[23][k] - * pi2_src[23 * src_strd] - + g_ai2_ihevc_trans_32[25][k] - * pi2_src[25 * src_strd] - + g_ai2_ihevc_trans_32[27][k] - * pi2_src[27 * src_strd] - + g_ai2_ihevc_trans_32[29][k] - * pi2_src[29 * src_strd] - + g_ai2_ihevc_trans_32[31][k] - * pi2_src[31 * src_strd]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_src[2 * src_strd] - + g_ai2_ihevc_trans_32[6][k] - * pi2_src[6 * src_strd] - + g_ai2_ihevc_trans_32[10][k] - * pi2_src[10 * src_strd] - + g_ai2_ihevc_trans_32[14][k] - * pi2_src[14 * src_strd] - + g_ai2_ihevc_trans_32[18][k] - * pi2_src[18 * src_strd] - + g_ai2_ihevc_trans_32[22][k] - * pi2_src[22 * src_strd] - + g_ai2_ihevc_trans_32[26][k] - * pi2_src[26 * src_strd] - + g_ai2_ihevc_trans_32[30][k] - * pi2_src[30 * src_strd]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_src[4 * src_strd] - + g_ai2_ihevc_trans_32[12][k] - * pi2_src[12 * src_strd] - + g_ai2_ihevc_trans_32[20][k] - * pi2_src[20 * src_strd] - + g_ai2_ihevc_trans_32[28][k] - * pi2_src[28 * src_strd]; - } - eeeo[0] = g_ai2_ihevc_trans_32[8][0] * pi2_src[8 * src_strd] - + g_ai2_ihevc_trans_32[24][0] - * pi2_src[24 * src_strd]; - eeeo[1] = g_ai2_ihevc_trans_32[8][1] * pi2_src[8 * src_strd] - + g_ai2_ihevc_trans_32[24][1] - * pi2_src[24 * src_strd]; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_src[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_src[16 * src_strd]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_src[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_src[16 * src_strd]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_tmp[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - pi2_tmp[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - } - pi2_src++; - pi2_tmp += trans_size; - zero_cols = zero_cols >> 1; - } - - pi2_tmp = pi2_tmp_orig; - - /* Inverse Transform 2nd stage */ - shift = IT_SHIFT_STAGE_2; - add = 1 << (shift - 1); - if((zero_rows_2nd_stage & 0xFFFFFFF0) == 0xFFFFFFF0) /* First 4 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size]; - } -// for(k = 0; k < 4; k++) - { - eeo[0] = 0; - eeo[1] = 0; - eeo[2] = 0; - eeo[3] = 0; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else if((zero_rows_2nd_stage & 0xFFFFFF00) == 0xFFFFFF00) /* First 8 rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size]; - } - eeeo[0] = 0; - eeeo[1] = 0; - eeee[0] = g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0]; - eeee[1] = g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - else /* All rows of output of 1st stage are non-zero */ - { - for(j = 0; j < trans_size; j++) - { - /* Utilizing symmetry properties to the maximum to minimize the number of multiplications */ - for(k = 0; k < 16; k++) - { - o[k] = g_ai2_ihevc_trans_32[1][k] * pi2_tmp[trans_size] - + g_ai2_ihevc_trans_32[3][k] - * pi2_tmp[3 * trans_size] - + g_ai2_ihevc_trans_32[5][k] - * pi2_tmp[5 * trans_size] - + g_ai2_ihevc_trans_32[7][k] - * pi2_tmp[7 * trans_size] - + g_ai2_ihevc_trans_32[9][k] - * pi2_tmp[9 * trans_size] - + g_ai2_ihevc_trans_32[11][k] - * pi2_tmp[11 * trans_size] - + g_ai2_ihevc_trans_32[13][k] - * pi2_tmp[13 * trans_size] - + g_ai2_ihevc_trans_32[15][k] - * pi2_tmp[15 * trans_size] - + g_ai2_ihevc_trans_32[17][k] - * pi2_tmp[17 * trans_size] - + g_ai2_ihevc_trans_32[19][k] - * pi2_tmp[19 * trans_size] - + g_ai2_ihevc_trans_32[21][k] - * pi2_tmp[21 * trans_size] - + g_ai2_ihevc_trans_32[23][k] - * pi2_tmp[23 * trans_size] - + g_ai2_ihevc_trans_32[25][k] - * pi2_tmp[25 * trans_size] - + g_ai2_ihevc_trans_32[27][k] - * pi2_tmp[27 * trans_size] - + g_ai2_ihevc_trans_32[29][k] - * pi2_tmp[29 * trans_size] - + g_ai2_ihevc_trans_32[31][k] - * pi2_tmp[31 * trans_size]; - } - for(k = 0; k < 8; k++) - { - eo[k] = g_ai2_ihevc_trans_32[2][k] * pi2_tmp[2 * trans_size] - + g_ai2_ihevc_trans_32[6][k] - * pi2_tmp[6 * trans_size] - + g_ai2_ihevc_trans_32[10][k] - * pi2_tmp[10 * trans_size] - + g_ai2_ihevc_trans_32[14][k] - * pi2_tmp[14 * trans_size] - + g_ai2_ihevc_trans_32[18][k] - * pi2_tmp[18 * trans_size] - + g_ai2_ihevc_trans_32[22][k] - * pi2_tmp[22 * trans_size] - + g_ai2_ihevc_trans_32[26][k] - * pi2_tmp[26 * trans_size] - + g_ai2_ihevc_trans_32[30][k] - * pi2_tmp[30 * trans_size]; - } - for(k = 0; k < 4; k++) - { - eeo[k] = g_ai2_ihevc_trans_32[4][k] * pi2_tmp[4 * trans_size] - + g_ai2_ihevc_trans_32[12][k] - * pi2_tmp[12 * trans_size] - + g_ai2_ihevc_trans_32[20][k] - * pi2_tmp[20 * trans_size] - + g_ai2_ihevc_trans_32[28][k] - * pi2_tmp[28 * trans_size]; - } - eeeo[0] = - g_ai2_ihevc_trans_32[8][0] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][0] - * pi2_tmp[24 - * trans_size]; - eeeo[1] = - g_ai2_ihevc_trans_32[8][1] * pi2_tmp[8 * trans_size] - + g_ai2_ihevc_trans_32[24][1] - * pi2_tmp[24 - * trans_size]; - eeee[0] = - g_ai2_ihevc_trans_32[0][0] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][0] - * pi2_tmp[16 - * trans_size]; - eeee[1] = - g_ai2_ihevc_trans_32[0][1] * pi2_tmp[0] - + g_ai2_ihevc_trans_32[16][1] - * pi2_tmp[16 - * trans_size]; - - /* Combining e and o terms at each hierarchy levels to calculate the final spatial domain vector */ - eee[0] = eeee[0] + eeeo[0]; - eee[3] = eeee[0] - eeeo[0]; - eee[1] = eeee[1] + eeeo[1]; - eee[2] = eeee[1] - eeeo[1]; - for(k = 0; k < 4; k++) - { - ee[k] = eee[k] + eeo[k]; - ee[k + 4] = eee[3 - k] - eeo[3 - k]; - } - for(k = 0; k < 8; k++) - { - e[k] = ee[k] + eo[k]; - e[k + 8] = ee[7 - k] - eo[7 - k]; - } - for(k = 0; k < 16; k++) - { - pi2_dst[k] = - CLIP_S16(((e[k] + o[k] + add) >> shift)); - - pi2_dst[k + 16] = - CLIP_S16(((e[15 - k] - o[15 - k] + add) >> shift)); - } - pi2_tmp++; - pi2_dst += dst_strd; - } - } - /************************************************************************************************/ - /************************************END - IT_RECON_32x32****************************************/ - /************************************************************************************************/ - } -} - - -void ihevc_res_4x4_rotate(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols) -{ - WORD32 i, j; - WORD32 trans_size; - - trans_size = TRANS_SIZE_4; - - WORD32 offset = trans_size * src_strd - 1; - - zero_cols = gau4_ihevcd_4_bit_reverse[zero_cols & 0xF]; - - for(i = 0; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = 0; - } - } - else - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = pi2_src[offset - (j * src_strd + i)]; - } - } - pi2_dst++; - zero_cols = zero_cols >> 1; - } -} - - -void ihevc_res_nxn_copy(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 trans_size, - WORD32 zero_cols) -{ - - WORD32 i, j; - - for(i = 0; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = 0; - } - } - else - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = pi2_src[(j * src_strd + i)]; - } - } - pi2_dst++; - zero_cols = zero_cols >> 1; - } -} - - -void ihevc_res_nxn_rdpcm_horz(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 trans_size, - WORD32 zero_cols) -{ - WORD32 i, j; - - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = 0; - } - } - else - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = pi2_src[j * src_strd]; - } - } - pi2_dst++; - zero_cols >>= 1; - - for(i = 1; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = pi2_dst[j * dst_strd - 1]; - } - } - else - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = pi2_src[j * src_strd + i] + pi2_dst[j * dst_strd - 1]; - } - } - pi2_dst++; - zero_cols >>= 1; - } -} - - -void ihevc_res_nxn_rdpcm_vert(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 trans_size, - WORD32 zero_cols) -{ - WORD32 i, j; - - for(i = 0; i < trans_size; i++) - { - /* Checking for Zero Cols */ - if((zero_cols & 1) == 1) - { - for(j = 0; j < trans_size; j++) - { - pi2_dst[j * dst_strd] = 0; - } - } - else - { - WORD16 acc = pi2_src[i]; - - pi2_dst[0] = acc; - for(j = 1; j < trans_size; j++) - { - acc += pi2_src[j * src_strd + i]; - pi2_dst[j * dst_strd] = acc; - } - } - pi2_dst++; - zero_cols = zero_cols >> 1; - } -} - diff --git a/common/ihevc_itrans_res.h b/common/ihevc_itrans_res.h deleted file mode 100644 index e14510c..0000000 --- a/common/ihevc_itrans_res.h +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -/** - ******************************************************************************* - * @file - * ihevc_itrans_res.h - * - * @brief - * Functions declarations for inverse transform - * - * @author - * Ittiam - * - * @remarks - * None - * - ******************************************************************************* - */ -#ifndef _IHEVC_ITRANS_RES_H_ -#define _IHEVC_ITRANS_RES_H_ - -typedef void ihevc_itrans_res_4x4_ttype1_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - -typedef void ihevc_itrans_res_4x4_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - -typedef void ihevcd_itrans_res_dc_ft(WORD16 *pi2_dst, - WORD32 dst_strd, - WORD32 log2_trans_size, - WORD16 i2_coeff_value); - -typedef void ihevc_itrans_res_8x8_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - -typedef void ihevc_itrans_res_16x16_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - -typedef void ihevc_itrans_res_32x32_ft(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - -typedef void ihevc_res_4x4_transform(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 zero_cols); - -typedef void ihevc_res_nxn_transform(WORD16 *pi2_src, - WORD16 *pi2_dst, - WORD32 src_strd, - WORD32 dst_strd, - WORD32 trans_size, - WORD32 zero_cols); - -/* C function declarations */ -ihevc_itrans_res_4x4_ttype1_ft ihevc_itrans_res_4x4_ttype1; -ihevc_itrans_res_4x4_ft ihevc_itrans_res_4x4; -ihevcd_itrans_res_dc_ft ihevcd_itrans_res_dc; -ihevc_itrans_res_8x8_ft ihevc_itrans_res_8x8; -ihevc_itrans_res_16x16_ft ihevc_itrans_res_16x16; -ihevc_itrans_res_32x32_ft ihevc_itrans_res_32x32; - -ihevc_res_4x4_transform ihevc_res_4x4_rotate; -ihevc_res_nxn_transform ihevc_res_nxn_copy; -ihevc_res_nxn_transform ihevc_res_nxn_rdpcm_horz; -ihevc_res_nxn_transform ihevc_res_nxn_rdpcm_vert; - -#endif /*_IHEVC_ITRANS_RES_H_*/ diff --git a/common/ihevc_structs.h b/common/ihevc_structs.h index ddab43f..1c673a8 100644 --- a/common/ihevc_structs.h +++ b/common/ihevc_structs.h @@ -1420,28 +1420,6 @@ typedef struct */ UWORD32 b3_chroma_intra_mode_idx : 3; -#ifdef ENABLE_MAIN_REXT_PROFILE - /** - * Cb CCP alpha magnitude - */ - UWORD32 b3_cb_log2_res_scale_abs_plus1 : 3; - - /** - * Cb CCP alpha sign - */ - UWORD32 b1_cb_log2_res_sign : 1; - - /** - * Cr CCP alpha magnitude - */ - UWORD32 b3_cr_log2_res_scale_abs_plus1 : 3; - - /** - * Cr CCP alpha sign - */ - UWORD32 b1_cr_log2_res_sign : 1; -#endif - }tu_t; /** @@ -2503,36 +2481,6 @@ typedef struct */ vui_t s_vui_parameters; - /** - * sps_extension_present_flag - */ - WORD8 i1_sps_extension_present_flag; - - /** - * sps_range_extension_present_flag - */ - WORD8 i1_sps_range_extension_flag; - - /** - * sps_multilayer_extension_present_flag - */ - WORD8 i1_sps_multilayer_extension_flag; - - /** - * sps_3d_extension_present_flag - */ - WORD8 i1_sps_3d_extension_flag; - - /** - * sps_scc_extension_present_flag - */ - WORD8 i1_sps_scc_extension_flag; - - /** - * sps_extension_reserved - */ - WORD8 i1_sps_extension_4bits; - /** * Log2(CTB Size) in luma units */ @@ -2595,8 +2543,8 @@ typedef struct /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V */ /* Intra 16x16 Y, 16x16 U, 16x16 V */ /* Inter 16x16 Y, 16x16 U, 16x16 V */ - /* Intra 32x32 Y, 32x32 U, 32x32 V */ - /* Inter 32x32 Y, 32x32 U, 32x32 V */ + /* Intra 32x32 Y */ + /* Inter 32x32 Y */ /*************************************************************************/ WORD16 *pi2_scaling_mat; @@ -2638,9 +2586,9 @@ typedef struct WORD8 i1_use_high_precision_pred_wt; /** - * persistent_rice_adaptation_enabled_flag + * fast_rice_adaptation_enabled_flag */ - WORD8 i1_persistent_rice_adaptation_enabled_flag; + WORD8 i1_fast_rice_adaptation_enabled_flag; /** * cabac_bypass_alignment_enabled_flag @@ -2671,8 +2619,8 @@ typedef struct /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V */ /* Intra 16x16 Y, 16x16 U, 16x16 V */ /* Inter 16x16 Y, 16x16 U, 16x16 V */ - /* Intra 32x32 Y, 32x32 U, 32x32 V */ - /* Inter 32x32 Y, 32x32 U, 32x32 V */ + /* Intra 32x32 Y */ + /* Inter 32x32 Y */ /*************************************************************************/ WORD16 *pi2_scaling_mat; @@ -2874,36 +2822,6 @@ typedef struct */ WORD8 i1_slice_extension_present_flag; - /** - * pps_extension_present_flag - */ - WORD8 i1_pps_extension_present_flag; - - /** - * pps_range_extension_present_flag - */ - WORD8 i1_pps_range_extension_flag; - - /** - * pps_multilayer_extension_present_flag - */ - WORD8 i1_pps_multilayer_extension_flag; - - /** - * pps_3d_extension_present_flag - */ - WORD8 i1_pps_3d_extension_flag; - - /** - * pps_scc_extension_present_flag - */ - WORD8 i1_pps_scc_extension_flag; - - /** - * pps_extension_reserved - */ - WORD8 i1_pps_extension_4bits; - /** * scaling_list_dc_coef_minus8 */ @@ -2924,7 +2842,7 @@ typedef struct /** * log2_max_transform_skip_block_size_minus2 */ - WORD8 i1_log2_max_transform_skip_block_size_minus2; + WORD32 i4_log2_max_transform_skip_block_size_minus2; /** * cross_component_prediction_enabled_flag diff --git a/common/ihevc_trans_tables.c b/common/ihevc_trans_tables.c index 3eb392e..7c93662 100644 --- a/common/ihevc_trans_tables.c +++ b/common/ihevc_trans_tables.c @@ -877,12 +877,6 @@ const WORD16 g_ai2_ihevc_trans_intr_4[4][8] = const UWORD8 IHEVCE_CHROMA_SHUFFLEMASK_HBD[8] = { 0x00, 0x01, 0x04, 0x05, 0x08, 0x09, 0x0C, 0x0D }; - -const UWORD32 gau4_ihevcd_4_bit_reverse[] = -{ - 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 -}; - #ifndef DISABLE_AVX2 const WORD32 g_ai4_ihevc_trans_8_intr_avx2[7][8] = { /* 4*32 = 128 bit */ diff --git a/common/ihevc_trans_tables.h b/common/ihevc_trans_tables.h index 6d07d41..581cd92 100644 --- a/common/ihevc_trans_tables.h +++ b/common/ihevc_trans_tables.h @@ -116,6 +116,4 @@ extern const WORD16 g_ai2_ihevc_trans_intr_4[4][8]; extern const UWORD8 IHEVCE_CHROMA_SHUFFLEMASK_HBD[8]; -extern MEM_ALIGN16 const UWORD32 gau4_ihevcd_4_bit_reverse[16]; - #endif /*_IHEVC_TRANS_TABLES_H_*/ diff --git a/common/x86/ihevc_intra_pred_filters_sse42_intr.c b/common/x86/ihevc_intra_pred_filters_sse42_intr.c index 235a289..0a1ce0a 100644 --- a/common/x86/ihevc_intra_pred_filters_sse42_intr.c +++ b/common/x86/ihevc_intra_pred_filters_sse42_intr.c @@ -91,11 +91,6 @@ * @param[in] mode * integer intraprediction mode * -* @param[in] intra_smoothing_flags -* integer bit 3 indicates if intra smoothing is enabled/disabled -* unconditionally. this is applicable to frext profiles only -* bit 0 indicates strong intra smoothing enabled/disabled -* * @returns * * @remarks @@ -109,7 +104,7 @@ void ihevc_intra_pred_ref_filtering_sse42(UWORD8 *pu1_src, WORD32 nt, UWORD8 *pu1_dst, WORD32 mode, - WORD32 intra_smoothing_flags) + WORD32 strong_intra_smoothing_enable_flag) { WORD32 filter_flag; WORD32 i; /* Generic indexing variable */ @@ -122,10 +117,11 @@ void ihevc_intra_pred_ref_filtering_sse42(UWORD8 *pu1_src, __m128i src_temp1, src_temp2, src_temp3, src_temp7; __m128i src_temp4, src_temp5, src_temp6, src_temp8; - WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3); - WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1; - filter_flag = intra_smoothing_disabled ? - 0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2))); + //WORD32 strong_intra_smoothing_enable_flag = 1; + + + + filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)); if(0 == filter_flag) { if(pu1_src == pu1_dst) diff --git a/common/x86/ihevc_intra_pred_filters_ssse3_intr.c b/common/x86/ihevc_intra_pred_filters_ssse3_intr.c index ec479d2..8441a8a 100644 --- a/common/x86/ihevc_intra_pred_filters_ssse3_intr.c +++ b/common/x86/ihevc_intra_pred_filters_ssse3_intr.c @@ -377,11 +377,6 @@ void ihevc_intra_pred_luma_ref_substitution_ssse3(UWORD8 *pu1_top_left, * @param[in] mode * integer intraprediction mode * -* @param[in] intra_smoothing_flags -* integer bit 3 indicates if intra smoothing is enabled/disabled -* unconditionally. this is applicable to frext profiles only -* bit 0 indicates strong intra smoothing enabled/disabled -* * @returns * * @remarks @@ -394,7 +389,7 @@ void ihevc_intra_pred_ref_filtering_ssse3(UWORD8 *pu1_src, WORD32 nt, UWORD8 *pu1_dst, WORD32 mode, - WORD32 intra_smoothing_flags) + WORD32 strong_intra_smoothing_enable_flag) { WORD32 filter_flag; WORD32 i; /* Generic indexing variable */ @@ -407,10 +402,9 @@ void ihevc_intra_pred_ref_filtering_ssse3(UWORD8 *pu1_src, __m128i src_temp1, src_temp2, src_temp3, src_temp7; __m128i src_temp4, src_temp5, src_temp6, src_temp8; - WORD32 intra_smoothing_disabled = (intra_smoothing_flags >> 3); - WORD32 strong_intra_smoothing_enable_flag = intra_smoothing_flags & 1; - filter_flag = intra_smoothing_disabled ? - 0 : (gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2))); + //WORD32 strong_intra_smoothing_enable_flag = 1; + + filter_flag = gau1_intra_pred_ref_filter[mode] & (1 << (CTZ(nt) - 2)); if(0 == filter_flag) { if(pu1_src == pu1_dst) diff --git a/decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s b/decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s new file mode 100644 index 0000000..caf7123 --- /dev/null +++ b/decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s @@ -0,0 +1,453 @@ +@/***************************************************************************** +@* +@* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore +@* +@* Licensed under the Apache License, Version 2.0 (the "License"); +@* you may not use this file except in compliance with the License. +@* You may obtain a copy of the License at: +@* +@* http://www.apache.org/licenses/LICENSE-2.0 +@* +@* Unless required by applicable law or agreed to in writing, software +@* distributed under the License is distributed on an "AS IS" BASIS, +@* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@* See the License for the specific language governing permissions and +@* limitations under the License. +@* +@*****************************************************************************/ +@/** +@/******************************************************************************* +@* @file +@* ihevcd_fmt_conv_420sp_to_rgba8888.s +@* +@* @brief +@* contains function definitions for format conversions +@* +@* @author +@* ittiam +@* +@* @par list of functions: +@* +@* +@* @remarks +@* none +@* +@*******************************************************************************/ + .equ DO1STROUNDING, 0 + + @ ARM + @ + @ PRESERVE8 + +.text +.p2align 2 + + + + +@/***************************************************************************** +@* * +@* Function Name : ihevcd_fmt_conv_420sp_to_rgba8888() * +@* * +@* Description : This function conversts the image from YUV422 color * +@* space to RGB888 color space. The function can be * +@* invoked at the MB level. * +@* * +@* Arguments : R0 pubY * +@* R1 pubUV * +@* R2 pusRGB * +@* R3 pusRGB * +@* [R13 #40] usHeight * +@* [R13 #44] usWidth * +@* [R13 #48] usStrideY * +@* [R13 #52] usStrideU * +@* [R13 #56] usStrideV * +@* [R13 #60] usStrideRGB * +@* * +@* Values Returned : None * +@* * +@* Register Usage : R0 - R14 * +@* * +@* Stack Usage : 104 Bytes * +@* * +@* Interruptibility : Interruptible * +@* * +@* Known Limitations * +@* Assumptions: Image Width: Assumed to be multiple of 16 and * +@* greater than or equal to 16 * +@* Image Height: Assumed to be even. * +@* * +@* Revision History : * +@* DD MM YYYY Author(s) Changes (Describe the changes made) * +@* 07 06 2010 Varshita Draft * +@* 07 06 2010 Naveen Kr T Completed * +@* 05 08 2013 Naveen K P Modified for HEVC * +@* 30 10 2018 Saurabh Sood Store D registers to stack * +@*****************************************************************************/ + .global ihevcd_fmt_conv_420sp_to_rgba8888_a9q +.type ihevcd_fmt_conv_420sp_to_rgba8888_a9q, function +ihevcd_fmt_conv_420sp_to_rgba8888_a9q: + + @// push the registers on the stack + STMFD SP!,{R4-R12,LR} + VPUSH {d8-d15} + + @//R0 - Y PTR + @//R1 - UV PTR + @//R2 - RGB PTR + @//R3 - RGB PTR + @//R4 - PIC WIDTH + @//R5 - PIC HT + @//R6 - STRIDE Y + @//R7 - STRIDE U + @//R8 - STRIDE V + @//R9 - STRIDE RGB + + @//ONE ROW PROCESSING AT A TIME + + @//THE FOUR CONSTANTS ARE: + @//C1=0x3311,C2=0xF379,C3=0xE5F8,C4=0x4092 + + @PLD [R0] + @PLD [R1] + @PLD [R2] + + + @/* can be loaded from a defined const type */ + MOVW R10,#0x3311 + VMOV.16 D0[0],R10 @//C1 + + MOVW R10,#0xF379 + VMOV.16 D0[1],R10 @//C2 + + MOVW R10,#0xE5F8 + VMOV.16 D0[2],R10 @//C3 + + MOVW R10,#0x4092 + VMOV.16 D0[3],R10 @//C4 + + @//LOAD CONSTANT 128 INTO A CORTEX REGISTER + MOV R10,#128 + VDUP.8 D1,R10 + + @//D0 HAS C1-C2-C3-C4 + @// load other parameters from stack + LDR R5,[sp,#104] + @LDR R4,[sp,#44] + LDR R6,[sp,#108] + LDR R7,[sp,#112] + @LDR R8,[sp,#52] + LDR R9,[sp,#116] + + @// calculate offsets, offset = stride - width + SUB R10,R6,R3 @// luma offset + SUB R11,R7,R3 + @, LSR #1 @// u offset + @SUB R12,R8,R3, LSR #1 @// v offset + SUB R14,R9,R3 @// rgb offset in pixels + + @// calculate height loop count + MOV R5,R5, LSR #1 @// height_cnt = height / 16 + + @// create next row pointers for rgb and luma data + ADD R7,R0,R6 @// luma_next_row = luma + luma_stride + ADD R8,R2,R9,LSL #2 @// rgb_next_row = rgb + rgb_stride + +LABEL_YUV420SP_TO_RGB8888_HEIGHT_LOOP: + + @//LOAD VALUES OF U&V AND COMPUTE THE R,G,B WEIGHT VALUES. + VLD1.8 {D2,D3},[R1]! @//LOAD 8 VALUES OF UV + @//VLD1.8 {D3},[R2]! @//LOAD 8 VALUES OF V + + @// calculate width loop count + MOV R6,R3, LSR #4 @// width_cnt = width / 16 + + @//COMPUTE THE ACTUAL RGB VALUES,WE CAN DO TWO ROWS AT A TIME + @//LOAD VALUES OF Y 8-BIT VALUES + VLD2.8 {D30,D31},[R0]! @//D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row 1 + @//D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + VLD2.8 {D28,D29},[R7]! @//D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row2 + @//D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + + SUBS R6,R6,#1 + BEQ LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP_SKIP + +LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP: + @VMOV.I8 Q1,#128 + VUZP.8 D2,D3 + + + @//NEED TO SUBTRACT (U-128) AND (V-128) + @//(D2-D1),(D3-D1) + VSUBL.U8 Q2,D2,D1 @//(U-128) + VSUBL.U8 Q3,D3,D1 @//(V-128) + + @//LOAD VALUES OF U&V for next row + VLD1.8 {D2,D3},[R1]! @//LOAD 8 VALUES OF U + @//VLD1.8 {D3},[R2]! @//LOAD 8 VALUES OF V + + @PLD [R0] + PLD [R1] + + @//NEED TO MULTIPLY WITH Q2,Q3 WITH CO-EEFICIENTS + VMULL.S16 Q4,D4,D0[3] @//(U-128)*C4 FOR B + VMULL.S16 Q5,D5,D0[3] @//(U-128)*C4 FOR B + + VMULL.S16 Q10,D6,D0[0] @//(V-128)*C1 FOR R + VMULL.S16 Q11,D7,D0[0] @//(V-128)*C1 FOR R + + VMULL.S16 Q6,D4,D0[1] @//(U-128)*C2 FOR G + VMLAL.S16 Q6,D6,D0[2] @//Q6 = (U-128)*C2 + (V-128)*C3 + VMULL.S16 Q7,D5,D0[1] @//(U-128)*C2 FOR G + VMLAL.S16 Q7,D7,D0[2] @//Q7 = (U-128)*C2 + (V-128)*C3 + + @//NARROW RIGHT SHIFT BY 13 FOR R&B + VQSHRN.S32 D8,Q4,#13 @//D8 = (U-128)*C4>>13 4 16-BIT VALUES + VQSHRN.S32 D9,Q5,#13 @//D9 = (U-128)*C4>>13 4 16-BIT VALUES + @//Q4 - WEIGHT FOR B + + @//NARROW RIGHT SHIFT BY 13 FOR R&B + VQSHRN.S32 D10,Q10,#13 @//D10 = (V-128)*C1>>13 4 16-BIT VALUES + VQSHRN.S32 D11,Q11,#13 @//D11 = (V-128)*C1>>13 4 16-BIT VALUES + @//Q5 - WEIGHT FOR R + + @//NARROW RIGHT SHIFT BY 13 FOR G + VQSHRN.S32 D12,Q6,#13 @//D12 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + VQSHRN.S32 D13,Q7,#13 @//D13 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + @//Q6 - WEIGHT FOR G + + VADDW.U8 Q7,Q4,D30 @//Q7 - HAS Y + B + VADDW.U8 Q8,Q5,D30 @//Q8 - HAS Y + R + VADDW.U8 Q9,Q6,D30 @//Q9 - HAS Y + G + + VADDW.U8 Q10,Q4,D31 @//Q10 - HAS Y + B + VADDW.U8 Q11,Q5,D31 @//Q11 - HAS Y + R + VADDW.U8 Q12,Q6,D31 @//Q12 - HAS Y + G + + VQMOVUN.S16 D14,Q7 + VQMOVUN.S16 D15,Q9 + VQMOVUN.S16 D16,Q8 + VMOV.I8 D17,#0 + + VZIP.8 D14,D15 + VZIP.8 D16,D17 + VZIP.16 Q7,Q8 + + + VQMOVUN.S16 D20,Q10 + VQMOVUN.S16 D21,Q12 + VQMOVUN.S16 D22,Q11 + VMOV.I8 D23,#0 + + VZIP.8 D20,D21 + VZIP.8 D22,D23 + VZIP.16 Q10,Q11 + + VZIP.32 Q7,Q10 + VZIP.32 Q8,Q11 + + VST1.32 D14,[R2]! + VST1.32 D15,[R2]! + VST1.32 D20,[R2]! + VST1.32 D21,[R2]! + VST1.32 D16,[R2]! + VST1.32 D17,[R2]! + VST1.32 D22,[R2]! + VST1.32 D23,[R2]! + + @//D14-D20 - TOALLY HAVE 16 VALUES + @//WE NEED TO SHIFT R,G,B VALUES TO GET 5BIT,6BIT AND 5BIT COMBINATIONS + VADDW.U8 Q7,Q4,D28 @//Q7 - HAS Y + B + VADDW.U8 Q8,Q5,D28 @//Q2 - HAS Y + R + VADDW.U8 Q9,Q6,D28 @//Q3 - HAS Y + G + + VADDW.U8 Q10,Q4,D29 @//Q10 - HAS Y + B + VADDW.U8 Q11,Q5,D29 @//Q11 - HAS Y + R + VADDW.U8 Q12,Q6,D29 @//Q12 - HAS Y + G + + @//COMPUTE THE ACTUAL RGB VALUES,WE CAN DO TWO ROWS AT A TIME + @//LOAD VALUES OF Y 8-BIT VALUES + VLD2.8 {D30,D31},[R0]! @//D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row 1 + @//D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + VLD2.8 {D28,D29},[R7]! @//D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row2 + @//D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + + PLD [R0] + PLD [R7] + + VQMOVUN.S16 D14,Q7 + VQMOVUN.S16 D15,Q9 + VQMOVUN.S16 D16,Q8 + VMOV.I8 D17,#0 + + VZIP.8 D14,D15 + VZIP.8 D16,D17 + VZIP.16 Q7,Q8 + + + VQMOVUN.S16 D20,Q10 + VQMOVUN.S16 D21,Q12 + VQMOVUN.S16 D22,Q11 + VMOV.I8 D23,#0 + + VZIP.8 D20,D21 + VZIP.8 D22,D23 + VZIP.16 Q10,Q11 + + VZIP.32 Q7,Q10 + VZIP.32 Q8,Q11 + + VST1.32 D14,[R8]! + VST1.32 D15,[R8]! + VST1.32 D20,[R8]! + VST1.32 D21,[R8]! + VST1.32 D16,[R8]! + VST1.32 D17,[R8]! + VST1.32 D22,[R8]! + VST1.32 D23,[R8]! + + SUBS R6,R6,#1 @// width_cnt -= 1 + BNE LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP + +LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP_SKIP: + @VMOV.I8 Q1,#128 + VUZP.8 D2,D3 + + + @//NEED TO SUBTRACT (U-128) AND (V-128) + @//(D2-D1),(D3-D1) + VSUBL.U8 Q2,D2,D1 @//(U-128) + VSUBL.U8 Q3,D3,D1 @//(V-128) + + + @//NEED TO MULTIPLY WITH Q2,Q3 WITH CO-EEFICIENTS + VMULL.S16 Q4,D4,D0[3] @//(U-128)*C4 FOR B + VMULL.S16 Q5,D5,D0[3] @//(U-128)*C4 FOR B + + VMULL.S16 Q10,D6,D0[0] @//(V-128)*C1 FOR R + VMULL.S16 Q11,D7,D0[0] @//(V-128)*C1 FOR R + + VMULL.S16 Q6,D4,D0[1] @//(U-128)*C2 FOR G + VMLAL.S16 Q6,D6,D0[2] @//Q6 = (U-128)*C2 + (V-128)*C3 + VMULL.S16 Q7,D5,D0[1] @//(U-128)*C2 FOR G + VMLAL.S16 Q7,D7,D0[2] @//Q7 = (U-128)*C2 + (V-128)*C3 + + @//NARROW RIGHT SHIFT BY 13 FOR R&B + VQSHRN.S32 D8,Q4,#13 @//D8 = (U-128)*C4>>13 4 16-BIT VALUES + VQSHRN.S32 D9,Q5,#13 @//D9 = (U-128)*C4>>13 4 16-BIT VALUES + @//Q4 - WEIGHT FOR B + + @//NARROW RIGHT SHIFT BY 13 FOR R&B + VQSHRN.S32 D10,Q10,#13 @//D10 = (V-128)*C1>>13 4 16-BIT VALUES + VQSHRN.S32 D11,Q11,#13 @//D11 = (V-128)*C1>>13 4 16-BIT VALUES + @//Q5 - WEIGHT FOR R + + @//NARROW RIGHT SHIFT BY 13 FOR G + VQSHRN.S32 D12,Q6,#13 @//D12 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + VQSHRN.S32 D13,Q7,#13 @//D13 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + @//Q6 - WEIGHT FOR G + + VADDW.U8 Q7,Q4,D30 @//Q7 - HAS Y + B + VADDW.U8 Q8,Q5,D30 @//Q8 - HAS Y + R + VADDW.U8 Q9,Q6,D30 @//Q9 - HAS Y + G + + VADDW.U8 Q10,Q4,D31 @//Q10 - HAS Y + B + VADDW.U8 Q11,Q5,D31 @//Q11 - HAS Y + R + VADDW.U8 Q12,Q6,D31 @//Q12 - HAS Y + G + + VQMOVUN.S16 D14,Q7 + VQMOVUN.S16 D15,Q9 + VQMOVUN.S16 D16,Q8 + VMOV.I8 D17,#0 + + VZIP.8 D14,D15 + VZIP.8 D16,D17 + VZIP.16 Q7,Q8 + + + VQMOVUN.S16 D20,Q10 + VQMOVUN.S16 D21,Q12 + VQMOVUN.S16 D22,Q11 + VMOV.I8 D23,#0 + + VZIP.8 D20,D21 + VZIP.8 D22,D23 + VZIP.16 Q10,Q11 + + VZIP.32 Q7,Q10 + VZIP.32 Q8,Q11 + + VST1.32 D14,[R2]! + VST1.32 D15,[R2]! + VST1.32 D20,[R2]! + VST1.32 D21,[R2]! + VST1.32 D16,[R2]! + VST1.32 D17,[R2]! + VST1.32 D22,[R2]! + VST1.32 D23,[R2]! + + @//D14-D20 - TOALLY HAVE 16 VALUES + @//WE NEED TO SHIFT R,G,B VALUES TO GET 5BIT,6BIT AND 5BIT COMBINATIONS + VADDW.U8 Q7,Q4,D28 @//Q7 - HAS Y + B + VADDW.U8 Q8,Q5,D28 @//Q2 - HAS Y + R + VADDW.U8 Q9,Q6,D28 @//Q3 - HAS Y + G + + VADDW.U8 Q10,Q4,D29 @//Q10 - HAS Y + B + VADDW.U8 Q11,Q5,D29 @//Q11 - HAS Y + R + VADDW.U8 Q12,Q6,D29 @//Q12 - HAS Y + G + + + VQMOVUN.S16 D14,Q7 + VQMOVUN.S16 D15,Q9 + VQMOVUN.S16 D16,Q8 + VMOV.I8 D17,#0 + + VZIP.8 D14,D15 + VZIP.8 D16,D17 + VZIP.16 Q7,Q8 + + + VQMOVUN.S16 D20,Q10 + VQMOVUN.S16 D21,Q12 + VQMOVUN.S16 D22,Q11 + VMOV.I8 D23,#0 + + VZIP.8 D20,D21 + VZIP.8 D22,D23 + VZIP.16 Q10,Q11 + + VZIP.32 Q7,Q10 + VZIP.32 Q8,Q11 + + VST1.32 D14,[R8]! + VST1.32 D15,[R8]! + VST1.32 D20,[R8]! + VST1.32 D21,[R8]! + VST1.32 D16,[R8]! + VST1.32 D17,[R8]! + VST1.32 D22,[R8]! + VST1.32 D23,[R8]! + + @// Adjust the address pointers + ADD R0,R7,R10 @// luma = luma_next + offset + ADD R2,R8,R14,LSL #2 @// rgb = rgb_next + offset + + ADD R7,R0,R3 @// luma_next = luma + width + ADD R8,R2,R3,LSL #2 @// rgb_next_row = rgb + width + + ADD R1,R1,R11 @// adjust u pointer + @ADD R2,R2,R12 @// adjust v pointer + + ADD R7,R7,R10 @// luma_next = luma + width + offset (because of register crunch) + ADD R8,R8,R14,LSL #2 @// rgb_next_row = rgb + width + offset + + SUBS R5,R5,#1 @// height_cnt -= 1 + + BNE LABEL_YUV420SP_TO_RGB8888_HEIGHT_LOOP + + @//POP THE REGISTERS + VPOP {d8-d15} + LDMFD SP!,{R4-R12,PC} + + + .section .note.GNU-stack,"",%progbits diff --git a/decoder/arm/ihevcd_function_selector.c b/decoder/arm/ihevcd_function_selector.c index 129af63..66c7d4d 100644 --- a/decoder/arm/ihevcd_function_selector.c +++ b/decoder/arm/ihevcd_function_selector.c @@ -58,6 +58,10 @@ #include "ihevcd_function_selector.h" #include "ihevcd_structs.h" +void ihevcd_init_function_ptr_neonintr(codec_t *ps_codec); +void ihevcd_init_function_ptr_noneon(codec_t *ps_codec); +void ihevcd_init_function_ptr_a9q(codec_t *ps_codec); +void ihevcd_init_function_ptr_av8(codec_t *ps_codec); void ihevcd_init_function_ptr(void *pv_codec) { codec_t *ps_codec = (codec_t *)pv_codec; @@ -67,11 +71,11 @@ void ihevcd_init_function_ptr(void *pv_codec) { #ifndef DISABLE_NEONINTR case ARCH_ARM_NEONINTR: - ihevcd_init_function_ptr_neonintr(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_neonintr(ps_codec); break; #endif case ARCH_ARM_NONEON: - ihevcd_init_function_ptr_noneon(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_noneon(ps_codec); break; default: case ARCH_ARM_A5: @@ -80,9 +84,9 @@ void ihevcd_init_function_ptr(void *pv_codec) case ARCH_ARM_A15: case ARCH_ARM_A9Q: #ifndef DISABLE_NEON - ihevcd_init_function_ptr_a9q(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_a9q(ps_codec); #else - ihevcd_init_function_ptr_noneon(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_noneon(ps_codec); #endif break; } @@ -102,17 +106,12 @@ void ihevcd_init_function_ptr(void *pv_codec) switch(ps_codec->e_processor_arch) { case ARCH_ARM_NONEON: - ihevcd_init_function_ptr_noneon(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_noneon(ps_codec); break; case ARCH_ARMV8_GENERIC: default: -#ifdef DARWIN - ihevcd_init_function_ptr_noneon(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_av8(ps_codec); break; -#else - ihevcd_init_function_ptr_av8(&ps_codec->s_func_selector); - break; -#endif } #endif } diff --git a/decoder/arm/ihevcd_function_selector_a9q.c b/decoder/arm/ihevcd_function_selector_a9q.c index a22a925..ea5b8c0 100644 --- a/decoder/arm/ihevcd_function_selector_a9q.c +++ b/decoder/arm/ihevcd_function_selector_a9q.c @@ -54,113 +54,107 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_a9q(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_a9q(codec_t *ps_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_a9q; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_a9q; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_a9q; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_a9q; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_a9q; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_a9q; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_a9q; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_a9q; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_a9q; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_a9q; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_a9q; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_a9q; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_a9q; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_a9q; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_a9q; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_a9q; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_a9q; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_a9q; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_a9q; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_a9q; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution_a9q; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution_a9q; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_neonintr; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_a9q; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_a9q; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_a9q; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_a9q; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_a9q; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_a9q; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_a9q; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_a9q; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_a9q; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_a9q; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_a9q; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_a9q; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_a9q; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_a9q; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_a9q; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8_a9q; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy_a9q; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8_a9q; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset_a9q; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_a9q; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit_a9q; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma_a9q; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma_a9q; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma_a9q; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma_a9q; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_a9q; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_a9q; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_a9q; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_neonintr; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_neonintr; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_neonintr; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_a9q; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_a9q; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_a9q; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_a9q; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_a9q; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_a9q; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_a9q; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_a9q; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_a9q; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_a9q; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_a9q; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_a9q; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_a9q; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_a9q; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_a9q; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_a9q; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_a9q; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_neonintr; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_a9q; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_a9q; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_a9q; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_a9q; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_a9q; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_a9q; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_a9q; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8_a9q; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy_a9q; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8_a9q; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset_a9q; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_a9q; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit_a9q; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma_a9q; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma_a9q; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma_a9q; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma_a9q; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_a9q; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_a9q; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_a9q; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_neonintr; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_neonintr; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_neonintr; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_a9q; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_a9q; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_a9q; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888_a9q; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_a9q; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_a9q; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_a9q; } diff --git a/decoder/arm/ihevcd_function_selector_noneon.c b/decoder/arm/ihevcd_function_selector_noneon.c index b545587..b5c9f6a 100644 --- a/decoder/arm/ihevcd_function_selector_noneon.c +++ b/decoder/arm/ihevcd_function_selector_noneon.c @@ -54,113 +54,107 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_noneon(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_noneon(codec_t *ps_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; } diff --git a/decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s b/decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s index 2edaebf..4cc6085 100644 --- a/decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s +++ b/decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s @@ -34,9 +34,10 @@ //* //*******************************************************************************/ -.include "ihevc_neon_macros.s" .text +.include "ihevc_neon_macros.s" + @@ -83,7 +84,7 @@ .type ihevcd_fmt_conv_420sp_to_420p_av8, %function -ENTRY ihevcd_fmt_conv_420sp_to_420p_av8 +ihevcd_fmt_conv_420sp_to_420p_av8: // STMFD sp!,{x4-x12, x14} push_v_regs stp x19, x20,[sp,#-16]! @@ -199,7 +200,6 @@ exit: // LDMFD sp!,{x4-x12, pc} ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s b/decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s index 6a070d4..ccf47a5 100644 --- a/decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s +++ b/decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s @@ -39,9 +39,10 @@ // // PRESERVE8 +.text +.p2align 2 .include "ihevc_neon_macros.s" -.text @@ -84,7 +85,7 @@ .global ihevcd_fmt_conv_420sp_to_420sp_av8 .type ihevcd_fmt_conv_420sp_to_420sp_a9q, %function -ENTRY ihevcd_fmt_conv_420sp_to_420sp_av8 +ihevcd_fmt_conv_420sp_to_420sp_av8: // STMFD sp!,{x4-x12, x14} push_v_regs @@ -199,7 +200,6 @@ exit: // LDMFD sp!,{x4-x12, pc} ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s b/decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s new file mode 100644 index 0000000..026b65f --- /dev/null +++ b/decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s @@ -0,0 +1,528 @@ +///***************************************************************************** +//* +//* Copyright (C) 2012 Ittiam Systems Pvt Ltd, Bangalore +//* +//* Licensed under the Apache License, Version 2.0 (the "License"); +//* you may not use this file except in compliance with the License. +//* You may obtain a copy of the License at: +//* +//* http://www.apache.org/licenses/LICENSE-2.0 +//* +//* Unless required by applicable law or agreed to in writing, software +//* distributed under the License is distributed on an "AS IS" BASIS, +//* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +//* See the License for the specific language governing permissions and +//* limitations under the License. +//* +//*****************************************************************************/ +///** +///******************************************************************************* +//* //file +//* ihevcd_fmt_conv_420sp_to_rgba8888.s +//* +//* //brief +//* contains function definitions for format conversions +//* +//* //author +//* ittiam +//* +//* //par list of functions: +//* +//* +//* //remarks +//* none +//* +//*******************************************************************************/ + + .equ DO1STROUNDING, 0 + + // ARM + // + // PRESERVE8 + +.text +.p2align 2 + +.include "ihevc_neon_macros.s" + + + +///***************************************************************************** +//* * +//* Function Name : ihevcd_fmt_conv_420sp_to_rgba8888() * +//* * +//* Description : This function conversts the image from YUV422 color * +//* space to RGB888 color space. The function can be * +//* invoked at the MB level. * +//* * +//* Arguments : x0 pubY * +//* x1 pubUV * +//* x2 pusRGB * +//* x3 pusRGB * +//* [x13 #40] usHeight * +//* [x13 #44] usWidth * +//* [x13 #48] usStrideY * +//* [x13 #52] usStrideU * +//* [x13 #56] usStrideV * +//* [x13 #60] usStrideRGB * +//* * +//* Values Returned : None * +//* * +//* Register Usage : x0 - x14 * +//* * +//* Stack Usage : 40 Bytes * +//* * +//* Interruptibility : Interruptible * +//* * +//* Known Limitations * +//* Assumptions: Image Width: Assumed to be multiple of 16 and * +//* greater than or equal to 16 * +//* Image Height: Assumed to be even. * +//* * +//* Revision History : * +//* DD MM YYYY Author(s) Changes (Describe the changes made) * +//* 07 06 2010 Varshita Draft * +//* 07 06 2010 Naveen Kr T Completed * +//* 05 08 2013 Naveen K P Modified for HEVC * +//*****************************************************************************/ + .global ihevcd_fmt_conv_420sp_to_rgba8888_av8 +.type ihevcd_fmt_conv_420sp_to_rgba8888_av8, function +ihevcd_fmt_conv_420sp_to_rgba8888_av8: + + //// push the registers on the stack + // STMFD sp!,{x4-x12,x14} + + stp d12,d14,[sp,#-16]! + stp d8,d15,[sp,#-16]! // Storing d15 using { sub sp,sp,#8; str d15,[sp] } is giving bus error. + // d8 is used as dummy register and stored along with d15 using stp. d8 is not used in the function. + stp x19, x20,[sp,#-16]! + + + ////x0 - Y PTR + ////x1 - UV PTR + ////x2 - RGB PTR + ////x3 - RGB PTR + ////x4 - PIC WIDTH + ////x5 - PIC HT + ////x6 - STRIDE Y + ////x7 - STRIDE U + ////x8 - STRIDE V + ////x9 - STRIDE RGB + + ////ONE ROW PROCESSING AT A TIME + + ////THE FOUR CONSTANTS ARE: + ////C1=0x3311,C2=0xF379,C3=0xE5F8,C4=0x4092 + + //PLD [x0] + //PLD [x1] + //PLD [x2] + + + ///* can be loaded from a defined const type */ + mov x10,#0x3311 + mov v0.h[0], w10 ////C1 + + mov x10,#0xF379 + mov v0.h[1], w10 ////C2 + + mov x10,#0xE5F8 + mov v0.h[2], w10 ////C3 + + mov x10,#0x4092 + mov v0.h[3], w10 ////C4 + + ////LOAD CONSTANT 128 INTO A CORTEX REGISTER + MOV x10,#128 + dup v1.8b,w10 + + ////D0 HAS C1-C2-C3-C4 + //// load other parameters from stack + mov x9, x7 + mov x7, x6 + mov x6, x5 + mov x5, x4 + //LDR x4,[sp,#44] + //LDR x8,[sp,#52] + + //// calculate offsets, offset = stride - width + SUB x10,x6,x3 //// luma offset + SUB x11,x7,x3 + //, LSR #1 @// u offset + //SUB x12,x8,x3, LSR #1 @// v offset + SUB x14,x9,x3 //// rgb offset in pixels + + //// calculate height loop count + LSR x5, x5, #1 //// height_cnt = height / 16 + + //// create next row pointers for rgb and luma data + ADD x7,x0,x6 //// luma_next_row = luma + luma_stride + ADD x8,x2,x9,LSL #2 //// rgb_next_row = rgb + rgb_stride + +LABEL_YUV420SP_TO_RGB8888_HEIGHT_LOOP: + + ////LOAD VALUES OF U&V AND COMPUTE THE R,G,B WEIGHT VALUES. + LD1 {v2.8b, v3.8b},[x1],#16 ////LOAD 8 VALUES OF UV + ////VLD1.8 {D3},[x2]! @//LOAD 8 VALUES OF V + + //// calculate width loop count + LSR x6, x3, #4 //// width_cnt = width / 16 + + ////COMPUTE THE ACTUAL RGB VALUES,WE CAN DO TWO ROWS AT A TIME + ////LOAD VALUES OF Y 8-BIT VALUES + LD2 {v30.8b, v31.8b},[x0],#16 ////D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row 1 + ////D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + LD2 {v28.8b, v29.8b},[x7],#16 ////D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row2 + ////D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + + SUBS x6,x6,#1 + BEQ LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP_SKIP + +LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP: + //VMOV.I8 Q1,#128 + UZP1 v27.8b, v2.8b, v3.8b + UZP2 v3.8b, v2.8b, v3.8b + mov v2.d[0], v27.d[0] + + ////NEED TO SUBTRACT (U-128) AND (V-128) + ////(D2-D1),(D3-D1) + uSUBL v4.8h, v2.8b, v1.8b ////(U-128) + uSUBL v6.8h, v3.8b, v1.8b ////(V-128) + + ////LOAD VALUES OF U&V for next row + LD1 {v2.8b, v3.8b},[x1],#16 ////LOAD 8 VALUES OF U + ////VLD1.8 {D3},[x2]! @//LOAD 8 VALUES OF V + + //PLD [x0] + prfm PLDL1KEEP,[x1] + + ////NEED TO MULTIPLY WITH Q2,Q3 WITH CO-EEFICIENTS + sMULL v5.4s, v4.4h, v0.h[3] ////(U-128)*C4 FOR B + sMULL2 v7.4s, v4.8h, v0.h[3] ////(U-128)*C4 FOR B + + sMULL v20.4s, v6.4h, v0.h[0] ////(V-128)*C1 FOR R + sMULL2 v22.4s, v6.8h, v0.h[0] ////(V-128)*C1 FOR R + + sMULL v12.4s, v4.4h, v0.h[1] ////(U-128)*C2 FOR G + sMLAL v12.4s, v6.4h, v0.h[2] ////Q6 = (U-128)*C2 + (V-128)*C3 + sMULL2 v14.4s, v4.8h, v0.h[1] ////(U-128)*C2 FOR G + sMLAL2 v14.4s, v6.8h, v0.h[2] ////Q7 = (U-128)*C2 + (V-128)*C3 + + ////NARROW RIGHT SHIFT BY 13 FOR R&B + sqshrn v5.4h, v5.4s,#13 ////D8 = (U-128)*C4>>13 4 16-BIT VALUES + sqshrn2 v5.8h, v7.4s,#13 ////D9 = (U-128)*C4>>13 4 16-BIT VALUES + ////Q4 - WEIGHT FOR B + + ////NARROW RIGHT SHIFT BY 13 FOR R&B + sqshrn v7.4h, v20.4s,#13 ////D10 = (V-128)*C1>>13 4 16-BIT VALUES + sqshrn2 v7.8h, v22.4s,#13 ////D11 = (V-128)*C1>>13 4 16-BIT VALUES + ////Q5 - WEIGHT FOR R + + ////NARROW RIGHT SHIFT BY 13 FOR G + sqshrn v12.4h, v12.4s,#13 ////D12 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + sqshrn2 v12.8h, v14.4s,#13 ////D13 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + ////Q6 - WEIGHT FOR G + + UADDW v14.8h, v5.8h , v30.8b ////Q7 - HAS Y + B + UADDW v16.8h, v7.8h , v30.8b ////Q8 - HAS Y + R + UADDW v18.8h, v12.8h , v30.8b ////Q9 - HAS Y + G + + UADDW v20.8h, v5.8h , v31.8b ////Q10 - HAS Y + B + UADDW v22.8h, v7.8h , v31.8b ////Q11 - HAS Y + R + UADDW v24.8h, v12.8h , v31.8b ////Q12 - HAS Y + G + + sqxtun v14.8b, v14.8h + sqxtun v15.8b, v18.8h + sqxtun v16.8b, v16.8h + movi v17.8b, #0 + + sqxtun v20.8b, v20.8h + sqxtun v21.8b, v24.8h + sqxtun v22.8b, v22.8h + movi v23.8b, #0 + + ZIP1 v27.8b, v14.8b, v15.8b + ZIP2 v15.8b, v14.8b, v15.8b + mov v14.d[0], v27.d[0] + ZIP1 v27.8b, v16.8b, v17.8b + ZIP2 v17.8b, v16.8b, v17.8b + mov v16.d[0], v27.d[0] + + ZIP1 v27.8b, v20.8b, v21.8b + ZIP2 v21.8b, v20.8b, v21.8b + mov v20.d[0], v27.d[0] + ZIP1 v27.8b, v22.8b, v23.8b + ZIP2 v23.8b, v22.8b, v23.8b + mov v22.d[0], v27.d[0] + + mov v14.d[1], v15.d[0] + mov v20.d[1], v21.d[0] + mov v16.d[1], v17.d[0] + mov v22.d[1], v23.d[0] + + ZIP1 v27.8h, v14.8h, v16.8h + ZIP2 v26.8h, v14.8h, v16.8h + + ZIP1 v25.8h, v20.8h, v22.8h + ZIP2 v19.8h, v20.8h, v22.8h + + ZIP1 v14.4s, v27.4s, v25.4s + ZIP2 v20.4s, v27.4s, v25.4s + + ZIP1 v16.4s, v26.4s, v19.4s + ZIP2 v22.4s, v26.4s, v19.4s + + ST1 {v14.4s},[x2],#16 + ST1 {v20.4s},[x2],#16 + ST1 {v16.4s},[x2],#16 + ST1 {v22.4s},[x2],#16 + + ////D14-D20 - TOALLY HAVE 16 VALUES + ////WE NEED TO SHIFT R,G,B VALUES TO GET 5BIT,6BIT AND 5BIT COMBINATIONS + UADDW v14.8h, v5.8h , v28.8b ////Q7 - HAS Y + B + UADDW v16.8h, v7.8h , v28.8b ////Q2 - HAS Y + R + UADDW v18.8h, v12.8h , v28.8b ////Q3 - HAS Y + G + + UADDW v20.8h, v5.8h , v29.8b ////Q10 - HAS Y + B + UADDW v22.8h, v7.8h , v29.8b ////Q11 - HAS Y + R + UADDW v24.8h, v12.8h , v29.8b ////Q12 - HAS Y + G + + ////COMPUTE THE ACTUAL RGB VALUES,WE CAN DO TWO ROWS AT A TIME + ////LOAD VALUES OF Y 8-BIT VALUES + LD2 {v30.8b, v31.8b},[x0],#16 ////D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row 1 + ////D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + LD2 {v28.8b, v29.8b},[x7],#16 ////D0 - Y0,Y2,Y4,Y6,Y8,Y10,Y12,Y14 row2 + ////D1 - Y1,Y3,Y5,Y7,Y9,Y11,Y13,Y15 + + prfm PLDL1KEEP,[x0] + prfm PLDL1KEEP,[x7] + + sqxtun v14.8b, v14.8h + sqxtun v15.8b, v18.8h + sqxtun v16.8b, v16.8h + movi v17.8b, #0 + + sqxtun v20.8b, v20.8h + sqxtun v21.8b, v24.8h + sqxtun v22.8b, v22.8h + movi v23.8b, #0 + + ZIP1 v27.8b, v14.8b, v15.8b + ZIP2 v15.8b, v14.8b, v15.8b + mov v14.d[0], v27.d[0] + ZIP1 v27.8b, v16.8b, v17.8b + ZIP2 v17.8b, v16.8b, v17.8b + mov v16.d[0], v27.d[0] + + ZIP1 v27.8b, v20.8b, v21.8b + ZIP2 v21.8b, v20.8b, v21.8b + mov v20.d[0], v27.d[0] + ZIP1 v27.8b, v22.8b, v23.8b + ZIP2 v23.8b, v22.8b, v23.8b + mov v22.d[0], v27.d[0] + + mov v14.d[1], v15.d[0] + mov v20.d[1], v21.d[0] + mov v16.d[1], v17.d[0] + mov v22.d[1], v23.d[0] + + ZIP1 v27.8h, v14.8h, v16.8h + ZIP2 v26.8h, v14.8h, v16.8h + + ZIP1 v25.8h, v20.8h, v22.8h + ZIP2 v19.8h, v20.8h, v22.8h + + ZIP1 v14.4s, v27.4s, v25.4s + ZIP2 v20.4s, v27.4s, v25.4s + + ZIP1 v16.4s, v26.4s, v19.4s + ZIP2 v22.4s, v26.4s, v19.4s + + ST1 {v14.4s},[x8],#16 + ST1 {v20.4s},[x8],#16 + ST1 {v16.4s},[x8],#16 + ST1 {v22.4s},[x8],#16 + + SUBS x6,x6,#1 //// width_cnt -= 1 + BNE LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP + +LABEL_YUV420SP_TO_RGB8888_WIDTH_LOOP_SKIP: + //VMOV.I8 Q1,#128 + UZP1 v27.8b, v2.8b, v3.8b + UZP2 v3.8b, v2.8b, v3.8b + mov v2.d[0], v27.d[0] + + + ////NEED TO SUBTRACT (U-128) AND (V-128) + ////(D2-D1),(D3-D1) + uSUBL v4.8h, v2.8b, v1.8b ////(U-128) + uSUBL v6.8h, v3.8b, v1.8b ////(V-128) + + + ////NEED TO MULTIPLY WITH Q2,Q3 WITH CO-EEFICIENTS + sMULL v5.4s, v4.4h, v0.h[3] ////(U-128)*C4 FOR B + sMULL2 v7.4s, v4.8h, v0.h[3] ////(U-128)*C4 FOR B + + sMULL v20.4s, v6.4h, v0.h[0] ////(V-128)*C1 FOR R + sMULL2 v22.4s, v6.8h, v0.h[0] ////(V-128)*C1 FOR R + + sMULL v12.4s, v4.4h, v0.h[1] ////(U-128)*C2 FOR G + sMLAL v12.4s, v6.4h, v0.h[2] ////Q6 = (U-128)*C2 + (V-128)*C3 + sMULL2 v14.4s, v4.8h, v0.h[1] ////(U-128)*C2 FOR G + sMLAL2 v14.4s, v6.8h, v0.h[2] ////Q7 = (U-128)*C2 + (V-128)*C3 + + ////NARROW RIGHT SHIFT BY 13 FOR R&B + sqshrn v5.4h, v5.4s,#13 ////D8 = (U-128)*C4>>13 4 16-BIT VALUES + sqshrn2 v5.8h, v7.4s,#13 ////D9 = (U-128)*C4>>13 4 16-BIT VALUES + ////Q4 - WEIGHT FOR B + + ////NARROW RIGHT SHIFT BY 13 FOR R&B + sqshrn v7.4h, v20.4s,#13 ////D10 = (V-128)*C1>>13 4 16-BIT VALUES + sqshrn2 v7.8h, v22.4s,#13 ////D11 = (V-128)*C1>>13 4 16-BIT VALUES + ////Q5 - WEIGHT FOR R + + ////NARROW RIGHT SHIFT BY 13 FOR G + sqshrn v12.4h, v12.4s,#13 ////D12 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + sqshrn2 v12.8h, v14.4s,#13 ////D13 = [(U-128)*C2 + (V-128)*C3]>>13 4 16-BIT VALUES + ////Q6 - WEIGHT FOR G + + UADDW v14.8h, v5.8h , v30.8b ////Q7 - HAS Y + B + UADDW v16.8h, v7.8h , v30.8b ////Q8 - HAS Y + R + UADDW v18.8h, v12.8h , v30.8b ////Q9 - HAS Y + G + + UADDW v20.8h, v5.8h , v31.8b ////Q10 - HAS Y + B + UADDW v22.8h, v7.8h , v31.8b ////Q11 - HAS Y + R + UADDW v24.8h, v12.8h , v31.8b ////Q12 - HAS Y + G + + sqxtun v14.8b, v14.8h + sqxtun v15.8b, v18.8h + sqxtun v16.8b, v16.8h + movi v17.8b, #0 + + sqxtun v20.8b, v20.8h + sqxtun v21.8b, v24.8h + sqxtun v22.8b, v22.8h + movi v23.8b, #0 + + ZIP1 v27.8b, v14.8b, v15.8b + ZIP2 v15.8b, v14.8b, v15.8b + mov v14.d[0], v27.d[0] + ZIP1 v27.8b, v16.8b, v17.8b + ZIP2 v17.8b, v16.8b, v17.8b + mov v16.d[0], v27.d[0] + + ZIP1 v27.8b, v20.8b, v21.8b + ZIP2 v21.8b, v20.8b, v21.8b + mov v20.d[0], v27.d[0] + ZIP1 v27.8b, v22.8b, v23.8b + ZIP2 v23.8b, v22.8b, v23.8b + mov v22.d[0], v27.d[0] + + mov v14.d[1], v15.d[0] + mov v20.d[1], v21.d[0] + mov v16.d[1], v17.d[0] + mov v22.d[1], v23.d[0] + + ZIP1 v27.8h, v14.8h, v16.8h + ZIP2 v26.8h, v14.8h, v16.8h + + ZIP1 v25.8h, v20.8h, v22.8h + ZIP2 v19.8h, v20.8h, v22.8h + + ZIP1 v14.4s, v27.4s, v25.4s + ZIP2 v20.4s, v27.4s, v25.4s + + ZIP1 v16.4s, v26.4s, v19.4s + ZIP2 v22.4s, v26.4s, v19.4s + + ST1 {v14.4s},[x2],#16 + ST1 {v20.4s},[x2],#16 + ST1 {v16.4s},[x2],#16 + ST1 {v22.4s},[x2],#16 + + ////D14-D20 - TOALLY HAVE 16 VALUES + ////WE NEED TO SHIFT R,G,B VALUES TO GET 5BIT,6BIT AND 5BIT COMBINATIONS + UADDW v14.8h, v5.8h , v28.8b ////Q7 - HAS Y + B + UADDW v16.8h, v7.8h , v28.8b ////Q2 - HAS Y + R + UADDW v18.8h, v12.8h , v28.8b ////Q3 - HAS Y + G + + UADDW v20.8h, v5.8h , v29.8b ////Q10 - HAS Y + B + UADDW v22.8h, v7.8h , v29.8b ////Q11 - HAS Y + R + UADDW v24.8h, v12.8h , v29.8b ////Q12 - HAS Y + G + + sqxtun v14.8b, v14.8h + sqxtun v15.8b, v18.8h + sqxtun v16.8b, v16.8h + movi v17.8b, #0 + + sqxtun v20.8b, v20.8h + sqxtun v21.8b, v24.8h + sqxtun v22.8b, v22.8h + movi v23.8b, #0 + + ZIP1 v27.8b, v14.8b, v15.8b + ZIP2 v15.8b, v14.8b, v15.8b + mov v14.d[0], v27.d[0] + ZIP1 v27.8b, v16.8b, v17.8b + ZIP2 v17.8b, v16.8b, v17.8b + mov v16.d[0], v27.d[0] + + ZIP1 v27.8b, v20.8b, v21.8b + ZIP2 v21.8b, v20.8b, v21.8b + mov v20.d[0], v27.d[0] + ZIP1 v27.8b, v22.8b, v23.8b + ZIP2 v23.8b, v22.8b, v23.8b + mov v22.d[0], v27.d[0] + + mov v14.d[1], v15.d[0] + mov v20.d[1], v21.d[0] + mov v16.d[1], v17.d[0] + mov v22.d[1], v23.d[0] + + ZIP1 v27.8h, v14.8h, v16.8h + ZIP2 v26.8h, v14.8h, v16.8h + + ZIP1 v25.8h, v20.8h, v22.8h + ZIP2 v19.8h, v20.8h, v22.8h + + ZIP1 v14.4s, v27.4s, v25.4s + ZIP2 v20.4s, v27.4s, v25.4s + + ZIP1 v16.4s, v26.4s, v19.4s + ZIP2 v22.4s, v26.4s, v19.4s + + ST1 {v14.4s},[x8],#16 + ST1 {v20.4s},[x8],#16 + ST1 {v16.4s},[x8],#16 + ST1 {v22.4s},[x8],#16 + + //// Adjust the address pointers + ADD x0,x7,x10 //// luma = luma_next + offset + ADD x2,x8,x14,LSL #2 //// rgb = rgb_next + offset + + ADD x7,x0,x3 //// luma_next = luma + width + ADD x8,x2,x3,LSL #2 //// rgb_next_row = rgb + width + + ADD x1,x1,x11 //// adjust u pointer + //ADD x2,x2,x12 @// adjust v pointer + + ADD x7,x7,x10 //// luma_next = luma + width + offset (because of register crunch) + ADD x8,x8,x14,LSL #2 //// rgb_next_row = rgb + width + offset + + SUBS x5,x5,#1 //// height_cnt -= 1 + + BNE LABEL_YUV420SP_TO_RGB8888_HEIGHT_LOOP + + ////POP THE REGISTERS + // LDMFD sp!,{x4-x12,PC} + ldp x19, x20,[sp],#16 + ldp d8,d15,[sp],#16 // Loading d15 using { ldr d15,[sp]; add sp,sp,#8 } is giving bus error. + // d8 is used as dummy register and loaded along with d15 using ldp. d8 is not used in the function. + ldp d12,d14,[sp],#16 + ret + + + + + .section .note.GNU-stack,"",%progbits + diff --git a/decoder/arm64/ihevcd_function_selector_av8.c b/decoder/arm64/ihevcd_function_selector_av8.c index 0556b09..210c730 100644 --- a/decoder/arm64/ihevcd_function_selector_av8.c +++ b/decoder/arm64/ihevcd_function_selector_av8.c @@ -54,113 +54,107 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_av8(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_av8(codec_t *ps_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_av8; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_av8; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_av8; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_av8; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_av8; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_av8; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_av8; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_av8; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_av8; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_av8; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_av8; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_av8; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_av8; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_av8; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_av8; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_av8; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_av8; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_av8; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_av8; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_av8; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_neonintr; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_av8; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_av8; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_av8; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_av8; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_av8; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_av8; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_av8; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_av8; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_av8; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_av8; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_av8; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_av8; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_av8; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_av8; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_av8; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_av8; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_av8; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_av8; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_av8; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_av8; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8_av8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy_av8; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8_av8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset_av8; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_av8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit_av8; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma_av8; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma_av8; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma_av8; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma_av8; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_av8; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_av8; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_av8; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_neonintr; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_neonintr; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_neonintr; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_av8; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_av8; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_av8; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_av8; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_av8; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_av8; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_av8; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_av8; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_av8; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_av8; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp_av8; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_av8; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_av8; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_av8; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_av8; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_av8; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_av8; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_av8; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_neonintr; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_av8; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_av8; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_av8; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_av8; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_av8; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_av8; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_av8; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_av8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8_av8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy_av8; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8_av8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset_av8; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8_av8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit_av8; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma_av8; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma_av8; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma_av8; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma_av8; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_av8; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_av8; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_av8; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_neonintr; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_neonintr; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_neonintr; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_av8; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_av8; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_av8; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888_av8; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp_av8; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_av8; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_av8; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_av8; } diff --git a/decoder/arm64/ihevcd_itrans_recon_dc_chroma.s b/decoder/arm64/ihevcd_itrans_recon_dc_chroma.s index 6c6793c..9d1e8a4 100644 --- a/decoder/arm64/ihevcd_itrans_recon_dc_chroma.s +++ b/decoder/arm64/ihevcd_itrans_recon_dc_chroma.s @@ -35,15 +35,15 @@ //*******************************************************************************/ -.include "ihevc_neon_macros.s" .text +.include "ihevc_neon_macros.s" .globl ihevcd_itrans_recon_dc_chroma_av8 .type ihevcd_itrans_recon_dc_chroma_av8, %function -ENTRY ihevcd_itrans_recon_dc_chroma_av8 +ihevcd_itrans_recon_dc_chroma_av8: //void ihevcd_itrans_recon_dc_chroma(uword8 *pu1_pred, // uword8 *pu1_dst, @@ -215,7 +215,6 @@ col_loop_4chroma: end_loops_chroma: ldp x19, x20,[sp],#16 pop_v_regs - EXIT_FUNC ret diff --git a/decoder/arm64/ihevcd_itrans_recon_dc_luma.s b/decoder/arm64/ihevcd_itrans_recon_dc_luma.s index d0552c0..edc70e7 100644 --- a/decoder/arm64/ihevcd_itrans_recon_dc_luma.s +++ b/decoder/arm64/ihevcd_itrans_recon_dc_luma.s @@ -34,8 +34,8 @@ //* //*******************************************************************************/ -.include "ihevc_neon_macros.s" .text +.include "ihevc_neon_macros.s" @@ -43,7 +43,7 @@ .type ihevcd_itrans_recon_dc_luma_av8, %function -ENTRY ihevcd_itrans_recon_dc_luma_av8 +ihevcd_itrans_recon_dc_luma_av8: //void ihevcd_itrans_recon_dc_luma(uword8 *pu1_pred, // uword8 *pu1_dst, @@ -207,7 +207,6 @@ col_loop_4: end_loops: ldp x19, x20,[sp],#16 - EXIT_FUNC ret diff --git a/decoder/ihevcd_api.c b/decoder/ihevcd_api.c index 7be6632..5f6d149 100644 --- a/decoder/ihevcd_api.c +++ b/decoder/ihevcd_api.c @@ -226,16 +226,14 @@ static IV_API_CALL_STATUS_T api_check_struct_sanity(iv_obj_t *ps_handle, if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) + && (ps_ip->s_ivd_create_ip_t.e_output_format + != IV_YUV_422ILE) + && (ps_ip->s_ivd_create_ip_t.e_output_format + != IV_RGB_565) && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) && (ps_ip->s_ivd_create_ip_t.e_output_format - != IV_YUV_420SP_VU) - && (ps_ip->s_ivd_create_ip_t.e_output_format - != IV_GRAY) - && (ps_ip->s_ivd_create_ip_t.e_output_format - != IV_YUV_444P) - && (ps_ip->s_ivd_create_ip_t.e_output_format - != IV_YUV_422P)) + != IV_YUV_420SP_VU)) { ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM; @@ -245,19 +243,6 @@ static IV_API_CALL_STATUS_T api_check_struct_sanity(iv_obj_t *ps_handle, return (IV_FAIL); } - /* Shared display mode is supported only for 420SP and 420P formats */ - if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) - && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) - && (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU) - && ps_ip->s_ivd_create_ip_t.u4_share_disp_buf == 1) - { - ps_op->s_ivd_create_op_t.u4_error_code |= 1 - << IVD_UNSUPPORTEDPARAM; - ps_op->s_ivd_create_op_t.u4_error_code |= - IVD_INIT_DEC_FAILED; - return (IV_FAIL); - } - } break; @@ -982,13 +967,6 @@ void ihevcd_update_function_ptr(codec_t *ps_codec) ps_codec->apf_intra_pred_chroma[9] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr; ps_codec->apf_intra_pred_chroma[10] = (pf_intra_pred)ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr; - /* Init itrans res function array */ - ps_codec->apf_itrans_res[0] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_ttype1_fptr; - ps_codec->apf_itrans_res[1] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_4x4_fptr; - ps_codec->apf_itrans_res[2] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_8x8_fptr; - ps_codec->apf_itrans_res[3] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_16x16_fptr; - ps_codec->apf_itrans_res[4] = (pf_itrans_res)ps_codec->s_func_selector.ihevc_itrans_res_32x32_fptr; - /* Init itrans_recon function array */ ps_codec->apf_itrans_recon[0] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr; ps_codec->apf_itrans_recon[1] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr; @@ -998,7 +976,6 @@ void ihevcd_update_function_ptr(codec_t *ps_codec) ps_codec->apf_itrans_recon[5] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr; ps_codec->apf_itrans_recon[6] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr; ps_codec->apf_itrans_recon[7] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr; - ps_codec->apf_itrans_recon[8] = (pf_itrans_recon)ps_codec->s_func_selector.ihevc_chroma_itrans_recon_32x32_fptr; /* Init recon function array */ ps_codec->apf_recon[0] = (pf_recon)ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr; @@ -1009,14 +986,11 @@ void ihevcd_update_function_ptr(codec_t *ps_codec) ps_codec->apf_recon[5] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr; ps_codec->apf_recon[6] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr; ps_codec->apf_recon[7] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr; - ps_codec->apf_recon[8] = (pf_recon)ps_codec->s_func_selector.ihevc_chroma_recon_32x32_fptr; /* Init itrans_recon_dc function array */ ps_codec->apf_itrans_recon_dc[0] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr; ps_codec->apf_itrans_recon_dc[1] = (pf_itrans_recon_dc)ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr; - ps_codec->apf_itrans_res_dc = (pf_itrans_res_dc)ps_codec->s_func_selector.ihevcd_itrans_res_dc_fptr; - /* Init sao function array */ ps_codec->apf_sao_luma[0] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr; ps_codec->apf_sao_luma[1] = (pf_sao_luma)ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr; @@ -1416,31 +1390,19 @@ WORD32 ihevcd_allocate_static_bufs(iv_obj_t **pps_codec_obj, { WORD32 inter_pred_tmp_buf_size, ntaps_luma; -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 res_buf_size; -#endif WORD32 pic_pu_idx_map_size; /* Max inter pred size */ ntaps_luma = 8; - // For yuv 4:4:4 chroma the inter pred buffer size for one CTB will be double of luma - inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE * 2; + inter_pred_tmp_buf_size = sizeof(WORD16) * (MAX_CTB_SIZE + ntaps_luma) * MAX_CTB_SIZE; inter_pred_tmp_buf_size = ALIGN64(inter_pred_tmp_buf_size); -#ifdef ENABLE_MAIN_REXT_PROFILE - res_buf_size = sizeof(WORD16) * (MAX_TU_SIZE * MAX_TU_SIZE); - res_buf_size = ALIGN64(res_buf_size); -#endif - /* To hold pu_index w.r.t. frame level pu_t array for a CTB */ pic_pu_idx_map_size = sizeof(WORD32) * (18 * 18); pic_pu_idx_map_size = ALIGN64(pic_pu_idx_map_size); size = inter_pred_tmp_buf_size * 2; -#ifdef ENABLE_MAIN_REXT_PROFILE - size += (res_buf_size * 4); -#endif size += pic_pu_idx_map_size; size *= MAX_PROCESS_THREADS; @@ -1456,17 +1418,6 @@ WORD32 ihevcd_allocate_static_bufs(iv_obj_t **pps_codec_obj, ps_codec->as_process[i].pi2_inter_pred_tmp_buf2 = (WORD16 *)pu1_buf; pu1_buf += inter_pred_tmp_buf_size; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_codec->as_process[i].pi2_res_luma_buf = (WORD16 *)pu1_buf; - pu1_buf += res_buf_size; - - ps_codec->as_process[i].pi2_res_chroma_buf = (WORD16 *)pu1_buf; - pu1_buf += res_buf_size; - - ps_codec->as_process[i].pi2_invscan_out_subtu = (WORD16 *)pu1_buf; - pu1_buf += (res_buf_size * 2); -#endif - /* Inverse transform intermediate and inverse scan output buffers reuse inter pred scratch buffers */ ps_codec->as_process[i].pi2_itrans_intrmd_buf = ps_codec->as_process[i].pi2_inter_pred_tmp_buf2; @@ -1816,62 +1767,41 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) memset(ps_codec->as_process[0].pu4_pic_pu_idx_top, 0, sizeof(UWORD32) * (wd / 4 + 1)); { - sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id); - /* To hold SAO left buffer for luma */ size = sizeof(UWORD8) * (MAX(ht, wd)); /* To hold SAO left buffer for chroma */ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * (MAX(ht, wd)); - } + size += sizeof(UWORD8) * (MAX(ht, wd)); /* To hold SAO top buffer for luma */ size += sizeof(UWORD8) * wd; /* To hold SAO top buffer for chroma */ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * wd; - } + size += sizeof(UWORD8) * wd; /* To hold SAO top left luma pixel value for last output ctb in a row*/ size += sizeof(UWORD8) * max_ctb_rows; /* To hold SAO top left chroma pixel value last output ctb in a row*/ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * max_ctb_rows * 2; - } + size += sizeof(UWORD8) * max_ctb_rows * 2; /* To hold SAO top left pixel luma for current ctb - column array*/ size += sizeof(UWORD8) * max_ctb_rows; /* To hold SAO top left pixel chroma for current ctb-column array*/ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * max_ctb_rows * 2; - } + size += sizeof(UWORD8) * max_ctb_rows * 2; /* To hold SAO top right pixel luma pixel value last output ctb in a row*/ size += sizeof(UWORD8) * max_ctb_cols; /* To hold SAO top right pixel chroma pixel value last output ctb in a row*/ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * max_ctb_cols * 2; - } + size += sizeof(UWORD8) * max_ctb_cols * 2; /*To hold SAO botton bottom left pixels for luma*/ size += sizeof(UWORD8) * max_ctb_rows; - /*To hold SAO botton bottom left pixels for chroma*/ - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - size += sizeof(UWORD8) * max_ctb_rows * 2; - } - + /*To hold SAO botton bottom left pixels for luma*/ + size += sizeof(UWORD8) * max_ctb_rows * 2; size = ALIGN64(size); pu1_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size); @@ -1885,16 +1815,12 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_luma = (UWORD8 *)pu1_buf; pu1_buf += MAX(ht, wd); - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf; - pu1_buf += MAX(ht, wd); + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf; } - + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_left_chroma = (UWORD8 *)pu1_buf; + pu1_buf += MAX(ht, wd); for(i = 0; i < MAX_PROCESS_THREADS; i++) { ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf; @@ -1902,16 +1828,12 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_luma = (UWORD8 *)pu1_buf; pu1_buf += wd; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf; - pu1_buf += wd; + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf; } - + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_chroma = (UWORD8 *)pu1_buf; + pu1_buf += wd; for(i = 0; i < MAX_PROCESS_THREADS; i++) { ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf; @@ -1919,15 +1841,12 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_luma_top_left_ctb = (UWORD8 *)pu1_buf; pu1_buf += ht / MIN_CTB_SIZE; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf; - pu1_buf += (ht / MIN_CTB_SIZE) * 2; + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf; } + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_chroma_top_left_ctb = (UWORD8 *)pu1_buf; + pu1_buf += (ht / MIN_CTB_SIZE) * 2; for(i = 0; i < MAX_PROCESS_THREADS; i++) { @@ -1936,32 +1855,27 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_curr_ctb = (UWORD8 *)pu1_buf; pu1_buf += ht / MIN_CTB_SIZE; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf; - pu1_buf += (ht / MIN_CTB_SIZE) * 2; + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf; } + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_curr_ctb = (UWORD8 *)pu1_buf; + pu1_buf += (ht / MIN_CTB_SIZE) * 2; for(i = 0; i < MAX_PROCESS_THREADS; i++) { ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf; } ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_top_right = (UWORD8 *)pu1_buf; - pu1_buf += wd / MIN_CTB_SIZE; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + pu1_buf += wd / MIN_CTB_SIZE; + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf; - pu1_buf += (wd / MIN_CTB_SIZE) * 2; + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf; } + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_top_right = (UWORD8 *)pu1_buf; + + pu1_buf += (wd / MIN_CTB_SIZE) * 2; /*Per CTB, Store 1 value for luma , 2 values for chroma*/ for(i = 0; i < MAX_PROCESS_THREADS; i++) @@ -1969,17 +1883,16 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf; } ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_luma_bot_left = (UWORD8 *)pu1_buf; + pu1_buf += (ht / MIN_CTB_SIZE); - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + for(i = 0; i < MAX_PROCESS_THREADS; i++) { - for(i = 0; i < MAX_PROCESS_THREADS; i++) - { - ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf; - } - ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf; - pu1_buf += (ht / MIN_CTB_SIZE) * 2; + ps_codec->as_process[i].s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf; } + ps_codec->s_parse.s_sao_ctxt.pu1_sao_src_top_left_chroma_bot_left = (UWORD8 *)pu1_buf; + + pu1_buf += (ht / MIN_CTB_SIZE) * 2; } @@ -2118,38 +2031,20 @@ WORD32 ihevcd_allocate_dynamic_bufs(codec_t *ps_codec) ps_codec->as_process[i].s_sao_ctxt.ps_pic_sao = ps_codec->s_parse.ps_pic_sao; } - /* Only if (frame size * compression factor) is greater than MIN_BITSBUF_SIZE, + /* Only if width * height * 3 / 2 is greater than MIN_BITSBUF_SIZE, then allocate dynamic bistream buffer */ ps_codec->pu1_bitsbuf_dynamic = NULL; + size = wd * ht; + if(size > MIN_BITSBUF_SIZE) { - sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id); - - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - size = wd * ht * 3; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - size = wd * ht * 2; - } - else - { - size = wd * ht; - } - - if(size > MIN_BITSBUF_SIZE) - { - //Alloc extra for parse optimization - pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); - RETURN_IF((NULL == pv_buf), IV_FAIL); - - memset(pv_buf, 0, size + 16); - ps_codec->pu1_bitsbuf_dynamic = pv_buf; - ps_codec->u4_bitsbuf_size_dynamic = size; - } + pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size + 16); //Alloc extra for parse optimization + RETURN_IF((NULL == pv_buf), IV_FAIL); + memset(pv_buf, 0, size + 16); + ps_codec->pu1_bitsbuf_dynamic = pv_buf; + ps_codec->u4_bitsbuf_size_dynamic = size; } - size = ihevcd_get_tu_data_size(ps_codec, wd * ht); + size = ihevcd_get_tu_data_size(wd * ht); pv_buf = ps_codec->pf_aligned_alloc(pv_mem_ctxt, 128, size); RETURN_IF((NULL == pv_buf), IV_FAIL); memset(pv_buf, 0, size); @@ -2370,10 +2265,6 @@ WORD32 ihevcd_create(iv_obj_t *ps_codec_obj, return IV_FAIL; } ps_codec = (codec_t *)ps_codec_obj->pv_codec_handle; - if (ps_create_ip->u4_enable_yuv_formats == 0) { - ps_create_ip->u4_enable_yuv_formats = 1 << CHROMA_FMT_IDC_YUV420; - } - ps_codec->u4_enable_yuv_formats = ps_create_ip->u4_enable_yuv_formats; ret = ihevcd_init(ps_codec); TRACE_INIT(NULL); @@ -2643,15 +2534,15 @@ WORD32 ihevcd_get_status(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_num_in_bufs = MIN_IN_BUFS; if(ps_codec->e_chroma_fmt == IV_YUV_420P) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420; - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_444; - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_422; + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE; + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565; + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_RGBA8888; else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420SP; - else if(ps_codec->e_chroma_fmt == IV_GRAY) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_GRAY; ps_ctl_op->u4_num_disp_bufs = 1; @@ -2716,11 +2607,23 @@ WORD32 ihevcd_get_status(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 2; ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht) >> 2; } - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht); + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 2; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + { + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 2; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + { + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 4; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) @@ -2729,18 +2632,6 @@ WORD32 ihevcd_get_status(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 1; ps_ctl_op->u4_min_out_buf_size[2] = 0; } - else if(ps_codec->e_chroma_fmt == IV_GRAY) - { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = 0; - ps_ctl_op->u4_min_out_buf_size[2] = 0; - } - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 1; - ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht) >> 1; - } ps_ctl_op->u4_pic_ht = ht; ps_ctl_op->u4_pic_wd = wd; ps_ctl_op->u4_frame_rate = 30000; @@ -2803,15 +2694,15 @@ WORD32 ihevcd_get_buf_info(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_num_in_bufs = MIN_IN_BUFS; if(ps_codec->e_chroma_fmt == IV_YUV_420P) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420; - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_444; - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_422; + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE; + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565; + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_RGBA8888; else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_420SP; - else if(ps_codec->e_chroma_fmt == IV_GRAY) - ps_ctl_op->u4_min_num_out_bufs = MIN_OUT_BUFS_GRAY; ps_ctl_op->u4_num_disp_bufs = 1; @@ -2820,25 +2711,7 @@ WORD32 ihevcd_get_buf_info(iv_obj_t *ps_codec_obj, wd = ALIGN64(ps_codec->i4_wd); ht = ALIGN64(ps_codec->i4_ht); - if(ps_codec->i4_sps_done) - { - sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id); - - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht * 3), MIN_BITSBUF_SIZE); - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht * 2), MIN_BITSBUF_SIZE); - else - ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht), MIN_BITSBUF_SIZE); - } - else - { -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht * 3), MIN_BITSBUF_SIZE); -#else - ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht), MIN_BITSBUF_SIZE); -#endif - } + ps_ctl_op->u4_min_in_buf_size[i] = MAX((wd * ht), MIN_BITSBUF_SIZE); } wd = 0; @@ -2904,11 +2777,23 @@ WORD32 ihevcd_get_buf_info(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 2; ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht) >> 2; } - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht); + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 2; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + { + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 2; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + { + ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht) * 4; + ps_ctl_op->u4_min_out_buf_size[1] = + ps_ctl_op->u4_min_out_buf_size[2] = 0; } else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) @@ -2917,18 +2802,6 @@ WORD32 ihevcd_get_buf_info(iv_obj_t *ps_codec_obj, ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 1; ps_ctl_op->u4_min_out_buf_size[2] = 0; } - else if(ps_codec->e_chroma_fmt == IV_GRAY) - { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = - ps_ctl_op->u4_min_out_buf_size[2] = 0; - } - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - { - ps_ctl_op->u4_min_out_buf_size[0] = (wd * ht); - ps_ctl_op->u4_min_out_buf_size[1] = (wd * ht) >> 1; - ps_ctl_op->u4_min_out_buf_size[2] = (wd * ht) >> 1; - } ps_codec->i4_num_disp_bufs = ps_ctl_op->u4_num_disp_bufs; return IV_SUCCESS; @@ -3321,24 +3194,6 @@ WORD32 ihevcd_get_frame_dimensions(iv_obj_t *ps_codec_obj, ps_op->u4_buffer_wd[1] <<= 1; ps_op->u4_x_offset[1] <<= 1; } - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) - { - ps_op->u4_disp_wd[1] = ps_op->u4_disp_wd[2] = ps_op->u4_disp_wd[0]; - ps_op->u4_disp_ht[1] = ps_op->u4_disp_ht[2] = ps_op->u4_disp_ht[0]; - ps_op->u4_buffer_wd[1] = ps_op->u4_buffer_wd[2] = ps_op->u4_buffer_wd[0]; - ps_op->u4_buffer_ht[1] = ps_op->u4_buffer_ht[2] = ps_op->u4_buffer_ht[0]; - ps_op->u4_x_offset[1] = ps_op->u4_x_offset[2] = ps_op->u4_x_offset[0]; - ps_op->u4_y_offset[1] = ps_op->u4_y_offset[2] = ps_op->u4_y_offset[0]; - } - else if(ps_codec->e_chroma_fmt == IV_GRAY) - { - ps_op->u4_disp_wd[1] = ps_op->u4_disp_wd[2] = 0; - ps_op->u4_disp_ht[1] = ps_op->u4_disp_ht[2] = 0; - ps_op->u4_buffer_wd[1] = ps_op->u4_buffer_wd[2] = 0; - ps_op->u4_buffer_ht[1] = ps_op->u4_buffer_ht[2] = 0; - ps_op->u4_x_offset[1] = ps_op->u4_x_offset[2] = 0; - ps_op->u4_y_offset[1] = ps_op->u4_y_offset[2] = 0; - } return IV_SUCCESS; @@ -3795,19 +3650,12 @@ WORD32 ihevcd_ctl(iv_obj_t *ps_codec_obj, void *pv_api_ip, void *pv_api_op) ret = ihevcd_get_vui_params(ps_codec_obj, (void *)pv_api_ip, (void *)pv_api_op); break; - case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS: #ifndef DISABLE_SEI + case IHEVCD_CXA_CMD_CTL_GET_SEI_MASTERING_PARAMS: ret = ihevcd_get_sei_mastering_params(ps_codec_obj, (void *)pv_api_ip, (void *)pv_api_op); -#else - { - ihevcd_cxa_ctl_get_sei_mastering_params_op_t *ps_op = - (ihevcd_cxa_ctl_get_sei_mastering_params_op_t *)pv_api_op; - ps_op->u4_error_code = IHEVCD_SEI_MASTERING_PARAMS_NOT_FOUND; - return IV_FAIL; - } -#endif break; +#endif case IHEVCD_CXA_CMD_CTL_SET_PROCESSOR: ret = ihevcd_set_processor(ps_codec_obj, (void *)pv_api_ip, (void *)pv_api_op); diff --git a/decoder/ihevcd_cabac.c b/decoder/ihevcd_cabac.c index 84cee69..7e24f02 100644 --- a/decoder/ihevcd_cabac.c +++ b/decoder/ihevcd_cabac.c @@ -133,12 +133,7 @@ IHEVCD_ERROR_T ihevcd_cabac_init(cab_ctxt_t *ps_cabac, bitstrm_t *ps_bitstrm, WORD32 qp, WORD32 cabac_init_idc, - const UWORD8 *pu1_init_ctxt -#ifdef ENABLE_MAIN_REXT_PROFILE - , - const WORD32 *pi4_rice_stat_coeff -#endif - ) + const UWORD8 *pu1_init_ctxt) { /* Sanity checks */ ASSERT(ps_cabac != NULL); @@ -167,16 +162,6 @@ IHEVCD_ERROR_T ihevcd_cabac_init(cab_ctxt_t *ps_cabac, memcpy(ps_cabac->au1_ctxt_models, pu1_init_ctxt, IHEVC_CAB_CTXT_END); - -#ifdef ENABLE_MAIN_REXT_PROFILE - /* golomb rice statistics */ - if(pi4_rice_stat_coeff) - { - memcpy(ps_cabac->ai4_rice_stat_coeff, pi4_rice_stat_coeff, - sizeof(ps_cabac->ai4_rice_stat_coeff)); - } -#endif - DEBUG_RANGE_OFST("init", ps_cabac->u4_range, ps_cabac->u4_ofst); /* diff --git a/decoder/ihevcd_cabac.h b/decoder/ihevcd_cabac.h index 4fec647..2c4a543 100644 --- a/decoder/ihevcd_cabac.h +++ b/decoder/ihevcd_cabac.h @@ -214,10 +214,6 @@ IHEVCD_ERROR_T ihevcd_cabac_init WORD32 slice_qp, WORD32 cabac_init_idc, const UWORD8 *pu1_init_ctxt -#ifdef ENABLE_MAIN_REXT_PROFILE - , - const WORD32 *pi4_rice_stat_coeff -#endif ); diff --git a/decoder/ihevcd_common_tables.c b/decoder/ihevcd_common_tables.c index 45a6dd6..d94a33b 100644 --- a/decoder/ihevcd_common_tables.c +++ b/decoder/ihevcd_common_tables.c @@ -38,7 +38,7 @@ #include "ihevcd_common_tables.h" #include "ihevc_defs.h" -const WORD16 gai2_ihevcd_chroma_qp_420[] = +const WORD16 gai2_ihevcd_chroma_qp[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 29, 30, 31, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, @@ -47,12 +47,3 @@ const WORD16 gai2_ihevcd_chroma_qp_420[] = const UWORD8 gau1_intra_pred_chroma_modes[] = { INTRA_PLANAR, INTRA_ANGULAR(26), INTRA_ANGULAR(10), INTRA_DC }; -const UWORD8 gau1_intra_pred_chroma_modes_422[] = - { 0, 1, 2, 2, 2, 2, 3, 5, 7, 8, 10, 12, 13, 15, 17, 18, 19, 20, - 21, 22, 23, 23, 24, 24, 25, 25, 26, 27, 27, 28, 28, 29, 29, 30, 31}; - -const WORD16 gai2_ihevcd_chroma_qp_clip[] = - { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 51, 51, 51, 51, 51, 51 }; diff --git a/decoder/ihevcd_common_tables.h b/decoder/ihevcd_common_tables.h index ecc5cc1..217fb1f 100644 --- a/decoder/ihevcd_common_tables.h +++ b/decoder/ihevcd_common_tables.h @@ -34,12 +34,9 @@ #ifndef _IHEVCD_COMMON_TABLES_H_ #define _IHEVCD_COMMON_TABLES_H_ -extern const WORD16 gai2_ihevcd_chroma_qp_420[]; +extern const WORD16 gai2_ihevcd_chroma_qp[]; extern const UWORD8 gau1_intra_pred_chroma_modes[]; -extern const UWORD8 gau1_intra_pred_chroma_modes_422[]; - -extern const WORD16 gai2_ihevcd_chroma_qp_clip[]; #endif /*_IHEVCD_COMMON_TABLES_H_*/ diff --git a/decoder/ihevcd_cxa.h b/decoder/ihevcd_cxa.h index 4d7df58..71031a5 100644 --- a/decoder/ihevcd_cxa.h +++ b/decoder/ihevcd_cxa.h @@ -71,9 +71,9 @@ IV_API_CALL_STATUS_T ihevcd_cxa_api_function(iv_obj_t *ps_handle, /*****************************************************************************/ /* Enums */ /*****************************************************************************/ - /* Codec Error codes for HEVC Decoder */ + typedef enum { /** * No error @@ -181,26 +181,6 @@ typedef struct { * enable_threads */ UWORD32 u4_keep_threads_active; - - /** - * Bitmask specifying the set of supported YUV output formats. - * - * Use a bitwise OR to enable multiple formats. - * The bit positions are defined by the CHROMA_FMT_IDC_* constants. - * - * Bit positions and corresponding values: - * (1 << CHROMA_FMT_IDC_MONOCHROME): 1 (YUV 4:0:0) - * (1 << CHROMA_FMT_IDC_YUV420): 2 (YUV 4:2:0) - * (1 << CHROMA_FMT_IDC_YUV422): 4 (YUV 4:2:2) - * (1 << CHROMA_FMT_IDC_YUV444): 8 (YUV 4:4:4) - * (1 << CHROMA_FMT_IDC_YUV444_PLANES): 16 (YUV 4:4:4) - * - * Example (Enable 4:0:0 and 4:2:0): - * (1 << CHROMA_FMT_IDC_MONOCHROME) | (1 << CHROMA_FMT_IDC_YUV420) - * - * NOTE: If this field is set to 0, YUV 4:2:0 will be enabled by default. - */ - UWORD32 u4_enable_yuv_formats; }ihevcd_cxa_create_ip_t; @@ -1082,6 +1062,7 @@ typedef struct { UWORD8 au1_cpb_cnt_minus1[6]; }ihevcd_cxa_ctl_get_vui_params_op_t; +#ifndef DISABLE_SEI typedef struct { UWORD32 u4_size; @@ -1125,6 +1106,7 @@ typedef struct UWORD32 u4_min_display_mastering_luminance; }ihevcd_cxa_ctl_get_sei_mastering_params_op_t; +#endif #ifdef __cplusplus } /* closing brace for extern "C" */ diff --git a/decoder/ihevcd_deblk.c b/decoder/ihevcd_deblk.c index 3a8259b..a00fadb 100644 --- a/decoder/ihevcd_deblk.c +++ b/decoder/ihevcd_deblk.c @@ -496,7 +496,7 @@ void ihevcd_deblk_ctb(deblk_ctxt_t *ps_deblk, /* Chroma Veritcal Edge */ - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_x) + if(0 == i4_is_last_ctb_x) { /* Top CTB's slice header */ @@ -643,7 +643,7 @@ void ihevcd_deblk_ctb(deblk_ctxt_t *ps_deblk, /* Chroma Horizontal Edge */ - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 == i4_is_last_ctb_y) + if(0 == i4_is_last_ctb_y) { /* Left CTB's slice header */ diff --git a/decoder/ihevcd_decode.c b/decoder/ihevcd_decode.c index 42a49ac..f97d698 100644 --- a/decoder/ihevcd_decode.c +++ b/decoder/ihevcd_decode.c @@ -356,39 +356,6 @@ static void ihevcd_fill_outargs(codec_t *ps_codec, ps_dec_op->s_disp_frm_buf.u4_v_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht / 2; } - else if(IV_YUV_444P == ps_codec->e_chroma_fmt) - { - ps_dec_op->s_disp_frm_buf.u4_u_strd = ps_dec_op->s_disp_frm_buf.u4_y_strd; - ps_dec_op->s_disp_frm_buf.u4_v_strd = ps_dec_op->s_disp_frm_buf.u4_y_strd; - ps_dec_op->s_disp_frm_buf.u4_u_wd = ps_dec_op->s_disp_frm_buf.u4_y_wd; - ps_dec_op->s_disp_frm_buf.u4_v_wd = ps_dec_op->s_disp_frm_buf.u4_y_wd; - ps_dec_op->s_disp_frm_buf.u4_u_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht; - ps_dec_op->s_disp_frm_buf.u4_v_ht = ps_dec_op->s_disp_frm_buf.u4_y_ht; - } - else if(IV_GRAY == ps_codec->e_chroma_fmt) - { - ps_dec_op->s_disp_frm_buf.u4_u_strd = 0; - ps_dec_op->s_disp_frm_buf.u4_v_strd = 0; - ps_dec_op->s_disp_frm_buf.u4_u_wd = 0; - ps_dec_op->s_disp_frm_buf.u4_v_wd = 0; - ps_dec_op->s_disp_frm_buf.u4_u_ht = 0; - ps_dec_op->s_disp_frm_buf.u4_v_ht = 0; - } - else if(IV_YUV_422P == ps_codec->e_chroma_fmt) - { - ps_dec_op->s_disp_frm_buf.u4_u_strd = - ps_dec_op->s_disp_frm_buf.u4_y_strd / 2; - ps_dec_op->s_disp_frm_buf.u4_v_strd = - ps_dec_op->s_disp_frm_buf.u4_y_strd / 2; - ps_dec_op->s_disp_frm_buf.u4_u_wd = - ps_dec_op->s_disp_frm_buf.u4_y_wd / 2; - ps_dec_op->s_disp_frm_buf.u4_v_wd = - ps_dec_op->s_disp_frm_buf.u4_y_wd / 2; - ps_dec_op->s_disp_frm_buf.u4_u_ht = - ps_dec_op->s_disp_frm_buf.u4_y_ht; - ps_dec_op->s_disp_frm_buf.u4_v_ht = - ps_dec_op->s_disp_frm_buf.u4_y_ht; - } } else if(ps_codec->i4_flush_mode) diff --git a/decoder/ihevcd_defs.h b/decoder/ihevcd_defs.h index 21f81b6..47fff65 100644 --- a/decoder/ihevcd_defs.h +++ b/decoder/ihevcd_defs.h @@ -196,7 +196,7 @@ m_scaling_mat_size = 6 * TRANS_SIZE_4 * TRANS_SIZE_4; \ m_scaling_mat_size += 6 * TRANS_SIZE_8 * TRANS_SIZE_8; \ m_scaling_mat_size += 6 * TRANS_SIZE_16 * TRANS_SIZE_16; \ - m_scaling_mat_size += 6 * TRANS_SIZE_32 * TRANS_SIZE_32; \ + m_scaling_mat_size += 2 * TRANS_SIZE_32 * TRANS_SIZE_32; \ } /** @@ -450,10 +450,10 @@ enum */ #define MIN_IN_BUFS 1 #define MIN_OUT_BUFS_420 3 -#define MIN_OUT_BUFS_422 3 -#define MIN_OUT_BUFS_444 3 +#define MIN_OUT_BUFS_422ILE 1 +#define MIN_OUT_BUFS_RGB565 1 +#define MIN_OUT_BUFS_RGBA8888 1 #define MIN_OUT_BUFS_420SP 2 -#define MIN_OUT_BUFS_GRAY 1 /** **************************************************************************** diff --git a/decoder/ihevcd_error.h b/decoder/ihevcd_error.h index 91e447a..3e90d81 100644 --- a/decoder/ihevcd_error.h +++ b/decoder/ihevcd_error.h @@ -123,15 +123,12 @@ typedef enum */ IHEVCD_VUI_PARAMS_NOT_FOUND, +#ifndef DISABLE_SEI /** * SEI mastering parameters not found */ IHEVCD_SEI_MASTERING_PARAMS_NOT_FOUND, - - /** - * Feature not supported - */ - IHEVCD_UNSUPPORTED_TOOL_SET, +#endif }IHEVCD_ERROR_T; #endif /* _IHEVCD_ERROR_H_ */ diff --git a/decoder/ihevcd_fmt_conv.c b/decoder/ihevcd_fmt_conv.c index 2063703..4637fe8 100644 --- a/decoder/ihevcd_fmt_conv.c +++ b/decoder/ihevcd_fmt_conv.c @@ -67,6 +67,270 @@ /* SIMD variants of format conversion modules do not support width less than 32 */ #define MIN_FMT_CONV_SIMD_WIDTH 32 +/** +******************************************************************************* +* +* @brief Function used from copying a 420SP buffer +* +* @par Description +* Function used from copying a 420SP buffer +* +* @param[in] pu1_y_src +* Input Y pointer +* +* @param[in] pu1_uv_src +* Input UV pointer (UV is interleaved either in UV or VU format) +* +* @param[in] pu1_y_dst +* Output Y pointer +* +* @param[in] pu1_uv_dst +* Output UV pointer (UV is interleaved in the same format as that of input) +* +* @param[in] wd +* Width +* +* @param[in] ht +* Height +* +* @param[in] src_y_strd +* Input Y Stride +* +* @param[in] src_uv_strd +* Input UV stride +* +* @param[in] dst_y_strd +* Output Y stride +* +* @param[in] dst_uv_strd +* Output UV stride +* +* @returns None +* +* @remarks In case there is a need to perform partial frame copy then +* by passion appropriate source and destination pointers and appropriate +* values for wd and ht it can be done +* +******************************************************************************* +*/ +void ihevcd_fmt_conv_420sp_to_rgb565(UWORD8 *pu1_y_src, + UWORD8 *pu1_uv_src, + UWORD16 *pu2_rgb_dst, + WORD32 wd, + WORD32 ht, + WORD32 src_y_strd, + WORD32 src_uv_strd, + WORD32 dst_strd, + WORD32 is_u_first) +{ + + + WORD16 i2_r, i2_g, i2_b; + UWORD32 u4_r, u4_g, u4_b; + WORD16 i2_i, i2_j; + UWORD8 *pu1_y_src_nxt; + UWORD16 *pu2_rgb_dst_NextRow; + + UWORD8 *pu1_u_src, *pu1_v_src; + + if(is_u_first) + { + pu1_u_src = (UWORD8 *)pu1_uv_src; + pu1_v_src = (UWORD8 *)pu1_uv_src + 1; + } + else + { + pu1_u_src = (UWORD8 *)pu1_uv_src + 1; + pu1_v_src = (UWORD8 *)pu1_uv_src; + } + + pu1_y_src_nxt = pu1_y_src + src_y_strd; + pu2_rgb_dst_NextRow = pu2_rgb_dst + dst_strd; + + for(i2_i = 0; i2_i < (ht >> 1); i2_i++) + { + for(i2_j = (wd >> 1); i2_j > 0; i2_j--) + { + i2_b = ((*pu1_u_src - 128) * COEFF4 >> 13); + i2_g = ((*pu1_u_src - 128) * COEFF2 + (*pu1_v_src - 128) * COEFF3) >> 13; + i2_r = ((*pu1_v_src - 128) * COEFF1) >> 13; + + pu1_u_src += 2; + pu1_v_src += 2; + /* pixel 0 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src + i2_b); + u4_b >>= 3; + /* G */ + u4_g = CLIP_U8(*pu1_y_src + i2_g); + u4_g >>= 2; + /* R */ + u4_r = CLIP_U8(*pu1_y_src + i2_r); + u4_r >>= 3; + + pu1_y_src++; + *pu2_rgb_dst++ = ((u4_r << 11) | (u4_g << 5) | u4_b); + + /* pixel 1 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src + i2_b); + u4_b >>= 3; + /* G */ + u4_g = CLIP_U8(*pu1_y_src + i2_g); + u4_g >>= 2; + /* R */ + u4_r = CLIP_U8(*pu1_y_src + i2_r); + u4_r >>= 3; + + pu1_y_src++; + *pu2_rgb_dst++ = ((u4_r << 11) | (u4_g << 5) | u4_b); + + /* pixel 2 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b); + u4_b >>= 3; + /* G */ + u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g); + u4_g >>= 2; + /* R */ + u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r); + u4_r >>= 3; + + pu1_y_src_nxt++; + *pu2_rgb_dst_NextRow++ = ((u4_r << 11) | (u4_g << 5) | u4_b); + + /* pixel 3 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b); + u4_b >>= 3; + /* G */ + u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g); + u4_g >>= 2; + /* R */ + u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r); + u4_r >>= 3; + + pu1_y_src_nxt++; + *pu2_rgb_dst_NextRow++ = ((u4_r << 11) | (u4_g << 5) | u4_b); + + } + + pu1_u_src = pu1_u_src + src_uv_strd - wd; + pu1_v_src = pu1_v_src + src_uv_strd - wd; + + pu1_y_src = pu1_y_src + (src_y_strd << 1) - wd; + pu1_y_src_nxt = pu1_y_src_nxt + (src_y_strd << 1) - wd; + + pu2_rgb_dst = pu2_rgb_dst_NextRow - wd + dst_strd; + pu2_rgb_dst_NextRow = pu2_rgb_dst_NextRow + (dst_strd << 1) - wd; + } + + +} + +void ihevcd_fmt_conv_420sp_to_rgba8888(UWORD8 *pu1_y_src, + UWORD8 *pu1_uv_src, + UWORD32 *pu4_rgba_dst, + WORD32 wd, + WORD32 ht, + WORD32 src_y_strd, + WORD32 src_uv_strd, + WORD32 dst_strd, + WORD32 is_u_first) +{ + + + WORD16 i2_r, i2_g, i2_b; + UWORD32 u4_r, u4_g, u4_b; + WORD16 i2_i, i2_j; + UWORD8 *pu1_y_src_nxt; + UWORD32 *pu4_rgba_dst_NextRow; + + UWORD8 *pu1_u_src, *pu1_v_src; + + if(is_u_first) + { + pu1_u_src = (UWORD8 *)pu1_uv_src; + pu1_v_src = (UWORD8 *)pu1_uv_src + 1; + } + else + { + pu1_u_src = (UWORD8 *)pu1_uv_src + 1; + pu1_v_src = (UWORD8 *)pu1_uv_src; + } + + pu1_y_src_nxt = pu1_y_src + src_y_strd; + pu4_rgba_dst_NextRow = pu4_rgba_dst + dst_strd; + + for(i2_i = 0; i2_i < (ht >> 1); i2_i++) + { + for(i2_j = (wd >> 1); i2_j > 0; i2_j--) + { + i2_b = ((*pu1_u_src - 128) * COEFF4 >> 13); + i2_g = ((*pu1_u_src - 128) * COEFF2 + (*pu1_v_src - 128) * COEFF3) >> 13; + i2_r = ((*pu1_v_src - 128) * COEFF1) >> 13; + + pu1_u_src += 2; + pu1_v_src += 2; + /* pixel 0 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src + i2_b); + /* G */ + u4_g = CLIP_U8(*pu1_y_src + i2_g); + /* R */ + u4_r = CLIP_U8(*pu1_y_src + i2_r); + + pu1_y_src++; + *pu4_rgba_dst++ = ((u4_r << 16) | (u4_g << 8) | (u4_b << 0)); + + /* pixel 1 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src + i2_b); + /* G */ + u4_g = CLIP_U8(*pu1_y_src + i2_g); + /* R */ + u4_r = CLIP_U8(*pu1_y_src + i2_r); + + pu1_y_src++; + *pu4_rgba_dst++ = ((u4_r << 16) | (u4_g << 8) | (u4_b << 0)); + + /* pixel 2 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b); + /* G */ + u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g); + /* R */ + u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r); + + pu1_y_src_nxt++; + *pu4_rgba_dst_NextRow++ = ((u4_r << 16) | (u4_g << 8) | (u4_b << 0)); + + /* pixel 3 */ + /* B */ + u4_b = CLIP_U8(*pu1_y_src_nxt + i2_b); + /* G */ + u4_g = CLIP_U8(*pu1_y_src_nxt + i2_g); + /* R */ + u4_r = CLIP_U8(*pu1_y_src_nxt + i2_r); + + pu1_y_src_nxt++; + *pu4_rgba_dst_NextRow++ = ((u4_r << 16) | (u4_g << 8) | (u4_b << 0)); + + } + + pu1_u_src = pu1_u_src + src_uv_strd - wd; + pu1_v_src = pu1_v_src + src_uv_strd - wd; + + pu1_y_src = pu1_y_src + (src_y_strd << 1) - wd; + pu1_y_src_nxt = pu1_y_src_nxt + (src_y_strd << 1) - wd; + + pu4_rgba_dst = pu4_rgba_dst_NextRow - wd + dst_strd; + pu4_rgba_dst_NextRow = pu4_rgba_dst_NextRow + (dst_strd << 1) - wd; + } + + +} + /** ******************************************************************************* * @@ -166,128 +430,6 @@ void ihevcd_fmt_conv_420sp_to_420sp(UWORD8 *pu1_y_src, } -/** -******************************************************************************* -* -* @brief Function used from copying a 400 buffer -* -* @par Description -* Function used from copying a 400 buffer -* -* @param[in] pu1_y_src -* Input Y pointer -* -* @param[in] pu1_y_dst -* Output Y pointer -* -* @param[in] wd -* Width -* -* @param[in] ht -* Height -* -* @param[in] src_y_strd -* Input Y Stride -* -* @param[in] dst_y_strd -* Output Y stride -* -* @returns None -* -* @remarks In case there is a need to perform partial frame copy then -* by passion appropriate source and destination pointers and appropriate -* values for wd and ht it can be done -* -******************************************************************************* -*/ - -void ihevcd_fmt_conv_luma_copy(UWORD8 *pu1_y_src, - UWORD8 *pu1_y_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 dst_y_strd) -{ - UWORD8 *pu1_src, *pu1_dst; - WORD32 num_rows, num_cols, src_strd, dst_strd; - WORD32 i; - - /* copy luma */ - pu1_src = (UWORD8 *)pu1_y_src; - pu1_dst = (UWORD8 *)pu1_y_dst; - - num_rows = ht; - num_cols = wd; - - src_strd = src_y_strd; - dst_strd = dst_y_strd; - - for(i = 0; i < num_rows; i++) - { - memcpy(pu1_dst, pu1_src, num_cols); - pu1_dst += dst_strd; - pu1_src += src_strd; - } - return; -} - -/** -******************************************************************************* -* -* @brief Function to convert a YUV 4:0:0 buffer to YUV 4:2:0 buffer -* -* @par Description -* This function handles the format conversion from a 4:0:0 input buffer to a -* 4:2:0 output buffer. It copies the Luma (Y) plane directly and synthesizes -* the Chroma (U and V) planes by initializing them to a neutral gray value (128). -* -* @param[in] pu1_y_src -*   Input Y pointer -* -* @param[out] pu1_y_dst_tmp -*   Output Y pointer -* -* @param[out] pu1_u_dst_tmp -*   Output Chroma U pointer -* -* @param[out] pu1_v_dst_tmp -*   Output Chroma V pointer -* -* @param[in] ps_codec -*   Pointer to the codec structure -* -* @param[in] num_rows -*   Number of rows (height) to process. -* -* @returns None -* -* @remarks The Chroma (U and V) planes are initialized to 128, which represents -* a neutral gray in 8-bit YUV, effectively 'zeroing out' the color information -* present in the 4:0:0 (grayscale) source. The Luma plane is copied using -* ihevcd_fmt_conv_400_to_400. -* -******************************************************************************* -*/ -void ihevcd_fmt_conv_400_to_420p(UWORD8 *pu1_y_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd) -{ - ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd); - for(int i = 0; i < ht / 2; i++) - { - memset(pu1_u_dst, 128, wd / 2); - memset(pu1_v_dst, 128, wd / 2); - pu1_u_dst += dst_uv_strd; - pu1_v_dst += dst_uv_strd; - } - return; -} /** ******************************************************************************* @@ -517,178 +659,6 @@ void ihevcd_fmt_conv_420sp_to_420p(UWORD8 *pu1_y_src, return; } -/** -******************************************************************************* -* -* @brief Function to convert a YUV 4:4:4 sp buffer to YUV 4:4:4 planar buffer -* -* @par Description -* This function handles the format conversion from a 4:4:4 semi planar input buffer -* to a 4:4:4 planar output buffer. -* -* @param[in] pu1_y_src -* Input Y pointer -* -* @param[in] pu1_uv_src -* Input UV pointer (UV is interleaved) -* -* @param[in] pu1_y_dst -* Output Y pointer -* -* @param[in] pu1_u_dst -* Output U pointer -* -* @param[in] pu1_v_dst -* Output V pointer -* -* @param[in] wd -* Width -* -* @param[in] ht -* Height -* -* @param[in] src_y_strd -* Input Y Stride -* -* @param[in] src_uv_strd -* Input UV stride -* -* @param[in] dst_y_strd -* Output Y stride -* -* @param[in] dst_uv_strd -* Output U or V stride -* -* @returns none -* -* @remarks none -* -******************************************************************************* -*/ -void ihevcd_fmt_conv_444sp_to_444p(UWORD8 *pu1_y_src, - UWORD8 *pu1_uv_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 src_uv_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd) -{ - ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd); - - /* de-interleave U and V and copy to destination */ - UWORD8 *pu1_u_src = (UWORD8*)pu1_uv_src; - UWORD8 *pu1_v_src = (UWORD8*)pu1_uv_src + 1; - - for(WORD32 i = 0; i < ht; i++) - { - for(WORD32 j = 0; j < wd; j++) - { - pu1_u_dst[j] = pu1_u_src[j * 2]; - pu1_v_dst[j] = pu1_v_src[j * 2]; - } - pu1_u_dst += dst_uv_strd; - pu1_v_dst += dst_uv_strd; - pu1_u_src += src_uv_strd; - pu1_v_src += src_uv_strd; - } - return; -} - -void ihevcd_fmt_conv_444sp_to_420p(UWORD8 *pu1_y_src, - UWORD8 *pu1_uv_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 src_uv_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd) -{ - ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd); - - for(WORD32 i = 0; i < ht; i += 2) - { - for(WORD32 j = 0; j < wd; j += 2) - { - pu1_u_dst[j / 2] = pu1_uv_src[j * 2]; - pu1_v_dst[j / 2] = pu1_uv_src[j * 2 + 1]; - } - pu1_u_dst += dst_uv_strd; - pu1_v_dst += dst_uv_strd; - pu1_uv_src += (src_uv_strd * 2); - } - return; -} - -void ihevcd_fmt_conv_422sp_to_422p(UWORD8 *pu1_y_src, - UWORD8 *pu1_uv_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 src_uv_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd) -{ - UWORD8 *pu1_u_src, *pu1_v_src; - WORD32 i, j; - - ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd); - - pu1_u_src = (UWORD8 *)pu1_uv_src; - pu1_v_src = (UWORD8 *)pu1_uv_src + 1; - - for(i = 0; i < ht; i++) - { - for(j = 0; j < (wd >> 1); j++) - { - pu1_u_dst[j] = pu1_u_src[j * 2]; - pu1_v_dst[j] = pu1_v_src[j * 2]; - } - - pu1_u_dst += dst_uv_strd; - pu1_v_dst += dst_uv_strd; - pu1_u_src += src_uv_strd; - pu1_v_src += src_uv_strd; - } - return; -} - -void ihevcd_fmt_conv_422sp_to_420p(UWORD8 *pu1_y_src, - UWORD8 *pu1_uv_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 src_uv_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd) -{ - ihevcd_fmt_conv_luma_copy(pu1_y_src, pu1_y_dst, wd, ht, src_y_strd, dst_y_strd); - - for(WORD32 i = 0; i < ht; i++) - { - for(WORD32 j = 0; j < wd; j += 2) - { - pu1_u_dst[j / 2] = pu1_uv_src[j * 2]; - pu1_v_dst[j / 2] = pu1_uv_src[j * 2 + 1]; - } - pu1_u_dst += dst_uv_strd; - pu1_v_dst += dst_uv_strd; - pu1_uv_src += src_uv_strd; - } - return; -} /** @@ -732,15 +702,14 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, UWORD8 *pu1_y_src, *pu1_uv_src; UWORD8 *pu1_y_dst_tmp, *pu1_uv_dst_tmp; UWORD8 *pu1_u_dst_tmp, *pu1_v_dst_tmp; + UWORD16 *pu2_rgb_dst_tmp; + UWORD32 *pu4_rgb_dst_tmp; WORD32 is_u_first; UWORD8 *pu1_luma; UWORD8 *pu1_chroma; sps_t *ps_sps; WORD32 disable_luma_copy; WORD32 crop_unit_x, crop_unit_y; - WORD32 h_samp_factor, v_samp_factor; - WORD32 src_chroma_pixel_strd = 2; - WORD32 src_chroma_row_stride; if(0 == num_rows) return ret; @@ -749,9 +718,6 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, PROFILE_DISABLE_FMT_CONV(); ps_sps = ps_proc->ps_sps; - h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2; - v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1; - crop_unit_x = 1; crop_unit_y = 1; @@ -760,29 +726,19 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, crop_unit_x = 2; crop_unit_y = 2; } - else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc) - { - crop_unit_x = 2; - crop_unit_y = 1; - } ps_disp_pic = ps_codec->ps_disp_buf; pu1_luma = ps_disp_pic->pu1_luma; - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_chroma = ps_disp_pic->pu1_chroma; - } + pu1_chroma = ps_disp_pic->pu1_chroma; /* Take care of cropping */ pu1_luma += ps_codec->i4_strd * ps_sps->i2_pic_crop_top_offset * crop_unit_y + ps_sps->i2_pic_crop_left_offset * crop_unit_x; - src_chroma_row_stride = (ps_codec->i4_strd * src_chroma_pixel_strd / h_samp_factor); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_chroma += (ps_sps->i2_pic_crop_top_offset * src_chroma_row_stride) - + ps_sps->i2_pic_crop_left_offset * src_chroma_pixel_strd; - } + /* Left offset is multiplied by 2 because buffer is UV interleaved */ + pu1_chroma += ps_codec->i4_strd * ps_sps->i2_pic_crop_top_offset + ps_sps->i2_pic_crop_left_offset * 2; + + is_u_first = (IV_YUV_420SP_UV == ps_codec->e_ref_chroma_fmt) ? 1 : 0; /* In case of 420P output luma copy is disabled for shared mode */ @@ -796,10 +752,7 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, { pu1_y_src = pu1_luma + cur_row * ps_codec->i4_strd; - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_uv_src = pu1_chroma + ((cur_row / v_samp_factor) * src_chroma_row_stride); - } + pu1_uv_src = pu1_chroma + (cur_row / 2) * ps_codec->i4_strd; /* In case of shared mode, with 420P output, get chroma destination */ if((1 == ps_codec->i4_share_disp_buf) && (IV_YUV_420P == ps_codec->e_chroma_fmt)) @@ -819,27 +772,14 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, } } } + pu2_rgb_dst_tmp = (UWORD16 *)pu1_y_dst; + pu2_rgb_dst_tmp += cur_row * ps_codec->i4_disp_strd; + pu4_rgb_dst_tmp = (UWORD32 *)pu1_y_dst; + pu4_rgb_dst_tmp += cur_row * ps_codec->i4_disp_strd; pu1_y_dst_tmp = pu1_y_dst + cur_row * ps_codec->i4_disp_strd; - if(IV_YUV_444P == ps_codec->e_chroma_fmt) - { - pu1_u_dst_tmp = pu1_u_dst + cur_row * ps_codec->i4_disp_strd; - pu1_v_dst_tmp = pu1_v_dst + cur_row * ps_codec->i4_disp_strd; - } - else if(IV_YUV_422P == ps_codec->e_chroma_fmt) - { - pu1_u_dst_tmp = pu1_u_dst + cur_row * ps_codec->i4_disp_strd / 2; - pu1_v_dst_tmp = pu1_v_dst + cur_row * ps_codec->i4_disp_strd / 2; - } - else if(IV_YUV_420P == ps_codec->e_chroma_fmt) - { - pu1_u_dst_tmp = pu1_u_dst + (cur_row / 2) * ps_codec->i4_disp_strd / 2; - pu1_v_dst_tmp = pu1_v_dst + (cur_row / 2) * ps_codec->i4_disp_strd / 2; - } - else if(IV_YUV_420SP_UV == ps_codec->e_chroma_fmt - || IV_YUV_420SP_VU == ps_codec->e_chroma_fmt) - { - pu1_uv_dst_tmp = pu1_u_dst + (cur_row / 2) * ps_codec->i4_disp_strd; - } + pu1_uv_dst_tmp = pu1_u_dst + (cur_row / 2) * ps_codec->i4_disp_strd; + pu1_u_dst_tmp = pu1_u_dst + (cur_row / 2) * ps_codec->i4_disp_strd / 2; + pu1_v_dst_tmp = pu1_v_dst + (cur_row / 2) * ps_codec->i4_disp_strd / 2; /* In case of multi threaded implementation, format conversion might be called * before reconstruction is completed. If the frame being converted/copied @@ -889,119 +829,112 @@ IHEVCD_ERROR_T ihevcd_fmt_conv(codec_t *ps_codec, } } + if((IV_YUV_420SP_UV == ps_codec->e_chroma_fmt) || (IV_YUV_420SP_VU == ps_codec->e_chroma_fmt)) { - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) + ihevcd_fmt_conv_420sp_to_420sp_ft *fmt_conv_fptr; + if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) { - ihevcd_fmt_conv_420sp_to_420sp_ft *fmt_conv_fptr; - if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) - { - fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr; - } - else - { - fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420sp; - } - fmt_conv_fptr(pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_uv_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, ps_codec->i4_strd, - ps_codec->i4_disp_strd, ps_codec->i4_disp_strd); + fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr; } - } - else if(IV_GRAY == ps_codec->e_chroma_fmt) - { - ihevcd_fmt_conv_luma_copy(pu1_y_src, - pu1_y_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, - ps_codec->i4_disp_strd); - } - else if(IV_YUV_444P == ps_codec->e_chroma_fmt) - { - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) + else { - ps_codec->s_func_selector.ihevcd_fmt_conv_444sp_to_444p_fptr( - pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, src_chroma_row_stride, - ps_codec->i4_disp_strd, ps_codec->i4_disp_strd); - } - } - else if(IV_YUV_422P == ps_codec->e_chroma_fmt) - { - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - ihevcd_fmt_conv_422sp_to_422p(pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, ps_codec->i4_strd, - ps_codec->i4_disp_strd, (ps_codec->i4_disp_strd / 2)); + fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420sp; } + fmt_conv_fptr(pu1_y_src, pu1_uv_src, + pu1_y_dst_tmp, pu1_uv_dst_tmp, + ps_codec->i4_disp_wd, + num_rows, + ps_codec->i4_strd, + ps_codec->i4_strd, + ps_codec->i4_disp_strd, + ps_codec->i4_disp_strd); } else if(IV_YUV_420P == ps_codec->e_chroma_fmt) { - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME) + ihevcd_fmt_conv_420sp_to_420p_ft *fmt_conv_fptr; + if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) { - ihevcd_fmt_conv_400_to_420p(pu1_y_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, - ps_codec->i4_disp_strd, (ps_codec->i4_disp_strd / 2)); + fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr; } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) + else { - ihevcd_fmt_conv_420sp_to_420p_ft *fmt_conv_fptr; - if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) + fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420p; + } + + if(0 == disable_luma_copy) + { + // copy luma + WORD32 i; + WORD32 num_cols = ps_codec->i4_disp_wd; + + for(i = 0; i < num_rows; i++) { - fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr; - } - else - { - fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_420p; + memcpy(pu1_y_dst_tmp, pu1_y_src, num_cols); + pu1_y_dst_tmp += ps_codec->i4_disp_strd; + pu1_y_src += ps_codec->i4_strd; } - if(0 == disable_luma_copy) - { - // copy luma - WORD32 i; - WORD32 num_cols = ps_codec->i4_disp_wd; - - for(i = 0; i < num_rows; i++) - { - memcpy(pu1_y_dst_tmp, pu1_y_src, num_cols); - pu1_y_dst_tmp += ps_codec->i4_disp_strd; - pu1_y_src += ps_codec->i4_strd; - } - - disable_luma_copy = 1; - } - fmt_conv_fptr(pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, ps_codec->i4_strd, - ps_codec->i4_disp_strd, (ps_codec->i4_disp_strd / 2), - is_u_first, - disable_luma_copy); - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - ihevcd_fmt_conv_444sp_to_420p(pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, src_chroma_row_stride, - ps_codec->i4_disp_strd, ps_codec->i4_disp_strd / 2); - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - ihevcd_fmt_conv_422sp_to_420p(pu1_y_src, pu1_uv_src, - pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, - ps_codec->i4_disp_wd, num_rows, - ps_codec->i4_strd, src_chroma_row_stride, - ps_codec->i4_disp_strd, ps_codec->i4_disp_strd / 2); + disable_luma_copy = 1; } + fmt_conv_fptr(pu1_y_src, pu1_uv_src, + pu1_y_dst_tmp, pu1_u_dst_tmp, pu1_v_dst_tmp, + ps_codec->i4_disp_wd, + num_rows, + ps_codec->i4_strd, + ps_codec->i4_strd, + ps_codec->i4_disp_strd, + (ps_codec->i4_disp_strd / 2), + is_u_first, + disable_luma_copy); } + else if(IV_RGB_565 == ps_codec->e_chroma_fmt) + { + ihevcd_fmt_conv_420sp_to_rgb565_ft *fmt_conv_fptr; + if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) + { + fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr; + } + else + { + fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_rgb565; + } + + fmt_conv_fptr(pu1_y_src, pu1_uv_src, + pu2_rgb_dst_tmp, + ps_codec->i4_disp_wd, + num_rows, + ps_codec->i4_strd, + ps_codec->i4_strd, + ps_codec->i4_disp_strd, + is_u_first); + } + else if(IV_RGBA_8888 == ps_codec->e_chroma_fmt) + { + ihevcd_fmt_conv_420sp_to_rgba8888_ft *fmt_conv_fptr; + if(ps_codec->i4_disp_wd >= MIN_FMT_CONV_SIMD_WIDTH) + { + fmt_conv_fptr = ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr; + } + else + { + fmt_conv_fptr = ihevcd_fmt_conv_420sp_to_rgba8888; + } + + ASSERT(is_u_first == 1); + fmt_conv_fptr(pu1_y_src, + pu1_uv_src, + pu4_rgb_dst_tmp, + ps_codec->i4_disp_wd, + num_rows, + ps_codec->i4_strd, + ps_codec->i4_strd, + ps_codec->i4_disp_strd, + is_u_first); + } + + + } return (ret); } diff --git a/decoder/ihevcd_fmt_conv.h b/decoder/ihevcd_fmt_conv.h index 0e4b680..e099218 100644 --- a/decoder/ihevcd_fmt_conv.h +++ b/decoder/ihevcd_fmt_conv.h @@ -43,6 +43,27 @@ #define COEFF3 -6664 #define COEFF4 16530 +typedef void ihevcd_fmt_conv_420sp_to_rgba8888_ft(UWORD8 *pu1_y_src, + UWORD8 *pu1_uv_src, + UWORD32 *pu4_rgba_dst, + WORD32 wd, + WORD32 ht, + WORD32 src_y_strd, + WORD32 src_uv_strd, + WORD32 dst_strd, + WORD32 is_u_first); + +typedef void ihevcd_fmt_conv_420sp_to_rgb565_ft(UWORD8 *pu1_y_src, + UWORD8 *pu1_uv_src, + UWORD16 *pu2_rgb_dst, + WORD32 wd, + WORD32 ht, + WORD32 src_y_strd, + WORD32 src_uv_strd, + WORD32 dst_strd, + WORD32 is_u_first); + + typedef void ihevcd_fmt_conv_420sp_to_420sp_ft(UWORD8 *pu1_y_src, UWORD8 *pu1_uv_src, UWORD8 *pu1_y_dst, @@ -66,28 +87,20 @@ typedef void ihevcd_fmt_conv_420sp_to_420p_ft(UWORD8 *pu1_y_src, WORD32 dst_uv_strd, WORD32 is_u_first, WORD32 disable_luma_copy); -typedef void ihevcd_fmt_conv_444sp_to_444p_ft(UWORD8 *pu1_y_src, - UWORD8 *pu1_uv_src, - UWORD8 *pu1_y_dst, - UWORD8 *pu1_u_dst, - UWORD8 *pu1_v_dst, - WORD32 wd, - WORD32 ht, - WORD32 src_y_strd, - WORD32 src_uv_strd, - WORD32 dst_y_strd, - WORD32 dst_uv_strd); /* C function declarations */ +ihevcd_fmt_conv_420sp_to_rgba8888_ft ihevcd_fmt_conv_420sp_to_rgba8888; +ihevcd_fmt_conv_420sp_to_rgb565_ft ihevcd_fmt_conv_420sp_to_rgb565; ihevcd_fmt_conv_420sp_to_420sp_ft ihevcd_fmt_conv_420sp_to_420sp; ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p; -ihevcd_fmt_conv_444sp_to_444p_ft ihevcd_fmt_conv_444sp_to_444p; /* A9Q function declarations */ +ihevcd_fmt_conv_420sp_to_rgba8888_ft ihevcd_fmt_conv_420sp_to_rgba8888_a9q; ihevcd_fmt_conv_420sp_to_420sp_ft ihevcd_fmt_conv_420sp_to_420sp_a9q; ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p_a9q; /* A9A function declarations */ +ihevcd_fmt_conv_420sp_to_rgba8888_ft ihevcd_fmt_conv_420sp_to_rgba8888_a9a; ihevcd_fmt_conv_420sp_to_420sp_ft ihevcd_fmt_conv_420sp_to_420sp_a9a; ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p_a9a; @@ -98,6 +111,7 @@ ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p_ssse3; ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p_sse42; /* armv8 function declarations */ +ihevcd_fmt_conv_420sp_to_rgba8888_ft ihevcd_fmt_conv_420sp_to_rgba8888_av8; ihevcd_fmt_conv_420sp_to_420sp_ft ihevcd_fmt_conv_420sp_to_420sp_av8; ihevcd_fmt_conv_420sp_to_420p_ft ihevcd_fmt_conv_420sp_to_420p_av8; diff --git a/decoder/ihevcd_function_selector.h b/decoder/ihevcd_function_selector.h index 53a3cd6..e7d7eee 100644 --- a/decoder/ihevcd_function_selector.h +++ b/decoder/ihevcd_function_selector.h @@ -40,7 +40,6 @@ #include "ihevc_deblk.h" #include "ihevc_itrans.h" -#include "ihevc_itrans_res.h" #include "ihevc_itrans_recon.h" #include "ihevc_chroma_itrans_recon.h" #include "ihevc_chroma_intra_pred.h" @@ -72,6 +71,18 @@ #define D_ARCH_MIPS_GENERIC 15 #define D_ARCH_MIPS_32 16 +void ihevcd_init_arch(void *pv_codec); + +void ihevcd_init_function_ptr(void *pv_codec); + +void ihevcd_init_function_ptr_generic(void *pv_codec); +void ihevcd_init_function_ptr_ssse3(void *pv_codec); +void ihevcd_init_function_ptr_sse42(void *pv_codec); + +#ifndef DISABLE_AVX2 +void ihevcd_init_function_ptr_avx2(void *pv_codec); +#endif + typedef struct { ihevc_deblk_chroma_horz_ft *ihevc_deblk_chroma_horz_fptr; @@ -100,7 +111,6 @@ typedef struct ihevc_intra_pred_luma_ref_substitution_ft *ihevc_intra_pred_luma_ref_substitution_fptr; ihevc_intra_pred_luma_ref_subst_all_avlble_ft *ihevc_intra_pred_luma_ref_subst_all_avlble_fptr; ihevc_intra_pred_ref_filtering_ft *ihevc_intra_pred_ref_filtering_fptr; - ihevc_intra_pred_chroma_ref_filtering_ft *ihevc_intra_pred_chroma_ref_filtering_fptr; ihevc_intra_pred_chroma_dc_ft *ihevc_intra_pred_chroma_dc_fptr; ihevc_intra_pred_chroma_horz_ft *ihevc_intra_pred_chroma_horz_fptr; ihevc_intra_pred_chroma_mode2_ft *ihevc_intra_pred_chroma_mode2_fptr; @@ -126,11 +136,6 @@ typedef struct ihevc_itrans_8x8_ft *ihevc_itrans_8x8_fptr; ihevc_itrans_16x16_ft *ihevc_itrans_16x16_fptr; ihevc_itrans_32x32_ft *ihevc_itrans_32x32_fptr; - ihevc_itrans_res_4x4_ttype1_ft *ihevc_itrans_res_4x4_ttype1_fptr; - ihevc_itrans_res_4x4_ft *ihevc_itrans_res_4x4_fptr; - ihevc_itrans_res_8x8_ft *ihevc_itrans_res_8x8_fptr; - ihevc_itrans_res_16x16_ft *ihevc_itrans_res_16x16_fptr; - ihevc_itrans_res_32x32_ft *ihevc_itrans_res_32x32_fptr; ihevc_itrans_recon_4x4_ttype1_ft *ihevc_itrans_recon_4x4_ttype1_fptr; ihevc_itrans_recon_4x4_ft *ihevc_itrans_recon_4x4_fptr; ihevc_itrans_recon_8x8_ft *ihevc_itrans_recon_8x8_fptr; @@ -139,7 +144,6 @@ typedef struct ihevc_chroma_itrans_recon_4x4_ft *ihevc_chroma_itrans_recon_4x4_fptr; ihevc_chroma_itrans_recon_8x8_ft *ihevc_chroma_itrans_recon_8x8_fptr; ihevc_chroma_itrans_recon_16x16_ft *ihevc_chroma_itrans_recon_16x16_fptr; - ihevc_chroma_itrans_recon_32x32_ft *ihevc_chroma_itrans_recon_32x32_fptr; ihevc_recon_4x4_ttype1_ft *ihevc_recon_4x4_ttype1_fptr; ihevc_recon_4x4_ft *ihevc_recon_4x4_fptr; ihevc_recon_8x8_ft *ihevc_recon_8x8_fptr; @@ -148,7 +152,6 @@ typedef struct ihevc_chroma_recon_4x4_ft *ihevc_chroma_recon_4x4_fptr; ihevc_chroma_recon_8x8_ft *ihevc_chroma_recon_8x8_fptr; ihevc_chroma_recon_16x16_ft *ihevc_chroma_recon_16x16_fptr; - ihevc_chroma_recon_32x32_ft *ihevc_chroma_recon_32x32_fptr; ihevc_memcpy_mul_8_ft *ihevc_memcpy_mul_8_fptr; ihevc_memcpy_ft *ihevc_memcpy_fptr; ihevc_memset_mul_8_ft *ihevc_memset_mul_8_fptr; @@ -175,36 +178,12 @@ typedef struct ihevc_sao_edge_offset_class2_chroma_ft *ihevc_sao_edge_offset_class2_chroma_fptr; ihevc_sao_edge_offset_class3_ft *ihevc_sao_edge_offset_class3_fptr; ihevc_sao_edge_offset_class3_chroma_ft *ihevc_sao_edge_offset_class3_chroma_fptr; + ihevcd_fmt_conv_420sp_to_rgba8888_ft *ihevcd_fmt_conv_420sp_to_rgba8888_fptr; + ihevcd_fmt_conv_420sp_to_rgb565_ft *ihevcd_fmt_conv_420sp_to_rgb565_fptr; ihevcd_fmt_conv_420sp_to_420sp_ft *ihevcd_fmt_conv_420sp_to_420sp_fptr; ihevcd_fmt_conv_420sp_to_420p_ft *ihevcd_fmt_conv_420sp_to_420p_fptr; - ihevcd_fmt_conv_444sp_to_444p_ft *ihevcd_fmt_conv_444sp_to_444p_fptr; ihevcd_itrans_recon_dc_luma_ft *ihevcd_itrans_recon_dc_luma_fptr; ihevcd_itrans_recon_dc_chroma_ft *ihevcd_itrans_recon_dc_chroma_fptr; - ihevcd_itrans_res_dc_ft *ihevcd_itrans_res_dc_fptr; }func_selector_t; -void ihevcd_init_arch(void *pv_codec); - -void ihevcd_init_function_ptr(void *pv_codec); - -#ifdef __cplusplus -extern "C" { -#endif -void ihevcd_init_function_ptr_generic(func_selector_t *ps_func_selector); -void ihevcd_init_function_ptr_ssse3(func_selector_t *ps_func_selector); -void ihevcd_init_function_ptr_sse42(func_selector_t *ps_func_selector); - -#ifndef DISABLE_AVX2 -void ihevcd_init_function_ptr_avx2(func_selector_t *ps_func_selector); -#endif - -void ihevcd_init_function_ptr_neonintr(func_selector_t *ps_func_selector); -void ihevcd_init_function_ptr_noneon(func_selector_t *ps_func_selector); -void ihevcd_init_function_ptr_a9q(func_selector_t *ps_func_selector); -void ihevcd_init_function_ptr_av8(func_selector_t *ps_func_selector); - -#ifdef __cplusplus -} -#endif - #endif /* _IHEVCD_FUNCTION_SELECTOR_H_ */ diff --git a/decoder/ihevcd_ilf_padding.c b/decoder/ihevcd_ilf_padding.c index 7edbfa9..9db82e5 100644 --- a/decoder/ihevcd_ilf_padding.c +++ b/decoder/ihevcd_ilf_padding.c @@ -154,7 +154,8 @@ void ihevcd_ilf_pad_frame(deblk_ctxt_t *ps_deblk_ctxt, sao_ctxt_t *ps_sao_ctxt) { UWORD8 *pu1_cur_ctb_luma = ps_deblk_ctxt->pu1_cur_pic_luma + (i4_ctb_x * ctb_size - + i4_ctb_y * ctb_size * ps_codec->i4_strd); + + i4_ctb_y * ctb_size + * ps_codec->i4_strd); UWORD8 *pu1_cur_ctb_chroma = ps_deblk_ctxt->pu1_cur_pic_chroma + i4_ctb_x * ctb_size + (i4_ctb_y * ctb_size * ps_codec->i4_strd / 2); @@ -162,56 +163,46 @@ void ihevcd_ilf_pad_frame(deblk_ctxt_t *ps_deblk_ctxt, sao_ctxt_t *ps_sao_ctxt) if(0 == i4_ctb_x) { WORD32 pad_ht_luma; + WORD32 pad_ht_chroma; pad_ht_luma = ctb_size; pad_ht_luma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; + pad_ht_chroma = ctb_size / 2; + pad_ht_chroma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; /* Pad left after 1st CTB is processed */ ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(pu1_cur_ctb_luma - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_LEFT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - WORD32 pad_ht_chroma = ctb_size / 2; - pad_ht_chroma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; - ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(pu1_cur_ctb_chroma - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); - } + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(pu1_cur_ctb_chroma - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); } else if((ps_sps->i2_pic_wd_in_ctb - 1) == i4_ctb_x) { WORD32 pad_ht_luma; + WORD32 pad_ht_chroma; WORD32 cols_remaining = ps_sps->i2_pic_width_in_luma_samples - (i4_ctb_x << ps_sps->i1_log2_ctb_size); pad_ht_luma = ctb_size; pad_ht_luma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; + pad_ht_chroma = ctb_size / 2; + pad_ht_chroma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; /* Pad right after last CTB in the current row is processed */ ps_codec->s_func_selector.ihevc_pad_right_luma_fptr(pu1_cur_ctb_luma + cols_remaining - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - WORD32 pad_ht_chroma = ctb_size / 2; - pad_ht_chroma += (ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y ? 8 : 0; - ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(pu1_cur_ctb_chroma + cols_remaining - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_RIGHT); - } + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(pu1_cur_ctb_chroma + cols_remaining - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_RIGHT); + if((ps_sps->i2_pic_ht_in_ctb - 1) == i4_ctb_y) { UWORD8 *pu1_buf; - /* Since SAO is shifted by 8x8, chroma padding can not be done till second row is processed */ /* Hence moving top padding to to end of frame, Moving it to second row also results in problems when there is only one row */ /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_top(ps_deblk_ctxt->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ihevc_pad_top(ps_deblk_ctxt->pu1_cur_pic_chroma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP / 2); - } + ihevc_pad_top(ps_deblk_ctxt->pu1_cur_pic_chroma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP / 2); pu1_buf = ps_deblk_ctxt->pu1_cur_pic_luma + ps_codec->i4_strd * ps_sps->i2_pic_height_in_luma_samples - PAD_LEFT; /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_buf = ps_deblk_ctxt->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2) - PAD_LEFT; - ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT / 2); - } + pu1_buf = ps_deblk_ctxt->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2) - PAD_LEFT; + ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT / 2); } } } diff --git a/decoder/ihevcd_inter_pred.c b/decoder/ihevcd_inter_pred.c index 6082a3f..8e3fe77 100644 --- a/decoder/ihevcd_inter_pred.c +++ b/decoder/ihevcd_inter_pred.c @@ -70,6 +70,25 @@ #include "ihevc_inter_pred.h" #include "ihevcd_profile.h" +static WORD8 gai1_luma_filter[4][NTAPS_LUMA] = +{ + { 0, 0, 0, 64, 0, 0, 0, 0 }, + { -1, 4, -10, 58, 17, -5, 1, 0 }, + { -1, 4, -11, 40, 40, -11, 4, -1 }, + { 0, 1, -5, 17, 58, -10, 4, -1 } }; + +/* The filter uses only the first four elements in each array */ +static WORD8 gai1_chroma_filter[8][NTAPS_LUMA] = +{ + { 0, 64, 0, 0, 0, 0, 0, 0 }, + { -2, 58, 10, -2, 0, 0, 0, 0 }, + { -4, 54, 16, -2, 0, 0, 0, 0 }, + { -6, 46, 28, -4, 0, 0, 0, 0 }, + { -4, 36, 36, -4, 0, 0, 0, 0 }, + { -4, 28, 46, -6, 0, 0, 0, 0 }, + { -2, 16, 54, -4, 0, 0, 0, 0 }, + { -2, 10, 58, -2, 0, 0, 0, 0 } }; + /** ******************************************************************************* * @@ -144,10 +163,6 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) WORD32 next_ctb_idx; WORD8(*coeff)[8]; WORD32 chroma_yuv420sp_vu; - WORD32 num_comp; - WORD32 h_samp_factor, v_samp_factor; - WORD32 chroma_pixel_strd = 2; - WORD32 is_yuv420, is_yuv444; PROFILE_DISABLE_INTER_PRED(); ps_codec = ps_proc->ps_codec; @@ -196,12 +211,6 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) chroma_offset_l1_cb = 0; chroma_offset_l1_cr = 0; - num_comp = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_MONOCHROME ? 1 : 2; - is_yuv420 = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 1 : 0; - is_yuv444 = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 0; - h_samp_factor = is_yuv444 ? 1 : 2; - v_samp_factor = is_yuv420 ? 2 : 1; - for(pu_indx = 0; pu_indx < i4_pu_cnt; pu_indx++, ps_pu++) { /* If the PU is intra then proceed to the next */ @@ -224,20 +233,15 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) ps_pic_buf_l0 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list0[ps_pu->mv.i1_l0_ref_idx].pv_pic_buf)); ref_pic_luma_l0 = ps_pic_buf_l0->pu1_luma; + ref_pic_chroma_l0 = ps_pic_buf_l0->pu1_chroma; luma_weight_l0 = ps_slice_hdr->s_wt_ofst.i2_luma_weight_l0[ps_pu->mv.i1_l0_ref_idx]; + chroma_weight_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cb[ps_pu->mv.i1_l0_ref_idx]; + chroma_weight_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cr[ps_pu->mv.i1_l0_ref_idx]; luma_offset_l0 = ps_slice_hdr->s_wt_ofst.i2_luma_offset_l0[ps_pu->mv.i1_l0_ref_idx]; - - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ref_pic_chroma_l0 = ps_pic_buf_l0->pu1_chroma; - chroma_weight_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cb[ps_pu->mv.i1_l0_ref_idx]; - chroma_weight_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l0_cr[ps_pu->mv.i1_l0_ref_idx]; - - chroma_offset_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cb[ps_pu->mv.i1_l0_ref_idx]; - chroma_offset_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cr[ps_pu->mv.i1_l0_ref_idx]; - } + chroma_offset_l0_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cb[ps_pu->mv.i1_l0_ref_idx]; + chroma_offset_l0_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l0_cr[ps_pu->mv.i1_l0_ref_idx]; } if(ps_pu->b2_pred_mode != PRED_L0) @@ -245,24 +249,19 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) pic_buf_t *ps_pic_buf_l1; ps_pic_buf_l1 = (pic_buf_t *)((ps_slice_hdr->as_ref_pic_list1[ps_pu->mv.i1_l1_ref_idx].pv_pic_buf)); ref_pic_luma_l1 = ps_pic_buf_l1->pu1_luma; + ref_pic_chroma_l1 = ps_pic_buf_l1->pu1_chroma; luma_weight_l1 = ps_slice_hdr->s_wt_ofst.i2_luma_weight_l1[ps_pu->mv.i1_l1_ref_idx]; + chroma_weight_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cb[ps_pu->mv.i1_l1_ref_idx]; + chroma_weight_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cr[ps_pu->mv.i1_l1_ref_idx]; luma_offset_l1 = ps_slice_hdr->s_wt_ofst.i2_luma_offset_l1[ps_pu->mv.i1_l1_ref_idx]; - - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ref_pic_chroma_l1 = ps_pic_buf_l1->pu1_chroma; - chroma_weight_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cb[ps_pu->mv.i1_l1_ref_idx]; - chroma_weight_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_weight_l1_cr[ps_pu->mv.i1_l1_ref_idx]; - - chroma_offset_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cb[ps_pu->mv.i1_l1_ref_idx]; - chroma_offset_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cr[ps_pu->mv.i1_l1_ref_idx]; - } + chroma_offset_l1_cb = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cb[ps_pu->mv.i1_l1_ref_idx]; + chroma_offset_l1_cr = ps_slice_hdr->s_wt_ofst.i2_chroma_offset_l1_cr[ps_pu->mv.i1_l1_ref_idx]; } /*luma and chroma components*/ - for(clr_indx = 0; clr_indx < num_comp; clr_indx++) + for(clr_indx = 0; clr_indx < 2; clr_indx++) { PROFILE_DISABLE_INTER_PRED_LUMA(clr_indx); PROFILE_DISABLE_INTER_PRED_CHROMA(clr_indx); @@ -309,7 +308,7 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) pu1_dst = pu1_dst_luma + pu_y * ref_strd + pu_x; ntaps = NTAPS_LUMA; - coeff = gai1_ihevc_luma_filter; + coeff = gai1_luma_filter; } else @@ -320,14 +319,15 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) if(ps_pu->b2_pred_mode != PRED_L1) { mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2)); - ai2_xint[0] = (pu_x * chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd; - ai2_xfrac[0] = mv & (is_yuv420 ? 7 : 3); + ai2_xint[0] = (pu_x / 2 + (mv >> 3)) << 1; + ai2_xfrac[0] = mv & 7; mv = CLIP3(ps_pu->mv.s_l0_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2)); - ai2_yint[0] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1))); - ai2_yfrac[0] = mv & (is_yuv444 ? 3 : 7); + ai2_yint[0] = pu_y / 2 + (mv >> 3); + ai2_yfrac[0] = mv & 7; - ref_pic_l0 = ref_pic_chroma_l0 + ai2_yint[0] * (ref_strd * chroma_pixel_strd / h_samp_factor) + ai2_xint[0]; + ref_pic_l0 = ref_pic_chroma_l0 + ai2_yint[0] * ref_strd + + ai2_xint[0]; ai2_xfrac[0] &= ps_codec->i4_mv_frac_mask; ai2_yfrac[0] &= ps_codec->i4_mv_frac_mask; @@ -337,25 +337,24 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) if(ps_pu->b2_pred_mode != PRED_L0) { mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvx, (-((MAX_CTB_SIZE + pu_x + 7) << 2)), ((ps_sps->i2_pic_width_in_luma_samples - pu_x + 7) << 2)); - ai2_xint[1] = (pu_x * chroma_pixel_strd / h_samp_factor) + (mv >> (2 + h_samp_factor - 1)) * chroma_pixel_strd; - ai2_xfrac[1] = mv & (is_yuv420 ? 7 : 3); + ai2_xint[1] = (pu_x / 2 + (mv >> 3)) << 1; + ai2_xfrac[1] = mv & 7; mv = CLIP3(ps_pu->mv.s_l1_mv.i2_mvy, (-((MAX_CTB_SIZE + pu_y + 7) << 2)), ((ps_sps->i2_pic_height_in_luma_samples - pu_y + 7) << 2)); - ai2_yint[1] = ((pu_y / v_samp_factor) + (mv >> (2 + v_samp_factor - 1))); - ai2_yfrac[1] = mv & (is_yuv444 ? 3 : 7); - - ref_pic_l1 = ref_pic_chroma_l1 + ai2_yint[1] * (ref_strd * chroma_pixel_strd / h_samp_factor) + ai2_xint[1]; + ai2_yint[1] = pu_y / 2 + (mv >> 3); + ai2_yfrac[1] = mv & 7; + ref_pic_l1 = ref_pic_chroma_l1 + ai2_yint[1] * ref_strd + + ai2_xint[1]; ai2_xfrac[1] &= ps_codec->i4_mv_frac_mask; ai2_yfrac[1] &= ps_codec->i4_mv_frac_mask; } - pu1_dst = pu1_dst_chroma + (pu_y / v_samp_factor) * (ref_strd * chroma_pixel_strd / h_samp_factor) + - (pu_x * chroma_pixel_strd / h_samp_factor); + pu1_dst = pu1_dst_chroma + pu_y * ref_strd / 2 + pu_x; ntaps = NTAPS_CHROMA; - coeff = gai1_ihevc_chroma_filter; + coeff = gai1_chroma_filter; } if(ps_pu->b2_pred_mode != PRED_L1) @@ -397,10 +396,6 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) if(func_ptr1 != NULL) { func_src_strd = ref_strd; - if (clr_indx != 0) - { - func_src_strd *= (chroma_pixel_strd / h_samp_factor); - } func_src = (ai2_xfrac[0] && ai2_yfrac[0]) ? ref_pic_l0 - (ntaps / 2 - 1) * func_src_strd : ref_pic_l0; @@ -414,14 +409,10 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) func_dst_strd = (weighted_pred || bi_pred || (ai2_xfrac[0] && ai2_yfrac[0])) ? pu_wd : ref_strd; - if (clr_indx != 0) - { - func_dst_strd *= (chroma_pixel_strd / h_samp_factor); - } - func_coeff = ai2_xfrac[0] ? coeff[ai2_xfrac[0] << (is_yuv444 ? clr_indx : 0)] - : coeff[ai2_yfrac[0] << (is_yuv444 ? clr_indx : 0)]; - func_wd = pu_wd >> (is_yuv420 ? clr_indx : 0); - func_ht = pu_ht >> (is_yuv444 ? 0 : clr_indx); + func_coeff = ai2_xfrac[0] ? + coeff[ai2_xfrac[0]] : coeff[ai2_yfrac[0]]; + func_wd = pu_wd >> clr_indx; + func_ht = pu_ht >> clr_indx; func_ht += (ai2_xfrac[0] && ai2_yfrac[0]) ? ntaps - 1 : 0; func_ptr1(func_src, func_dst, func_src_strd, func_dst_strd, func_coeff, func_ht, func_wd); @@ -431,23 +422,15 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) if(func_ptr2 != NULL) { func_src_strd = pu_wd; - if (clr_indx != 0) - { - func_src_strd *= (chroma_pixel_strd / h_samp_factor); - } func_src = pi2_tmp1 + (ntaps / 2 - 1) * func_src_strd; func_dst = (weighted_pred || bi_pred) ? (void *)pi2_tmp1 : (void *)pu1_dst; func_dst_strd = (weighted_pred || bi_pred) ? pu_wd : ref_strd; - if (clr_indx != 0) - { - func_dst_strd *= (chroma_pixel_strd / h_samp_factor); - } - func_coeff = coeff[ai2_yfrac[0] << (is_yuv444 ? clr_indx : 0)]; - func_wd = pu_wd >> (is_yuv420 ? clr_indx : 0); - func_ht = pu_ht >> (is_yuv444 ? 0 : clr_indx); + func_coeff = coeff[ai2_yfrac[0]]; + func_wd = pu_wd >> clr_indx; + func_ht = pu_ht >> clr_indx; func_ptr2(func_src, func_dst, func_src_strd, func_dst_strd, func_coeff, func_ht, func_wd); } @@ -455,10 +438,6 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) if(func_ptr3 != NULL) { func_src_strd = ref_strd; - if (clr_indx != 0) - { - func_src_strd *= (chroma_pixel_strd / h_samp_factor); - } func_src = (ai2_xfrac[1] && ai2_yfrac[1]) ? ref_pic_l1 - (ntaps / 2 - 1) * func_src_strd : ref_pic_l1; @@ -472,42 +451,28 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) func_dst_strd = (weighted_pred || bi_pred || (ai2_xfrac[1] && ai2_yfrac[1])) ? pu_wd : ref_strd; - if (clr_indx != 0) - { - func_dst_strd *= (chroma_pixel_strd / h_samp_factor); - } - func_coeff = ai2_xfrac[1] ? coeff[ai2_xfrac[1] << (is_yuv444 ? clr_indx : 0)] - : coeff[ai2_yfrac[1] << (is_yuv444 ? clr_indx : 0)]; - func_wd = pu_wd >> (is_yuv420 ? clr_indx : 0); - func_ht = pu_ht >> (is_yuv444 ? 0 : clr_indx); - + func_coeff = ai2_xfrac[1] ? + coeff[ai2_xfrac[1]] : coeff[ai2_yfrac[1]]; + func_wd = pu_wd >> clr_indx; + func_ht = pu_ht >> clr_indx; func_ht += (ai2_xfrac[1] && ai2_yfrac[1]) ? ntaps - 1 : 0; func_ptr3(func_src, func_dst, func_src_strd, func_dst_strd, func_coeff, func_ht, func_wd); - } if(func_ptr4 != NULL) { func_src_strd = pu_wd; - if (clr_indx != 0) - { - func_src_strd *= (chroma_pixel_strd / h_samp_factor); - } func_src = pi2_tmp2 + (ntaps / 2 - 1) * func_src_strd; func_dst = (weighted_pred || bi_pred) ? (void *)pi2_tmp2 : (void *)pu1_dst; func_dst_strd = (weighted_pred || bi_pred) ? pu_wd : ref_strd; - if (clr_indx != 0) - { - func_dst_strd *= (chroma_pixel_strd / h_samp_factor); - } - func_coeff = coeff[ai2_yfrac[1] << (is_yuv444 ? clr_indx : 0)]; - func_wd = pu_wd >> (is_yuv420 ? clr_indx : 0); - func_ht = pu_ht >> (is_yuv444 ? 0 : clr_indx); + func_coeff = coeff[ai2_yfrac[1]]; + func_wd = pu_wd >> clr_indx; + func_ht = pu_ht >> clr_indx; func_ptr4(func_src, func_dst, func_src_strd, func_dst_strd, func_coeff, func_ht, func_wd); @@ -553,17 +518,15 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) { shift = ps_slice_hdr->s_wt_ofst.i1_chroma_log2_weight_denom + SHIFT_14_MINUS_BIT_DEPTH + 1; - func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor); - func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor); if(chroma_yuv420sp_vu) { ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1, pi2_tmp2, pu1_dst, - func_src_strd, - func_src_strd, - func_dst_strd, + pu_wd, + pu_wd, + ref_strd, chroma_weight_l0_cr, chroma_weight_l0_cb, chroma_offset_l0_cr, @@ -575,17 +538,17 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) shift, lvl_shift1, lvl_shift2, - pu_ht >> (is_yuv444 ? 0 : clr_indx), - pu_wd >> (is_yuv420 ? clr_indx : 0)); + pu_ht >> 1, + pu_wd >> 1); } else { ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr(pi2_tmp1, pi2_tmp2, pu1_dst, - func_src_strd, - func_src_strd, - func_dst_strd, + pu_wd, + pu_wd, + ref_strd, chroma_weight_l0_cb, chroma_weight_l0_cr, chroma_offset_l0_cb, @@ -597,8 +560,8 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) shift, lvl_shift1, lvl_shift2, - pu_ht >> (is_yuv444 ? 0 : clr_indx), - pu_wd >> (is_yuv420 ? clr_indx : 0)); + pu_ht >> 1, + pu_wd >> 1); } } } @@ -637,38 +600,36 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) { shift = ps_slice_hdr->s_wt_ofst.i1_chroma_log2_weight_denom + SHIFT_14_MINUS_BIT_DEPTH; - func_src_strd = pu_wd * (chroma_pixel_strd / h_samp_factor); - func_dst_strd = ref_strd * (chroma_pixel_strd / h_samp_factor); if(chroma_yuv420sp_vu) { ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2, pu1_dst, - func_src_strd, - func_dst_strd, + pu_wd, + ref_strd, ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr, ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb, ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr, ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb, shift, lvl_shift1, - pu_ht >> (is_yuv444 ? 0 : clr_indx), - pu_wd >> (is_yuv420 ? clr_indx : 0)); + pu_ht >> 1, + pu_wd >> 1); } else { ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr(ps_pu->b2_pred_mode == PRED_L0 ? pi2_tmp1 : pi2_tmp2, pu1_dst, - func_src_strd, - func_dst_strd, + pu_wd, + ref_strd, ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cb : chroma_weight_l1_cb, ps_pu->b2_pred_mode == PRED_L0 ? chroma_weight_l0_cr : chroma_weight_l1_cr, ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cb : chroma_offset_l1_cb, ps_pu->b2_pred_mode == PRED_L0 ? chroma_offset_l0_cr : chroma_offset_l1_cr, shift, lvl_shift1, - pu_ht >> (is_yuv444 ? 0 : clr_indx), - pu_wd >> (is_yuv420 ? clr_indx : 0)); + pu_ht >> 1, + pu_wd >> 1); } } } @@ -677,33 +638,26 @@ void ihevcd_inter_pred_ctb(process_ctxt_t *ps_proc) { lvl_shift1 = 0; lvl_shift2 = 0; - if((0 == clr_indx) && (ai2_xfrac[0] && ai2_yfrac[0])) lvl_shift1 = (1 << 13); if((0 == clr_indx) && (ai2_xfrac[1] && ai2_yfrac[1])) lvl_shift2 = (1 << 13); - func_src_strd = pu_wd; - func_dst_strd = ref_strd; - if (clr_indx != 0) + if(clr_indx != 0) { - func_src_strd *= (chroma_pixel_strd / h_samp_factor); - func_dst_strd *= (chroma_pixel_strd / h_samp_factor); + pu_ht = (pu_ht >> 1); } - func_ht = pu_ht >> (is_yuv444 ? 0 : clr_indx); - func_wd = pu_wd << (is_yuv444 ? clr_indx : 0); - ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr(pi2_tmp1, pi2_tmp2, pu1_dst, - func_src_strd, - func_src_strd, - func_dst_strd, + pu_wd, + pu_wd, + ref_strd, lvl_shift1, lvl_shift2, - func_ht, - func_wd); + pu_ht, + pu_wd); } } diff --git a/decoder/ihevcd_iquant_itrans_recon_ctb.c b/decoder/ihevcd_iquant_itrans_recon_ctb.c index eb96ff6..c526231 100644 --- a/decoder/ihevcd_iquant_itrans_recon_ctb.c +++ b/decoder/ihevcd_iquant_itrans_recon_ctb.c @@ -80,6 +80,8 @@ #include "ihevcd_statistics.h" #include "ihevcd_itrans_recon_dc.h" +static const UWORD32 gau4_ihevcd_4_bit_reverse[] = { 0, 8, 4, 12, 2, 10, 6, 14, 1, 9, 5, 13, 3, 11, 7, 15 }; + /* Globals */ static const WORD32 g_i4_ip_funcs[MAX_NUM_IP_MODES] = @@ -130,93 +132,9 @@ const WORD16 *g_ai2_ihevc_trans_tables[] = }; -/*****************************************************************************/ -/* Structures */ -/*****************************************************************************/ -/** - * Structure to hold fields required for iq it recon construction process - */ -typedef struct -{ - /* - * parsed transform coeffs - */ - WORD16 *pi2_tu_coeff; - - /** - * pred buffer - */ - UWORD8 *pu1_pred; - - /** - * recon buffer - */ - UWORD8 *pu1_dst; - - /** - * transform coeffs buffer stride - */ - WORD32 tu_coeff_stride; - - /** - * pred buffer stride - */ - WORD32 pred_strd; - - /** - * recon buffer stride - */ - WORD32 dst_strd; - - /** - * zero cols, zero rows for optimizing itrans process - */ - UWORD32 zero_cols; - UWORD32 zero_rows; - - /** - * dc only? for optimizing itrans process - */ - UWORD32 coeff_type; - WORD16 coeff_value; - - /** - * cbf - */ - UWORD8 cbf; - - /** - * is transform skip - */ - UWORD8 transform_skip_flag; - -#ifdef ENABLE_MAIN_REXT_PROFILE - /** - * is explicit rdpcm enabled - */ - UWORD8 explicit_rdpcm_flag; - - /** - * explicit rdpcm dir - */ - UWORD8 explicit_rdpcm_dir; -#endif - -} tu_plane_iq_it_recon_ctxt_t; - - /*****************************************************************************/ /* Function Prototypes */ /*****************************************************************************/ -typedef void (*PF_IQITRECON_PLANE)(process_ctxt_t *ps_proc, - tu_t *ps_tu, - tu_plane_iq_it_recon_ctxt_t *ps_pl_tu_ctxt, - WORD32 func_idx, - WORD32 log2_trans_size, - CHROMA_PLANE_ID_T chroma_plane, - WORD8 intra_flag, - WORD8 intra_pred_mode); - /* Returns number of ai2_level read from ps_sblk_coeff */ UWORD8* ihevcd_unpack_coeffs(WORD16 *pi2_tu_coeff, WORD32 log2_trans_size, @@ -260,11 +178,7 @@ UWORD8* ihevcd_unpack_coeffs(WORD16 *pi2_tu_coeff, u1_scan_type = *pu1_tu_coeff_data++; /* 0th bit has trans_skip */ trans_skip = u1_scan_type & 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - u1_scan_type = (u1_scan_type & 0xF) >> 1; -#else u1_scan_type >>= 1; -#endif pi2_sblk_ptr = pi2_tu_coeff; @@ -613,210 +527,6 @@ WORD32 ihevcd_get_intra_nbr_flag(process_ctxt_t *ps_proc, } -static void ihevcd_iquant_itrans_recon_tu_plane(process_ctxt_t *ps_proc, - tu_t *ps_tu, - tu_plane_iq_it_recon_ctxt_t *ps_pl_tu_ctxt, - WORD32 func_idx, - WORD32 log2_trans_size, - CHROMA_PLANE_ID_T chroma_plane, - WORD8 intra_flag, - WORD8 intra_pred_mode) -{ - sps_t *ps_sps = ps_proc->ps_sps; - pps_t *ps_pps = ps_proc->ps_pps; - codec_t *ps_codec = ps_proc->ps_codec; - - if(1 == ps_pl_tu_ctxt->cbf) - { - if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag) - { - /* Recon */ - ps_codec->apf_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, ps_pl_tu_ctxt->pu1_pred, - ps_pl_tu_ctxt->pu1_dst, ps_pl_tu_ctxt->tu_coeff_stride, - ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, - ps_pl_tu_ctxt->zero_cols); - } - else - { - /* iQuant , iTrans and Recon */ - if((0 == ps_pl_tu_ctxt->coeff_type)) - { - ps_codec->apf_itrans_recon[func_idx](ps_pl_tu_ctxt->pi2_tu_coeff, - ps_proc->pi2_itrans_intrmd_buf, - ps_pl_tu_ctxt->pu1_pred, - ps_pl_tu_ctxt->pu1_dst, - ps_pl_tu_ctxt->tu_coeff_stride, - ps_pl_tu_ctxt->pred_strd, - ps_pl_tu_ctxt->dst_strd, - ps_pl_tu_ctxt->zero_cols, - ps_pl_tu_ctxt->zero_rows); - } - else /* DC only */ - { - ps_codec->apf_itrans_recon_dc[chroma_plane != NULL_PLANE]( - ps_pl_tu_ctxt->pu1_pred, ps_pl_tu_ctxt->pu1_dst, - ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, log2_trans_size, - ps_pl_tu_ctxt->coeff_value); - } - } - } -} - -#ifdef ENABLE_MAIN_REXT_PROFILE -static void ihevcd_iquant_itrans_resi_recon_tu_plane(process_ctxt_t *ps_proc, - tu_t *ps_tu, - tu_plane_iq_it_recon_ctxt_t *ps_pl_tu_ctxt, - WORD32 func_idx, - WORD32 log2_trans_size, - CHROMA_PLANE_ID_T chroma_plane, - WORD8 intra_flag, - WORD8 intra_pred_mode) -{ - sps_t *ps_sps = ps_proc->ps_sps; - pps_t *ps_pps = ps_proc->ps_pps; - codec_t *ps_codec = ps_proc->ps_codec; - WORD8 trans_size = 1 << log2_trans_size; - WORD16 *pi2_res = ps_proc->pi2_res_luma_buf; - WORD16 *pi2_res_uv = ps_proc->pi2_res_chroma_buf; - WORD32 alpha = 0; - WORD16 *residue_out_base = chroma_plane == NULL_PLANE ? pi2_res : pi2_res_uv; - WORD16 *residue_out = residue_out_base; - // if both rdpcm and rotate are to be applied, share the output residue buffer between the - // two transforms - WORD16 *residue_out_intrmdt = residue_out_base + (TRANS_SIZE_4 * TRANS_SIZE_4); - - if(chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0) - { - alpha = (1 << (ps_tu->b3_cb_log2_res_scale_abs_plus1 - 1)) - * (1 - 2 * ps_tu->b1_cb_log2_res_sign); - } - else if(chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0) - { - alpha = (1 << (ps_tu->b3_cr_log2_res_scale_abs_plus1 - 1)) - * (1 - 2 * ps_tu->b1_cr_log2_res_sign); - } - if(1 == ps_pl_tu_ctxt->cbf) - { - if(ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag) - { - WORD8 rotate = ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4 - && intra_flag; - WORD8 rdpcm = (ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag - && (intra_pred_mode == 10 || intra_pred_mode == 26)) - || ps_pl_tu_ctxt->explicit_rdpcm_flag; - WORD16 *src_residue = ps_pl_tu_ctxt->pi2_tu_coeff; - WORD16 src_residue_strd = ps_pl_tu_ctxt->tu_coeff_stride; - - if(rotate) - { - ihevc_res_4x4_rotate(src_residue, rdpcm ? residue_out_intrmdt : residue_out, - src_residue_strd, trans_size, ps_pl_tu_ctxt->zero_cols); - ps_pl_tu_ctxt->zero_cols = - gau4_ihevcd_4_bit_reverse[ps_pl_tu_ctxt->zero_cols & 0xF]; - src_residue = residue_out_intrmdt; - src_residue_strd = trans_size; - } - - if(rdpcm) - { - WORD8 rdpcm_dir = - ps_pl_tu_ctxt->explicit_rdpcm_flag ? - ps_pl_tu_ctxt->explicit_rdpcm_dir : - intra_pred_mode != 10; - if(rdpcm_dir == 0) - { - ihevc_res_nxn_rdpcm_horz(src_residue, residue_out, src_residue_strd, trans_size, - trans_size, ps_pl_tu_ctxt->zero_cols); - ps_pl_tu_ctxt->zero_cols = (1 << CTZ(~ps_pl_tu_ctxt->zero_cols)) - 1; - } - else - { - ihevc_res_nxn_rdpcm_vert(src_residue, residue_out, src_residue_strd, trans_size, - trans_size, ps_pl_tu_ctxt->zero_cols); - } - } - - if(!rdpcm && !rotate) - { - ihevc_res_nxn_copy(src_residue, residue_out, src_residue_strd, trans_size, - trans_size, ps_pl_tu_ctxt->zero_cols); - } - } - else - { - /* iQuant, iTrans */ - if(0 == ps_pl_tu_ctxt->coeff_type) - { - WORD32 func_tmp_idx = chroma_plane != NULL_PLANE ? func_idx - 4 : func_idx; - ps_codec->apf_itrans_res[func_tmp_idx](ps_pl_tu_ctxt->pi2_tu_coeff, - ps_proc->pi2_itrans_intrmd_buf, residue_out, - ps_pl_tu_ctxt->tu_coeff_stride, trans_size, - ps_pl_tu_ctxt->zero_cols, - ps_pl_tu_ctxt->zero_rows); - } - else /* DC only */ - { - ps_codec->apf_itrans_res_dc(residue_out, trans_size, log2_trans_size, - ps_pl_tu_ctxt->coeff_value); - } - ps_pl_tu_ctxt->zero_cols = 0; - } - if(!alpha) - { - ps_codec->apf_recon[func_idx](residue_out, ps_pl_tu_ctxt->pu1_pred, - ps_pl_tu_ctxt->pu1_dst, trans_size, - ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd, - ps_pl_tu_ctxt->zero_cols); - } - } - if(alpha) - { - if(0 == ps_pl_tu_ctxt->cbf) - { - memset(residue_out, 0, trans_size * trans_size * sizeof(WORD16)); - } - ihevc_chroma_recon_nxn_ccp(pi2_res, pi2_res_uv, ps_pl_tu_ctxt->pu1_pred, - ps_pl_tu_ctxt->pu1_dst, alpha, trans_size, trans_size, - trans_size, ps_pl_tu_ctxt->pred_strd, ps_pl_tu_ctxt->dst_strd); - } -} - -PF_IQITRECON_PLANE get_iqitrec_func(process_ctxt_t *ps_proc, - tu_t *ps_tu, - tu_plane_iq_it_recon_ctxt_t *ps_pl_tu_ctxt, - WORD32 log2_trans_size, - CHROMA_PLANE_ID_T chroma_plane, - WORD8 intra_flag, - WORD8 intra_pred_mode) -{ - sps_t *ps_sps = ps_proc->ps_sps; - pps_t *ps_pps = ps_proc->ps_pps; - WORD8 trans_size = 1 << log2_trans_size; - - if(1 == ps_pl_tu_ctxt->cbf - && (ps_tu->b1_transquant_bypass || ps_pl_tu_ctxt->transform_skip_flag)) - { - if(ps_sps->i1_transform_skip_rotation_enabled_flag && trans_size == 4 && intra_flag) - return ihevcd_iquant_itrans_resi_recon_tu_plane; - if(ps_sps->i1_implicit_rdpcm_enabled_flag && intra_flag - && (intra_pred_mode == 10 || intra_pred_mode == 26)) - return ihevcd_iquant_itrans_resi_recon_tu_plane; - if(ps_pl_tu_ctxt->explicit_rdpcm_flag) - return ihevcd_iquant_itrans_resi_recon_tu_plane; - } - if(ps_pps->i1_cross_component_prediction_enabled_flag) - { - if((chroma_plane == NULL_PLANE - && (ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0 - || ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0)) - || (chroma_plane == V_PLANE && ps_tu->b3_cr_log2_res_scale_abs_plus1 != 0) - || (chroma_plane == U_PLANE && ps_tu->b3_cb_log2_res_scale_abs_plus1 != 0)) - return ihevcd_iquant_itrans_resi_recon_tu_plane; - } - return ihevcd_iquant_itrans_recon_tu_plane; -} -#endif - WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) { WORD16 *pi2_scaling_mat; @@ -829,30 +539,24 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) WORD16 *pi2_ctb_coeff; WORD32 tu_cnt; WORD16 *pi2_tu_coeff; + WORD16 *pi2_tmp; WORD32 pic_strd; WORD32 luma_nbr_flags; WORD32 luma_nbr_flags_4x4[4] = { 0 }; WORD32 chroma_nbr_flags = 0; - WORD32 chroma_nbr_flags_subtu = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 disable_boundary_filter = 0; -#endif UWORD8 u1_luma_pred_mode_first_tu = 0; /* Pointers for generating 2d coeffs from coeff-map */ UWORD8 *pu1_tu_coeff_data; /* nbr avail map for CTB */ /* 1st bit points to neighbor (left/top_left/bot_left) */ /* 1Tb starts at 2nd bit from msb of 2nd value in array, followed by number of min_tu's in that ctb */ - UWORD32 au4_intra_nbr_avail[MAX_CTB_SIZE / MIN_TU_SIZE + 2 /* Top nbr + bot nbr */]; - UWORD32 top_avail_bits; + UWORD32 au4_intra_nbr_avail[MAX_CTB_SIZE / MIN_TU_SIZE + + 2 /* Top nbr + bot nbr */]; UWORD32 + top_avail_bits; sps_t *ps_sps; pps_t *ps_pps; WORD32 intra_flag; UWORD8 *pu1_pic_intra_flag; - WORD32 h_samp_factor, v_samp_factor; - WORD32 chroma_pixel_strd = 2; - PF_IQITRECON_PLANE iqitrecon_fptr = ihevcd_iquant_itrans_recon_tu_plane; - /*************************************************************************/ /* Contanis scaling matrix offset in the following order in a 1D buffer */ /* Entries that are listed as UNUSED are invalid combinations where */ @@ -863,14 +567,14 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) /* Inter 8 x 8 Y, 8 x 8 U, 8 x 8 V */ /* Intra 16x16 Y, 16x16 U, 16x16 V */ /* Inter 16x16 Y, 16x16 U, 16x16 V */ - /* Intra 32x32 Y, 32x32 U, 32x32 V */ - /* Inter 32x32 Y, 32x32 U, 32x32 V */ + /* Intra 32x32 Y, UNUSED, UNUSED */ + /* Inter 32x32 Y, UNUSED, UNUSED */ /* UNUSED, UNUSED, UNUSED */ /* UNUSED, UNUSED, UNUSED */ /*************************************************************************/ static const WORD32 scaling_mat_offset[] = { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, - 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136, 0, 0, 0, 0, 0, 0}; + 1248, 1504, 1760, 2016, 0, 0, 3040, 0, 0, 0, 0, 0, 0, 0, 0}; PROFILE_DISABLE_IQ_IT_RECON_INTRA_PRED(); @@ -889,6 +593,8 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) pic_strd = ps_codec->i4_strd; + pi2_tmp = ps_proc->pi2_itrans_intrmd_buf; + pi2_tu_coeff = pi2_ctb_coeff; ps_tu = ps_proc->ps_tu; @@ -949,40 +655,35 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) } - h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2; - v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1; - /* Applying Inverse transform on all the TU's in CTB */ for(tu_cnt = 0; tu_cnt < ps_proc->i4_ctb_tu_cnt; tu_cnt++, ps_tu++) { - tu_plane_iq_it_recon_ctxt_t y_cb_tu = { 0 }; - tu_plane_iq_it_recon_ctxt_t cr_tu = { 0 }; - tu_plane_iq_it_recon_ctxt_t *ps_cb_tu = &y_cb_tu; - tu_plane_iq_it_recon_ctxt_t *ps_cr_tu = &cr_tu; -#ifdef ENABLE_MAIN_REXT_PROFILE - tu_plane_iq_it_recon_ctxt_t cb_sub_tu = { 0 }; - tu_plane_iq_it_recon_ctxt_t cr_sub_tu = { 0 }; -#endif - + WORD32 transform_skip_flag = 0; + WORD32 transform_skip_flag_v = 0; WORD32 num_comp, c_idx, func_idx; - + WORD32 src_strd, pred_strd, dst_strd; WORD32 qp_div = 0, qp_rem = 0; WORD32 qp_div_v = 0, qp_rem_v = 0; - WORD32 chroma_qp_idx; - WORD8 i1_chroma_pic_qp_offset, i1_chroma_slice_qp_offset; - WORD16 *pi2_dequant_matrix = NULL, *pi2_dequant_matrix_v = NULL; - + UWORD32 zero_cols = 0, zero_cols_v = 0; + UWORD32 zero_rows = 0, zero_rows_v = 0; + UWORD32 coeff_type = 0, coeff_type_v = 0; + WORD16 i2_coeff_value, i2_coeff_value_v; WORD32 trans_size = 0; TRANSFORM_TYPE e_trans_type; WORD32 log2_y_trans_size_minus_2, log2_uv_trans_size_minus_2; WORD32 log2_trans_size; - + WORD32 chroma_qp_idx; + WORD16 *pi2_src = NULL, *pi2_src_v = NULL; + UWORD8 *pu1_pred = NULL, *pu1_pred_v = NULL; + UWORD8 *pu1_dst = NULL, *pu1_dst_v = NULL; + WORD16 *pi2_dequant_matrix = NULL, *pi2_dequant_matrix_v = NULL; WORD32 tu_x, tu_y; WORD32 tu_y_offset, tu_uv_offset; - UWORD8 u1_luma_pred_mode, u1_chroma_pred_mode; + WORD8 i1_chroma_pic_qp_offset, i1_chroma_slice_qp_offset; + UWORD8 u1_cbf = 0, u1_cbf_v = 0, u1_luma_pred_mode, u1_chroma_pred_mode; WORD32 offset; WORD32 pcm_flag; - WORD32 chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU); + WORD32 chroma_yuv420sp_vu = (ps_codec->e_ref_chroma_fmt == IV_YUV_420SP_VU); /* If 420SP_VU is chroma format, pred and dst pointer */ /* will be added +1 to point to U */ WORD32 chroma_yuv420sp_vu_u_offset = 1 * chroma_yuv420sp_vu; @@ -1010,11 +711,12 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) u1_luma_pred_mode = ps_tu->b6_luma_intra_mode; u1_chroma_pred_mode = ps_tu->b3_chroma_intra_mode_idx; - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && u1_chroma_pred_mode != 7) + if(u1_chroma_pred_mode != 7) num_comp = 2; /* Y and UV */ else num_comp = 1; /* Y */ + pcm_flag = 0; if((intra_flag) && (u1_luma_pred_mode == INTRA_PRED_NONE)) @@ -1033,6 +735,7 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) tu_y_offset = tu_x + tu_y * pic_strd; pu1_y_dst += tu_x + tu_y * pic_strd; + pu1_uv_dst += tu_x + (tu_y >> 1) * pic_strd; /* First byte points to number of coded blocks */ pu1_tu_coeff_data++; @@ -1052,32 +755,25 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) pu1_buf += cb_size; } - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + pu1_uv_dst = pu1_uv_dst + chroma_yuv420sp_vu_u_offset; + + /* U */ + for(i = 0; i < cb_size / 2; i++) { - WORD32 chroma_strd = (pic_strd * chroma_pixel_strd) / h_samp_factor; - - pu1_uv_dst += (tu_x * chroma_pixel_strd / h_samp_factor) - + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor)); - pu1_uv_dst = pu1_uv_dst + chroma_yuv420sp_vu_u_offset; - - /* U */ - for(i = 0; i < cb_size / v_samp_factor; i++) + for(j = 0; j < cb_size / 2; j++) { - for(j = 0; j < cb_size / h_samp_factor; j++) - { - pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++; - } + pu1_uv_dst[i * pic_strd + 2 * j] = *pu1_buf++; } + } - pu1_uv_dst = pu1_uv_dst + 1 + chroma_yuv420sp_vu_v_offset; + pu1_uv_dst = pu1_uv_dst + 1 + chroma_yuv420sp_vu_v_offset; - /* V */ - for(i = 0; i < cb_size / v_samp_factor; i++) + /* V */ + for(i = 0; i < cb_size / 2; i++) + { + for(j = 0; j < cb_size / 2; j++) { - for(j = 0; j < cb_size / h_samp_factor; j++) - { - pu1_uv_dst[i * chroma_strd + chroma_pixel_strd * j] = *pu1_buf++; - } + pu1_uv_dst[i * pic_strd + 2 * j] = *pu1_buf++; } } } @@ -1094,20 +790,29 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) { if(0 == pcm_flag) { + /* Initializing variables */ + pred_strd = pic_strd; + dst_strd = pic_strd; if(c_idx == 0) /* Y */ { - /* Initializing variables */ - log2_y_trans_size_minus_2 = ps_tu->b3_size; trans_size = 1 << (log2_y_trans_size_minus_2 + 2); log2_trans_size = log2_y_trans_size_minus_2 + 2; tu_y_offset = tu_x + tu_y * pic_strd; + pi2_src = pi2_tu_coeff; + pu1_pred = pu1_y_dst_ctb + tu_y_offset; + pu1_dst = pu1_y_dst_ctb + tu_y_offset; + /* Calculating scaling matrix offset */ - offset = log2_y_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx; - pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset]; + offset = log2_y_trans_size_minus_2 * 6 + + (!intra_flag) * 3 + c_idx; + pi2_dequant_matrix = pi2_scaling_mat + + scaling_mat_offset[offset]; + + src_strd = trans_size; /* 4x4 transform Luma in INTRA mode is DST */ if(log2_y_trans_size_minus_2 == 0 && intra_flag) @@ -1124,69 +829,45 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) qp_div = ps_tu->b7_qp / 6; qp_rem = ps_tu->b7_qp % 6; - y_cb_tu.pi2_tu_coeff = pi2_tu_coeff; - y_cb_tu.pu1_pred = pu1_y_dst_ctb + tu_y_offset; - y_cb_tu.pu1_dst = pu1_y_dst_ctb + tu_y_offset; - y_cb_tu.tu_coeff_stride = trans_size; - y_cb_tu.pred_strd = pic_strd; - y_cb_tu.dst_strd = pic_strd; - y_cb_tu.cbf = ps_tu->b1_y_cbf; - y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1; - y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1; -#endif + u1_cbf = ps_tu->b1_y_cbf; + + transform_skip_flag = pu1_tu_coeff_data[1] & 1; /* Unpacking coeffs */ - if(1 == y_cb_tu.cbf) + if(1 == u1_cbf) { pu1_tu_coeff_data = ihevcd_unpack_coeffs( - y_cb_tu.pi2_tu_coeff, log2_y_trans_size_minus_2 + 2, + pi2_src, log2_y_trans_size_minus_2 + 2, pu1_tu_coeff_data, pi2_dequant_matrix, qp_rem, qp_div, e_trans_type, - ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols, - &y_cb_tu.zero_rows, &y_cb_tu.coeff_type, - &y_cb_tu.coeff_value); + ps_tu->b1_transquant_bypass, &zero_cols, + &zero_rows, &coeff_type, + &i2_coeff_value); } } else /* UV interleaved */ { - /* Initializing variables */ - const WORD16 *pi2_ihevcd_chroma_qp = - CHROMA_FMT_IDC_YUV420 != ps_sps->i1_chroma_format_idc ? - gai2_ihevcd_chroma_qp_clip : - gai2_ihevcd_chroma_qp_420; - /* Chroma :If Transform size is 4x4, keep 4x4 else do transform on (trans_size/2 x trans_size/2) */ if(ps_tu->b3_size == 0) { + /* Chroma 4x4 is present with 4th luma 4x4 block. For this case chroma postion has to be (luma pos x- 4,luma pos y- 4) */ log2_uv_trans_size_minus_2 = ps_tu->b3_size; - if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) - { - tu_uv_offset = (tu_x * chroma_pixel_strd) - + (tu_y * chroma_pixel_strd * pic_strd); - } - else - { - /* Chroma 4x4 is present with 4th luma 4x4 block. For this case chroma postion has to be (luma pos x - 4, luma pos y - 4) */ - tu_uv_offset = (tu_x - 4) + ((tu_y - 4) / v_samp_factor) * pic_strd; - } + tu_uv_offset = (tu_x - 4) + ((tu_y - 4) / 2) * pic_strd; } else { - if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) - { - log2_uv_trans_size_minus_2 = ps_tu->b3_size; - } - else - { - log2_uv_trans_size_minus_2 = ps_tu->b3_size - 1; - } - tu_uv_offset = (tu_x * chroma_pixel_strd / h_samp_factor) - + (tu_y * chroma_pixel_strd * pic_strd / (h_samp_factor * v_samp_factor)); + log2_uv_trans_size_minus_2 = ps_tu->b3_size - 1; + tu_uv_offset = tu_x + (tu_y >> 1) * pic_strd; } trans_size = 1 << (log2_uv_trans_size_minus_2 + 2); log2_trans_size = log2_uv_trans_size_minus_2 + 2; + pi2_src = pi2_tu_coeff; + pi2_src_v = pi2_tu_coeff + trans_size * trans_size; + pu1_pred = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/ + pu1_pred_v = pu1_pred + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/ + pu1_dst = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/ + pu1_dst_v = pu1_dst + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/ + /*TODO: Add support for choosing different tables for U and V, * change this to a single array to handle flat/default/custom, intra/inter, luma/chroma and various sizes */ @@ -1194,136 +875,68 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) /* ((log2_uv_trans_size_minus_2 == 3) ? 1:3) condition check is not needed, since * max uv trans size is 16x16 */ - offset = log2_uv_trans_size_minus_2 * 6 + (!intra_flag) * 3 + c_idx; - pi2_dequant_matrix = pi2_scaling_mat + scaling_mat_offset[offset]; - pi2_dequant_matrix_v = pi2_scaling_mat + scaling_mat_offset[offset + 1]; + offset = log2_uv_trans_size_minus_2 * 6 + + (!intra_flag) * 3 + c_idx; + pi2_dequant_matrix = pi2_scaling_mat + + scaling_mat_offset[offset]; + pi2_dequant_matrix_v = pi2_scaling_mat + + scaling_mat_offset[offset + 1]; + + src_strd = trans_size; func_idx = 1 + 4 + log2_uv_trans_size_minus_2; /* DST func + Y funcs + cur func index*/ /* Handle error cases where 64x64 TU is signalled which results in 32x32 chroma. - * Limit func_idx based on allowed max chroma tu size */ - func_idx = MIN(func_idx, (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 8 : 7); + * By limiting func_idx to 7, max of 16x16 chroma is called */ + func_idx = MIN(func_idx, 7); e_trans_type = (TRANSFORM_TYPE)(log2_uv_trans_size_minus_2 + 1); /* QP for U */ i1_chroma_pic_qp_offset = ps_pps->i1_pic_cb_qp_offset; i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cb_qp_offset; + u1_cbf = ps_tu->b1_cb_cbf; - chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset; + chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + + i1_chroma_slice_qp_offset; chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57); - qp_div = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6; - qp_rem = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6; + qp_div = gai2_ihevcd_chroma_qp[chroma_qp_idx] / 6; + qp_rem = gai2_ihevcd_chroma_qp[chroma_qp_idx] % 6; /* QP for V */ i1_chroma_pic_qp_offset = ps_pps->i1_pic_cr_qp_offset; i1_chroma_slice_qp_offset = ps_slice_hdr->i1_slice_cr_qp_offset; + u1_cbf_v = ps_tu->b1_cr_cbf; - chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + i1_chroma_slice_qp_offset; + chroma_qp_idx = ps_tu->b7_qp + i1_chroma_pic_qp_offset + + i1_chroma_slice_qp_offset; chroma_qp_idx = CLIP3(chroma_qp_idx, 0, 57); - qp_div_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] / 6; - qp_rem_v = pi2_ihevcd_chroma_qp[chroma_qp_idx] % 6; - - y_cb_tu.pi2_tu_coeff = pi2_tu_coeff; - y_cb_tu.pu1_pred = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/ - y_cb_tu.pu1_dst = pu1_uv_dst_ctb + tu_uv_offset + chroma_yuv420sp_vu_u_offset; /* Pointing to start byte of U*/ - y_cb_tu.tu_coeff_stride = trans_size; - y_cb_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - y_cb_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - y_cb_tu.cbf = ps_tu->b1_cb_cbf; - - cr_tu.pi2_tu_coeff = pi2_tu_coeff + trans_size * trans_size; - cr_tu.pu1_pred = y_cb_tu.pu1_pred + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/ - cr_tu.pu1_dst = y_cb_tu.pu1_dst + 1 + chroma_yuv420sp_vu_v_offset; /* Pointing to start byte of V*/ - cr_tu.tu_coeff_stride = trans_size; - cr_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cr_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cr_tu.cbf = ps_tu->b1_cr_cbf; + qp_div_v = gai2_ihevcd_chroma_qp[chroma_qp_idx] / 6; + qp_rem_v = gai2_ihevcd_chroma_qp[chroma_qp_idx] % 6; /* Unpacking coeffs */ - y_cb_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - y_cb_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1; - y_cb_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1; -#endif - if(1 == y_cb_tu.cbf) + transform_skip_flag = pu1_tu_coeff_data[1] & 1; + if(1 == u1_cbf) { pu1_tu_coeff_data = ihevcd_unpack_coeffs( - y_cb_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2, + pi2_src, log2_uv_trans_size_minus_2 + 2, pu1_tu_coeff_data, pi2_dequant_matrix, qp_rem, qp_div, e_trans_type, - ps_tu->b1_transquant_bypass, &y_cb_tu.zero_cols, - &y_cb_tu.zero_rows, &y_cb_tu.coeff_type, - &y_cb_tu.coeff_value); + ps_tu->b1_transquant_bypass, &zero_cols, + &zero_rows, &coeff_type, + &i2_coeff_value); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - cb_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu; - cb_sub_tu.pu1_pred = y_cb_tu.pu1_pred + trans_size * y_cb_tu.pred_strd; - cb_sub_tu.pu1_dst = y_cb_tu.pu1_dst + trans_size * y_cb_tu.dst_strd; - cb_sub_tu.tu_coeff_stride = trans_size; - cb_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cb_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cb_sub_tu.cbf = ps_tu->b1_cb_cbf_subtu1; - cb_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1; - cb_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1; - cb_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1; - if(1 == cb_sub_tu.cbf) - { - pu1_tu_coeff_data = ihevcd_unpack_coeffs( - cb_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2, - pu1_tu_coeff_data, pi2_dequant_matrix, - qp_rem, qp_div, e_trans_type, - ps_tu->b1_transquant_bypass, &cb_sub_tu.zero_cols, - &cb_sub_tu.zero_rows, &cb_sub_tu.coeff_type, - &cb_sub_tu.coeff_value); - } - } -#endif - cr_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - cr_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1; - cr_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1; -#endif - if(1 == cr_tu.cbf) + transform_skip_flag_v = pu1_tu_coeff_data[1] & 1; + if(1 == u1_cbf_v) { pu1_tu_coeff_data = ihevcd_unpack_coeffs( - cr_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2, + pi2_src_v, log2_uv_trans_size_minus_2 + 2, pu1_tu_coeff_data, pi2_dequant_matrix_v, qp_rem_v, qp_div_v, e_trans_type, - ps_tu->b1_transquant_bypass, &cr_tu.zero_cols, - &cr_tu.zero_rows, &cr_tu.coeff_type, &cr_tu.coeff_value); + ps_tu->b1_transquant_bypass, &zero_cols_v, + &zero_rows_v, &coeff_type_v, &i2_coeff_value_v); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - cr_sub_tu.pi2_tu_coeff = ps_proc->pi2_invscan_out_subtu + trans_size * trans_size; - cr_sub_tu.pu1_pred = cr_tu.pu1_pred + trans_size * cr_tu.pred_strd; - cr_sub_tu.pu1_dst = cr_tu.pu1_dst + trans_size * cr_tu.dst_strd; - cr_sub_tu.tu_coeff_stride = trans_size; - cr_sub_tu.pred_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cr_sub_tu.dst_strd = pic_strd * chroma_pixel_strd / h_samp_factor; - cr_sub_tu.cbf = ps_tu->b1_cr_cbf_subtu1; - cr_sub_tu.transform_skip_flag = pu1_tu_coeff_data[1] & 1; - cr_sub_tu.explicit_rdpcm_flag = (pu1_tu_coeff_data[1] >> 4) & 1; - cr_sub_tu.explicit_rdpcm_dir = (pu1_tu_coeff_data[1] >> 5) & 1; - if(1 == cr_sub_tu.cbf) - { - pu1_tu_coeff_data = ihevcd_unpack_coeffs( - cr_sub_tu.pi2_tu_coeff, log2_uv_trans_size_minus_2 + 2, - pu1_tu_coeff_data, pi2_dequant_matrix_v, - qp_rem_v, qp_div_v, e_trans_type, - ps_tu->b1_transquant_bypass, &cr_sub_tu.zero_cols, - &cr_sub_tu.zero_rows, &cr_sub_tu.coeff_type, - &cr_sub_tu.coeff_value); - } - } -#endif } - WORD8 subtu_idx = 0; - do - { /***************************************************************/ /****************** Intra Prediction **************************/ /***************************************************************/ @@ -1334,7 +947,7 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) so that SIMD functions can load 64 bits. Also some SIMD modules read few bytes before the start of the array, so allocate 16 extra bytes at the start */ - UWORD8 au1_ref_sub_out[16 + (MAX_TU_SIZE * 2 * 2 * 2) + 8] = {0}; + UWORD8 au1_ref_sub_out[16 + (MAX_TU_SIZE * 2 * 2) + 8] = {0}; UWORD8 *pu1_ref_sub_out = &au1_ref_sub_out[16]; UWORD8 *pu1_top_left, *pu1_top, *pu1_left; WORD32 luma_pred_func_idx, chroma_pred_func_idx; @@ -1355,95 +968,43 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) if(trans_size == 4) luma_nbr_flags_4x4[(ps_tu->b4_pos_x % 2) + (ps_tu->b4_pos_y % 2) * 2] = luma_nbr_flags; - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) + if((ps_tu->b4_pos_x % 2 == 0) && (ps_tu->b4_pos_y % 2 == 0)) { chroma_nbr_flags = luma_nbr_flags; } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - WORD32 bot_left, left, top, tp_right, tp_left; - tp_left = (luma_nbr_flags & 0x10000); - tp_right = (luma_nbr_flags & 0x0f000); - top = (luma_nbr_flags & 0x00f00); - left = (luma_nbr_flags & 0x000f0); - bot_left = (luma_nbr_flags & 0x0000f); - chroma_nbr_flags = tp_left | tp_right | top | left | (left >> 4); - chroma_nbr_flags_subtu = ((left != 0 ? 1 : 0) << 16) | (0xf << 8) - | left | bot_left; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - { - if(((ps_tu->b4_pos_x % 2 == 0) && (ps_tu->b4_pos_y % 2 == 0))) - chroma_nbr_flags = luma_nbr_flags; - } /* Initializing nbr pointers */ - pu1_top = y_cb_tu.pu1_pred - pic_strd; - pu1_left = y_cb_tu.pu1_pred - 1; - pu1_top_left = y_cb_tu.pu1_pred - pic_strd - 1; + pu1_top = pu1_pred - pic_strd; + pu1_left = pu1_pred - 1; + pu1_top_left = pu1_pred - pic_strd - 1; /* call reference array substitution */ if(luma_nbr_flags == 0x1ffff) ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr( pu1_top_left, - pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1); + pu1_top, pu1_left, pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1); else ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr( pu1_top_left, - pu1_top, pu1_left, y_cb_tu.pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1); + pu1_top, pu1_left, pred_strd, trans_size, luma_nbr_flags, pu1_ref_sub_out, 1); /* call reference filtering */ ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr( + pu1_ref_sub_out, trans_size, pu1_ref_sub_out, - trans_size, - pu1_ref_sub_out, - u1_luma_pred_mode, -#ifdef ENABLE_MAIN_REXT_PROFILE - (ps_sps->i1_intra_smoothing_disabled_flag << 3 - | ps_sps->i1_strong_intra_smoothing_enable_flag) -#else - ps_sps->i1_strong_intra_smoothing_enable_flag -#endif - ); + u1_luma_pred_mode, ps_sps->i1_strong_intra_smoothing_enable_flag); /* use the look up to get the function idx */ luma_pred_func_idx = g_i4_ip_funcs[u1_luma_pred_mode]; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_implicit_rdpcm_enabled_flag && ps_tu->b1_transquant_bypass - && (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26)) - disable_boundary_filter = 1; -#endif /* call the intra prediction function */ - ps_codec->apf_intra_pred_luma[luma_pred_func_idx]( - pu1_ref_sub_out, 1, - y_cb_tu.pu1_pred, - y_cb_tu.pred_strd, - trans_size, -#ifdef ENABLE_MAIN_REXT_PROFILE - (u1_luma_pred_mode == 10 || u1_luma_pred_mode == 26) ? - disable_boundary_filter : - u1_luma_pred_mode -#else - u1_luma_pred_mode -#endif - ); + ps_codec->apf_intra_pred_luma[luma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred, pred_strd, trans_size, u1_luma_pred_mode); } else { - -#ifdef ENABLE_MAIN_REXT_PROFILE - if(subtu_idx != 0) - { - ps_cb_tu = &cb_sub_tu; - ps_cr_tu = &cr_sub_tu; - chroma_nbr_flags = chroma_nbr_flags_subtu; - } -#endif - /* In case of yuv420sp_vu, prediction happens as usual. */ /* So point the pu1_pred pointer to original prediction pointer */ - UWORD8 *pu1_pred_orig = ps_cb_tu->pu1_pred - chroma_yuv420sp_vu_u_offset; + UWORD8 *pu1_pred_orig = pu1_pred - chroma_yuv420sp_vu_u_offset; /* Top-Left | Top-Right | Top | Left | Bottom-Left * 1 4 4 4 4 @@ -1451,52 +1012,25 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) * Generating chroma_nbr_flags depending upon the transform size */ if(ps_tu->b3_size == 0) { - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - { - /* Take TL,T,L flags of First luma 4x4 block */ - chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0); - /* Take TR flags of Second luma 4x4 block */ - chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000); - /* Take BL flags of Third luma 4x4 block */ - chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F); - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - if(subtu_idx == 0) - { - /* Take TL,T,L flags of First luma 4x4 block */ - chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0); - /* Take TR flags of Second luma 4x4 block */ - chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000); - /* Take BL flags of first luma 4x4 block */ - chroma_nbr_flags |= (luma_nbr_flags_4x4[0] & 0x0000F); - } - else - { - /* Take TL,T,L flags of Third luma 4x4 block */ - chroma_nbr_flags = (luma_nbr_flags_4x4[2] & 0x10FF0); - /* Take BL flags of Third luma 4x4 block */ - chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F); - } - } + /* Take TL,T,L flags of First luma 4x4 block */ + chroma_nbr_flags = (luma_nbr_flags_4x4[0] & 0x10FF0); + /* Take TR flags of Second luma 4x4 block */ + chroma_nbr_flags |= (luma_nbr_flags_4x4[1] & 0x0F000); + /* Take BL flags of Third luma 4x4 block */ + chroma_nbr_flags |= (luma_nbr_flags_4x4[2] & 0x0000F); } /* Initializing nbr pointers */ - pu1_top = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor); + pu1_top = pu1_pred_orig - pic_strd; pu1_left = pu1_pred_orig - 2; - pu1_top_left = pu1_pred_orig - (pic_strd * chroma_pixel_strd / h_samp_factor) - 2; + pu1_top_left = pu1_pred_orig - pic_strd - 2; - if(subtu_idx == 0) - { /* Chroma pred mode derivation from luma pred mode */ { tu_t *ps_tu_tmp = ps_tu; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444) + while(!ps_tu_tmp->b1_first_tu_in_cu) { - while(!ps_tu_tmp->b1_first_tu_in_cu) - { - ps_tu_tmp--; - } + ps_tu_tmp--; } u1_luma_pred_mode_first_tu = ps_tu_tmp->b6_luma_intra_mode; } @@ -1506,73 +1040,107 @@ WORD32 ihevcd_iquant_itrans_recon_ctb(process_ctxt_t *ps_proc) { u1_chroma_pred_mode = gau1_intra_pred_chroma_modes[u1_chroma_pred_mode]; - if(u1_chroma_pred_mode == u1_luma_pred_mode_first_tu) + if(u1_chroma_pred_mode == + u1_luma_pred_mode_first_tu) { u1_chroma_pred_mode = INTRA_ANGULAR(34); } } - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - u1_chroma_pred_mode = gau1_intra_pred_chroma_modes_422[u1_chroma_pred_mode]; - } - } /* call the chroma reference array substitution */ ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr( pu1_top_left, - pu1_top, pu1_left, - ps_cb_tu->pred_strd, - trans_size, chroma_nbr_flags, pu1_ref_sub_out, 1, - ps_sps->i1_chroma_format_idc); - -#ifdef ENABLE_MAIN_REXT_PROFILE - /* call reference filtering */ - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_filtering_fptr( - pu1_ref_sub_out, - trans_size, - pu1_ref_sub_out, - u1_chroma_pred_mode, - (ps_sps->i1_intra_smoothing_disabled_flag << 3 - | ps_sps->i1_strong_intra_smoothing_enable_flag)); - } -#endif + pu1_top, pu1_left, pic_strd, trans_size, chroma_nbr_flags, pu1_ref_sub_out, 1); /* use the look up to get the function idx */ - chroma_pred_func_idx = g_i4_ip_funcs[u1_chroma_pred_mode]; + chroma_pred_func_idx = + g_i4_ip_funcs[u1_chroma_pred_mode]; /* call the intra prediction function */ - ps_codec->apf_intra_pred_chroma[chroma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred_orig, ps_cb_tu->pred_strd, trans_size, u1_chroma_pred_mode); + ps_codec->apf_intra_pred_chroma[chroma_pred_func_idx](pu1_ref_sub_out, 1, pu1_pred_orig, pred_strd, trans_size, u1_chroma_pred_mode); } } /* Updating number of transform types */ STATS_UPDATE_ALL_TRANS(e_trans_type, c_idx); -#ifdef ENABLE_MAIN_REXT_PROFILE - iqitrecon_fptr = get_iqitrec_func( - ps_proc, ps_tu, ps_cb_tu, log2_trans_size, - c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag, - c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode); -#endif /* IQ, IT and Recon for Y if c_idx == 0, and U if c_idx !=0 */ - iqitrecon_fptr(ps_proc, ps_tu, ps_cb_tu, func_idx, log2_trans_size, - c_idx != 0 ? U_PLANE : NULL_PLANE, intra_flag, - c_idx == 0 ? u1_luma_pred_mode : u1_chroma_pred_mode); + if(1 == u1_cbf) + { + if(ps_tu->b1_transquant_bypass || transform_skip_flag) + { + /* Recon */ + ps_codec->apf_recon[func_idx](pi2_src, pu1_pred, pu1_dst, + src_strd, pred_strd, dst_strd, + zero_cols); + } + else + { + + /* Updating coded number of transform types(excluding trans skip and trans quant skip) */ + STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 0); + + /* iQuant , iTrans and Recon */ + if((0 == coeff_type)) + { + ps_codec->apf_itrans_recon[func_idx](pi2_src, pi2_tmp, + pu1_pred, pu1_dst, + src_strd, pred_strd, + dst_strd, zero_cols, + zero_rows); + } + else /* DC only */ + { + STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 1); + ps_codec->apf_itrans_recon_dc[c_idx](pu1_pred, pu1_dst, + pred_strd, dst_strd, + log2_trans_size, + i2_coeff_value); + } + } + } /* IQ, IT and Recon for V */ if(c_idx != 0) { -#ifdef ENABLE_MAIN_REXT_PROFILE - iqitrecon_fptr = get_iqitrec_func(ps_proc, ps_tu, ps_cr_tu, log2_trans_size, - V_PLANE, intra_flag, u1_chroma_pred_mode); -#endif - iqitrecon_fptr(ps_proc, ps_tu, ps_cr_tu, func_idx, log2_trans_size, V_PLANE, - intra_flag, u1_chroma_pred_mode); + if(1 == u1_cbf_v) + { + if(ps_tu->b1_transquant_bypass || transform_skip_flag_v) + { + /* Recon */ + ps_codec->apf_recon[func_idx](pi2_src_v, pu1_pred_v, + pu1_dst_v, src_strd, + pred_strd, dst_strd, + zero_cols_v); + } + else + { + /* Updating number of transform types */ + STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 0); + + /* iQuant , iTrans and Recon */ + if((0 == coeff_type_v)) + { + ps_codec->apf_itrans_recon[func_idx](pi2_src_v, + pi2_tmp, + pu1_pred_v, + pu1_dst_v, + src_strd, + pred_strd, + dst_strd, + zero_cols_v, + zero_rows_v); + } + else /* DC only */ + { + STATS_UPDATE_CODED_TRANS(e_trans_type, c_idx, 1); + ps_codec->apf_itrans_recon_dc[c_idx](pu1_pred_v, pu1_dst_v, + pred_strd, dst_strd, + log2_trans_size, + i2_coeff_value_v); + } + } + } } - } - while(c_idx != 0 && ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 - && ++subtu_idx < 2); } /* Neighbor availability inside CTB */ diff --git a/decoder/ihevcd_ittiam_logo.h b/decoder/ihevcd_ittiam_logo.h index 8c8d7a6..71540e3 100644 --- a/decoder/ihevcd_ittiam_logo.h +++ b/decoder/ihevcd_ittiam_logo.h @@ -44,6 +44,12 @@ #define LOGO_WD_Y LOGO_WD #define LOGO_HT_Y LOGO_HT +#define LOGO_WD_RGBA8888 160 +#define LOGO_HT_RGBA8888 64 + +#define LOGO_WD_RGB565 160 +#define LOGO_HT_RGB565 64 + #define LOGO_WD_444_UV LOGO_WD #define LOGO_HT_444_UV LOGO_HT @@ -57,6 +63,15 @@ #define LOGO_WD_420SP_VU (LOGO_WD) #define LOGO_HT_420SP_VU (LOGO_HT >> 1) +#define LOGO_WD_422_UV (LOGO_WD >> 1) +#define LOGO_HT_422_UV (LOGO_HT) + +#define LOGO_WD_422V_UV (LOGO_WD) +#define LOGO_HT_422V_UV (LOGO_HT >> 1) + +#define LOGO_WD_411_UV (LOGO_WD >> 2) +#define LOGO_HT_411_UV (LOGO_HT) + #define LOGO_CODEC_WD 80 #define LOGO_CODEC_HT 24 @@ -77,6 +92,18 @@ #define LOGO_CODEC_WD_420SP_VU (LOGO_CODEC_WD) #define LOGO_CODEC_HT_420SP_VU (LOGO_CODEC_HT >> 1) +#define LOGO_CODEC_WD_422_UV (LOGO_CODEC_WD >> 1) +#define LOGO_CODEC_HT_422_UV (LOGO_CODEC_HT) + +#define LOGO_CODEC_WD_422V_UV (LOGO_CODEC_WD) +#define LOGO_CODEC_HT_422V_UV (LOGO_CODEC_HT >> 1) + +#define LOGO_CODEC_WD_411_UV (LOGO_CODEC_WD >> 2) +#define LOGO_CODEC_HT_411_UV (LOGO_CODEC_HT) + + + + #define START_X_ITT_LOGO 0 #define START_Y_ITT_LOGO 0 diff --git a/decoder/ihevcd_parse_headers.c b/decoder/ihevcd_parse_headers.c index 9d66e58..bdd151c 100644 --- a/decoder/ihevcd_parse_headers.c +++ b/decoder/ihevcd_parse_headers.c @@ -75,12 +75,11 @@ #define COPY_DEFAULT_SCALING_LIST(pi2_scaling_mat) \ { \ - WORD32 scaling_mat_offset[] = {0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, \ - 480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136}; \ + WORD32 scaling_mat_offset[]={0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040}; \ \ /* scaling matrix for 4x4 */ \ memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16)); \ - /* scaling matrix for 8x8 */ \ +/* scaling matrix for 8x8 */ \ memcpy(pi2_scaling_mat + scaling_mat_offset[6], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16)); \ memcpy(pi2_scaling_mat + scaling_mat_offset[7], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16)); \ memcpy(pi2_scaling_mat + scaling_mat_offset[8], gi2_intra_default_scale_mat_8x8, 64*sizeof(WORD16)); \ @@ -96,17 +95,12 @@ memcpy(pi2_scaling_mat + scaling_mat_offset[17], gi2_inter_default_scale_mat_16x16, 256*sizeof(WORD16)); \ /* scaling matrix for 32x32 */ \ memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ - memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ - memcpy(pi2_scaling_mat + scaling_mat_offset[20], gi2_intra_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ - memcpy(pi2_scaling_mat + scaling_mat_offset[21], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ - memcpy(pi2_scaling_mat + scaling_mat_offset[22], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ - memcpy(pi2_scaling_mat + scaling_mat_offset[23], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ + memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_inter_default_scale_mat_32x32, 1024*sizeof(WORD16)); \ } #define COPY_FLAT_SCALING_LIST(pi2_scaling_mat) \ { \ - WORD32 scaling_mat_offset[] = {0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, \ - 480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136}; \ + WORD32 scaling_mat_offset[]={0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040}; \ \ /* scaling matrix for 4x4 */ \ memcpy(pi2_scaling_mat, gi2_flat_scale_mat_32x32, 6*16*sizeof(WORD16)); \ @@ -116,10 +110,8 @@ memcpy(pi2_scaling_mat + scaling_mat_offset[12], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16)); \ memcpy(pi2_scaling_mat + scaling_mat_offset[15], gi2_flat_scale_mat_32x32, 3*256*sizeof(WORD16)); \ /* scaling matrix for 32x32 */ \ - for (WORD32 i = 0; i < 6; i++) \ - { \ - memcpy(pi2_scaling_mat + scaling_mat_offset[18 + i], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16)); \ - } \ + memcpy(pi2_scaling_mat + scaling_mat_offset[18], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16)); \ + memcpy(pi2_scaling_mat + scaling_mat_offset[19], gi2_flat_scale_mat_32x32, 1024*sizeof(WORD16)); \ } /* Function declarations */ @@ -173,7 +165,7 @@ WORD32 ihevcd_parse_pred_wt_ofst(bitstrm_t *ps_bitstrm, } ps_wt_ofst->i1_luma_log2_weight_denom = u4_value; - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + if(ps_sps->i1_chroma_format_idc != 0) { SEV_PARSE("delta_chroma_log2_weight_denom", value, ps_bitstrm); if((value < -7) || (value > 7)) @@ -197,7 +189,7 @@ WORD32 ihevcd_parse_pred_wt_ofst(bitstrm_t *ps_bitstrm, - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + if(ps_sps->i1_chroma_format_idc != 0) { for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l0_active; i++) { @@ -297,7 +289,7 @@ WORD32 ihevcd_parse_pred_wt_ofst(bitstrm_t *ps_bitstrm, ps_wt_ofst->i1_luma_weight_l1_flag[i] = value; } - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) + if(ps_sps->i1_chroma_format_idc != 0) { for(i = 0; i < ps_slice_hdr->i1_num_ref_idx_l1_active; i++) { @@ -996,22 +988,6 @@ static WORD32 ihevcd_parse_vui_parameters(bitstrm_t *ps_bitstrm, return ret; } -static WORD32 ihevcd_get_profile(profile_tier_lvl_t *ps_ptl) -{ - WORD32 profile = IHEVC_PROFILE_UNKNOWN; - - if(ps_ptl->i1_profile_idc == 1 || ps_ptl->ai1_profile_compatibility_flag[1] == 1) - profile = IHEVC_PROFILE_MAIN; - else if(ps_ptl->i1_profile_idc == 3 || ps_ptl->ai1_profile_compatibility_flag[3] == 1) - profile = IHEVC_PROFILE_MAIN_STILL; -#ifdef ENABLE_MAIN_REXT_PROFILE - else if(ps_ptl->i1_profile_idc == 4 || ps_ptl->ai1_profile_compatibility_flag[4] == 1) - profile = IHEVC_PROFILE_MAIN_REXT; -#endif - - return profile; -} - /** ******************************************************************************* * @@ -1190,7 +1166,7 @@ static IHEVCD_ERROR_T ihevcd_profile_tier_level(bitstrm_t *ps_bitstrm, * ******************************************************************************* */ -IHEVCD_ERROR_T ihevcd_scaling_list_data(codec_t *ps_codec, WORD16 *pi2_scaling_mat, WORD8 chroma_format_idc) +IHEVCD_ERROR_T ihevcd_scaling_list_data(codec_t *ps_codec, WORD16 *pi2_scaling_mat) { IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; WORD32 size_id; @@ -1199,16 +1175,15 @@ IHEVCD_ERROR_T ihevcd_scaling_list_data(codec_t *ps_codec, WORD16 *pi2_scaling_m UWORD32 u4_value; WORD32 next_coef; WORD32 coef_num; - WORD32 i, j, k, offset; + WORD32 i, j, offset; bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm; WORD16 *pi2_scaling_mat_offset; - WORD32 scaling_mat_offset[] = {0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, - 480, 736, 992, 1248, 1504, 1760, 2016, 3040, 4064, 5088, 6112, 7136}; + WORD32 scaling_mat_offset[] = { 0, 16, 32, 48, 64, 80, 96, 160, 224, 288, 352, 416, 480, 736, 992, 1248, 1504, 1760, 2016, 3040 }; UWORD8 *scan_table; for(size_id = 0; size_id < 4; size_id++) { - for(matrix_id = 0; matrix_id < 6; matrix_id += (size_id == 3) ? 3 : 1) + for(matrix_id = 0; matrix_id < ((size_id == 3) ? 2 : 6); matrix_id++) { WORD32 scaling_list_pred_mode_flag; WORD32 scaling_list_delta_coef; @@ -1222,24 +1197,14 @@ IHEVCD_ERROR_T ihevcd_scaling_list_data(codec_t *ps_codec, WORD16 *pi2_scaling_m WORD32 num_elements; UEV_PARSE("scaling_list_pred_matrix_id_delta", u4_value, ps_bitstrm); - if(size_id <= 2) + if(u4_value > matrix_id) { - if(u4_value > matrix_id) - return IHEVCD_INVALID_PARAMETER; - } - else - { - if(u4_value > matrix_id / 3) - return IHEVCD_INVALID_PARAMETER; + return IHEVCD_INVALID_PARAMETER; } num_elements = (1 << (4 + (size_id << 1))); if(0 != u4_value) - { - memmove(pi2_scaling_mat_offset, - pi2_scaling_mat_offset - (u4_value * (size_id == 3 ? 3 : 1)) * num_elements, - num_elements * sizeof(WORD16)); - } + memmove(pi2_scaling_mat_offset, pi2_scaling_mat_offset - u4_value * num_elements, num_elements * sizeof(WORD16)); } else { @@ -1329,40 +1294,6 @@ IHEVCD_ERROR_T ihevcd_scaling_list_data(codec_t *ps_codec, WORD16 *pi2_scaling_m } } } - // derive 32x32 CbCr scaling list from 16x16 CbCr scaling list - if(chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - WORD32 matrix_ids[] = { 1, 2, 4, 5 }; - WORD16 *pi2_ref_scaling_mat; - - scan_table = (UWORD8 *)gapv_ihevc_invscan[2]; - for(i = 0; i < 4; i++) - { - matrix_id = matrix_ids[i]; - pi2_ref_scaling_mat = pi2_scaling_mat + scaling_mat_offset[2 * 6 + matrix_id]; - pi2_scaling_mat_offset = pi2_scaling_mat + scaling_mat_offset[3 * 6 + matrix_id]; - - for(j = 0; j < 64; j++) - { - offset = scan_table[j]; - offset = (offset >> 3) * 16 * 2 + (offset & 0x7) * 2; - // the index 0 value may be overwritten by scaling_list_dc_coef. pick its alternative - next_coef = offset == 0 ? pi2_ref_scaling_mat[1] : pi2_ref_scaling_mat[offset]; - - offset = scan_table[j]; - offset = (offset >> 3) * 32 * 4 + (offset & 0x7) * 4; - - for(k = 0; k < 4; k++) - { - pi2_scaling_mat_offset[offset + k * 32] = next_coef; - pi2_scaling_mat_offset[offset + 1 + k * 32] = next_coef; - pi2_scaling_mat_offset[offset + 2 + k * 32] = next_coef; - pi2_scaling_mat_offset[offset + 3 + k * 32] = next_coef; - } - } - pi2_scaling_mat_offset[0] = pi2_ref_scaling_mat[0]; - } - } return ret; } @@ -1575,34 +1506,15 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) { return IHEVCD_INVALID_PARAMETER; } - - WORD32 profile = ihevcd_get_profile(&ps_sps->s_ptl.s_ptl_gen); - if(profile == IHEVC_PROFILE_UNKNOWN) - { - return IHEVCD_UNSUPPORTED_TOOL_SET; - } - - switch(value) { - case CHROMA_FMT_IDC_MONOCHROME: { - if (!(ps_codec->u4_enable_yuv_formats & (1 << CHROMA_FMT_IDC_MONOCHROME))) { - ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; - return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; - } - if(profile != IHEVC_PROFILE_MAIN_REXT) - return IHEVCD_INVALID_PARAMETER; - } - break; - case CHROMA_FMT_IDC_YUV420: - break; - default: { - ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; - return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; - } - break; - } ps_sps->i1_chroma_format_idc = value; - if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) + if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV420) + { + ps_codec->s_parse.i4_error_code = IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; + return (IHEVCD_ERROR_T)IHEVCD_UNSUPPORTED_CHROMA_FMT_IDC; + } + + if(CHROMA_FMT_IDC_YUV444_PLANES == ps_sps->i1_chroma_format_idc) { BITS_PARSE("separate_colour_plane_flag", value, ps_bitstrm, 1); ps_sps->i1_separate_colour_plane_flag = value; @@ -1837,7 +1749,7 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) ps_sps->i1_sps_scaling_list_data_present_flag = value; if(ps_sps->i1_sps_scaling_list_data_present_flag) - ihevcd_scaling_list_data(ps_codec, ps_sps->pi2_scaling_mat, ps_sps->i1_chroma_format_idc); + ihevcd_scaling_list_data(ps_codec, ps_sps->pi2_scaling_mat); } else { @@ -1949,90 +1861,7 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) } } - BITS_PARSE("sps_extension_present_flag", value, ps_bitstrm, 1); - ps_sps->i1_sps_extension_present_flag = value; - - if(ps_sps->i1_sps_extension_present_flag) - { - BITS_PARSE("sps_range_extension_flag", value, ps_bitstrm, 1); - ps_sps->i1_sps_range_extension_flag = value; - - BITS_PARSE("sps_multilayer_extension_flag", value, ps_bitstrm, 1); - ps_sps->i1_sps_multilayer_extension_flag = value; - - BITS_PARSE("sps_3d_extension_flag", value, ps_bitstrm, 1); - ps_sps->i1_sps_3d_extension_flag = value; - - BITS_PARSE("sps_scc_extension_flag", value, ps_bitstrm, 1); - ps_sps->i1_sps_scc_extension_flag = value; - - BITS_PARSE("sps_extension_4bits", value, ps_bitstrm, 4); - ps_sps->i1_sps_extension_4bits = value; - } - -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_sps_range_extension_flag) - { - /* ITU-T H.265 Section 7.3.2.2.2 Range extension sequence parameter set syntax */ - BITS_PARSE("transform_skip_rotation_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_transform_skip_rotation_enabled_flag = value; - - BITS_PARSE("transform_skip_context_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_transform_skip_context_enabled_flag = value; - - BITS_PARSE("implicit_rdpcm_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_implicit_rdpcm_enabled_flag = value; - - BITS_PARSE("explicit_rdpcm_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_explicit_rdpcm_enabled_flag = value; - - BITS_PARSE("extended_precision_processing_flag", value, ps_bitstrm, 1); - ps_sps->i1_extended_precision_processing_flag = value; - - BITS_PARSE("intra_smoothing_disabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_intra_smoothing_disabled_flag = value; - - BITS_PARSE("high_precision_offsets_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_use_high_precision_pred_wt = value; - - BITS_PARSE("persistent_rice_adaptation_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_persistent_rice_adaptation_enabled_flag = value; - - BITS_PARSE("cabac_bypass_alignment_enabled_flag", value, ps_bitstrm, 1); - ps_sps->i1_align_cabac_before_bypass = value; - } - if(profile != IHEVC_PROFILE_MAIN_REXT) - { - if(ps_sps->i1_transform_skip_rotation_enabled_flag - || ps_sps->i1_transform_skip_context_enabled_flag - || ps_sps->i1_implicit_rdpcm_enabled_flag - || ps_sps->i1_explicit_rdpcm_enabled_flag - || ps_sps->i1_extended_precision_processing_flag - || ps_sps->i1_intra_smoothing_disabled_flag - || ps_sps->i1_persistent_rice_adaptation_enabled_flag - || ps_sps->i1_align_cabac_before_bypass) - { - return IHEVCD_INVALID_PARAMETER; - } - } - if(ps_sps->i1_extended_precision_processing_flag || ps_sps->i1_align_cabac_before_bypass) - { - // main-rext 8-bit profiles require these fields to be off - return IHEVCD_INVALID_PARAMETER; - } - if(ps_sps->i1_sps_multilayer_extension_flag || ps_sps->i1_sps_3d_extension_flag - || ps_sps->i1_sps_scc_extension_flag) - { - return IHEVCD_UNSUPPORTED_TOOL_SET; - } -#else - if(ps_sps->i1_sps_range_extension_flag || ps_sps->i1_sps_multilayer_extension_flag - || ps_sps->i1_sps_3d_extension_flag || ps_sps->i1_sps_scc_extension_flag) - { - // TODO: add support for parsing these syntax elements - return IHEVCD_UNSUPPORTED_TOOL_SET; - } -#endif + BITS_PARSE("sps_extension_flag", value, ps_bitstrm, 1); if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max) { @@ -2089,23 +1918,6 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) return (IHEVCD_ERROR_T)IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED; } - // limit format conversions - if(ps_codec->e_chroma_fmt == IV_YUV_444P - && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444) - { - return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED; - } - if(ps_codec->e_chroma_fmt == IV_YUV_422P - && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV422) - { - return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED; - } - if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV || ps_codec->e_chroma_fmt == IV_YUV_420SP_VU) - && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV420) - { - return (IHEVCD_ERROR_T)IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED; - } - /* Update display width and display height */ { WORD32 disp_wd, disp_ht; @@ -2118,11 +1930,6 @@ IHEVCD_ERROR_T ihevcd_parse_sps(codec_t *ps_codec) crop_unit_x = 2; crop_unit_y = 2; } - else if(CHROMA_FMT_IDC_YUV422 == ps_sps->i1_chroma_format_idc) - { - crop_unit_x = 2; - crop_unit_y = 1; - } disp_wd = ps_sps->i2_pic_width_in_luma_samples; disp_wd -= ps_sps->i2_pic_crop_left_offset * crop_unit_x; @@ -2610,7 +2417,7 @@ IHEVCD_ERROR_T ihevcd_parse_pps(codec_t *ps_codec) if(ps_pps->i1_pps_scaling_list_data_present_flag) { COPY_DEFAULT_SCALING_LIST(ps_pps->pi2_scaling_mat); - ihevcd_scaling_list_data(ps_codec, ps_pps->pi2_scaling_mat, ps_sps->i1_chroma_format_idc); + ihevcd_scaling_list_data(ps_codec, ps_pps->pi2_scaling_mat); } BITS_PARSE("lists_modification_present_flag", value, ps_bitstrm, 1); @@ -2624,117 +2431,8 @@ IHEVCD_ERROR_T ihevcd_parse_pps(codec_t *ps_codec) BITS_PARSE("slice_header_extension_present_flag", value, ps_bitstrm, 1); ps_pps->i1_slice_header_extension_present_flag = value; - - BITS_PARSE("pps_extension_present_flag", value, ps_bitstrm, 1); - ps_pps->i1_pps_extension_present_flag = value; - - if(ps_pps->i1_pps_extension_present_flag) - { - BITS_PARSE("pps_range_extension_flag", value, ps_bitstrm, 1); - ps_pps->i1_pps_range_extension_flag = value; - - BITS_PARSE("pps_multilayer_extension_flag", value, ps_bitstrm, 1); - ps_pps->i1_pps_multilayer_extension_flag = value; - - BITS_PARSE("pps_3d_extension_flag", value, ps_bitstrm, 1); - ps_pps->i1_pps_3d_extension_flag = value; - - BITS_PARSE("pps_scc_extension_flag", value, ps_bitstrm, 1); - ps_pps->i1_pps_scc_extension_flag = value; - - BITS_PARSE("pps_extension_4bits", value, ps_bitstrm, 4); - ps_pps->i1_pps_extension_4bits = value; - } - -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_pps->i1_pps_range_extension_flag) - { - /* ITU-T H.265 Section 7.3.2.3.2 Range extension PPS syntax */ - if(ps_pps->i1_transform_skip_enabled_flag) - { - UEV_PARSE("log2_max_transform_skip_block_size_minus2", value, ps_bitstrm); - ps_pps->i1_log2_max_transform_skip_block_size_minus2 = value; - } - - BITS_PARSE("cross_component_prediction_enabled_flag", value, ps_bitstrm, 1); - ps_pps->i1_cross_component_prediction_enabled_flag = value; - - // Parse other bits to maintain bitstream alignment - BITS_PARSE("chroma_qp_offset_list_enabled_flag", value, ps_bitstrm, 1); - ps_pps->i1_chroma_qp_offset_list_enabled_flag = value; - - if(ps_pps->i1_chroma_qp_offset_list_enabled_flag) - { - UEV_PARSE("diff_cu_chroma_qp_offset_depth", value, ps_bitstrm); - ps_pps->i4_diff_cu_chroma_qp_offset_depth = value; - - UEV_PARSE("chroma_qp_offset_list_len_minus1", value, ps_bitstrm); - ps_pps->i4_chroma_qp_offset_list_len_minus1 = value; - if(ps_pps->i4_chroma_qp_offset_list_len_minus1 < 0 - || ps_pps->i4_chroma_qp_offset_list_len_minus1 > 5) - { - return IHEVCD_INVALID_PARAMETER; - } - - for(int i = 0; i <= ps_pps->i4_chroma_qp_offset_list_len_minus1; i++) - { - // cb_qp_offset_list[i] (se-v) - SEV_PARSE("cb_qp_offset_list", value, ps_bitstrm); - ps_pps->i4_cb_qp_offset_list[i] = value; - - // cr_qp_offset_list[i] (se-v) - SEV_PARSE("cr_qp_offset_list", value, ps_bitstrm); - ps_pps->i4_cr_qp_offset_list[i] = value; - } - } - - // log2_sao_offset_scale_luma (ue-v) - UEV_PARSE("log2_sao_ofst_scale_luma", value, ps_bitstrm); - ps_pps->i1_log2_sao_ofst_scale_luma = value; - - // log2_sao_offset_scale_chroma (ue-v) - UEV_PARSE("log2_sao_ofst_scale_chroma", value, ps_bitstrm); - ps_pps->i1_log2_sao_ofst_scale_chroma = value; - } - - WORD32 profile = ihevcd_get_profile(&ps_sps->s_ptl.s_ptl_gen); - if(profile != IHEVC_PROFILE_MAIN_REXT) - { - if(ps_pps->i1_log2_max_transform_skip_block_size_minus2 - || ps_pps->i1_cross_component_prediction_enabled_flag - || ps_pps->i1_chroma_qp_offset_list_enabled_flag - || ps_pps->i1_log2_sao_ofst_scale_luma - || ps_pps->i1_log2_sao_ofst_scale_chroma) - { - return IHEVCD_INVALID_PARAMETER; - } - } - if(ps_pps->i1_log2_sao_ofst_scale_luma - || ps_pps->i1_log2_sao_ofst_scale_chroma) - { - // main-rext 8-bit profiles require these fields to be off - return IHEVCD_INVALID_PARAMETER; - } - - if(ps_pps->i1_chroma_qp_offset_list_enabled_flag) - { - // TODO: decoder does not yet supports these tool-sets - return IHEVCD_UNSUPPORTED_TOOL_SET; - } - if(ps_pps->i1_pps_multilayer_extension_flag || ps_pps->i1_pps_3d_extension_flag - || ps_pps->i1_pps_scc_extension_flag) - { - // TODO: add support for parsing these syntax elements - return IHEVCD_UNSUPPORTED_TOOL_SET; - } -#else - if(ps_pps->i1_pps_range_extension_flag || ps_pps->i1_pps_multilayer_extension_flag - || ps_pps->i1_pps_3d_extension_flag || ps_pps->i1_pps_scc_extension_flag) - { - // TODO: add support for parsing these syntax elements - return IHEVCD_UNSUPPORTED_TOOL_SET; - } -#endif + /* Not present in HM */ + BITS_PARSE("pps_extension_flag", value, ps_bitstrm, 1); if((UWORD8 *)ps_bitstrm->pu4_buf > ps_bitstrm->pu1_buf_max) return IHEVCD_INVALID_PARAMETER; diff --git a/decoder/ihevcd_parse_residual.c b/decoder/ihevcd_parse_residual.c index e89235f..0a39f99 100644 --- a/decoder/ihevcd_parse_residual.c +++ b/decoder/ihevcd_parse_residual.c @@ -185,11 +185,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, { IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; WORD32 transform_skip_flag; -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 explicit_rdpcm_flag, explicit_rdpcm_dir; -#endif WORD32 value; - sps_t *ps_sps; pps_t *ps_pps; WORD32 last_scan_pos, last_sub_blk; bitstrm_t *ps_bitstrm = &ps_codec->s_parse.s_bitstrm; @@ -209,23 +205,13 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, WORD32 sig_coeff_base_ctxt, abs_gt1_base_ctxt; UNUSED(x0); UNUSED(y0); - ps_sps = ps_codec->s_parse.ps_sps; ps_pps = ps_codec->s_parse.ps_pps; sign_data_hiding_flag = ps_pps->i1_sign_data_hiding_flag; transform_skip_flag = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - explicit_rdpcm_flag = 0; - explicit_rdpcm_dir = 0; -#endif if(ps_pps->i1_transform_skip_enabled_flag && !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass && -#ifdef ENABLE_MAIN_REXT_PROFILE - (log2_trafo_size <= ps_pps->i1_log2_max_transform_skip_block_size_minus2 + 2) -#else - (log2_trafo_size == 2) -#endif - ) + (log2_trafo_size == 2)) { WORD32 ctxt_idx; @@ -245,29 +231,6 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, transform_skip_flag = value; } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(PRED_MODE_INTER == ps_codec->s_parse.s_cu.i4_pred_mode - && ps_sps->i1_explicit_rdpcm_enabled_flag - && (transform_skip_flag || ps_codec->s_parse.s_cu.i4_cu_transquant_bypass)) - - { - WORD32 ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_FLAG + (c_idx != 0); - TRACE_CABAC_CTXT("explicit_rdpcm_flag", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("explicit_rdpcm_flag", value, ps_cabac->u4_range); - explicit_rdpcm_flag = value; - - if(explicit_rdpcm_flag) - { - ctxt_idx = IHEVC_CAB_EXPLICIT_RDPCM_DIR + (c_idx != 0); - TRACE_CABAC_CTXT("explicit_rdpcm_dir_flag", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("explicit_rdpcm_dir_flag", value, ps_cabac->u4_range); - explicit_rdpcm_dir = value; - } - } -#endif - /* code the last_coeff_x_prefix as tunary binarized code */ { WORD32 ctxt_idx_x, ctxt_idx_y, ctx_shift; @@ -348,8 +311,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, scan_idx = SCAN_DIAG_UPRIGHT; if(PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode) { - int is_YUV444 = ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444; - if((2 == log2_trafo_size) || ((3 == log2_trafo_size) && (0 == c_idx || is_YUV444))) + if((2 == log2_trafo_size) || ((3 == log2_trafo_size) && (0 == c_idx))) { if((6 <= intra_pred_mode) && (14 >= intra_pred_mode)) @@ -381,15 +343,9 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, /* This will be updated later */ *pi1_num_coded_subblks = 0; - pi1_scan_idx = pi1_buf++; -#ifdef ENABLE_MAIN_REXT_PROFILE - /* Second WORD8 gives (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan idx << 1) | trans_skip */ - *pi1_scan_idx = (explicit_rdpcm_dir << 5) | (explicit_rdpcm_flag << 4) | (scan_idx << 1) - | transform_skip_flag; -#else /* Second WORD8 gives (scan idx << 1) | trans_skip */ + pi1_scan_idx = pi1_buf++; *pi1_scan_idx = (scan_idx << 1) | transform_skip_flag; -#endif /* Store the incremented pointer in pv_tu_coeff_data */ ps_codec->s_parse.pv_tu_coeff_data = pi1_buf; @@ -517,9 +473,6 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, WORD32 rice_param; WORD32 xs, ys; -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD8 i1_update_stats = ps_sps->i1_persistent_rice_adaptation_enabled_flag; -#endif sub_blk_pos = 0; if(i && (log2_trafo_size > 2)) @@ -619,18 +572,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, //coeff_pos = pu1_scan_coeff[n]; /* derive the context inc as per section 9.3.3.1.4 */ sig_ctxinc = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_transform_skip_context_enabled_flag - && (ps_codec->s_parse.s_cu.i4_cu_transquant_bypass - || transform_skip_flag)) - { - sig_coeff_base_ctxt = IHEVC_CAB_COEFF_FLAG; - sig_coeff_base_ctxt += (0 == c_idx) ? 42 : 43; - } - else if(2 == log2_trafo_size) -#else if(2 == log2_trafo_size) -#endif { /* 4x4 transform size increment uses lookup */ @@ -785,26 +727,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, /* At this level u4_sig_coeff_map is non-zero i.e. has atleast one non-zero coeff */ last_sig_scan_pos = (31 - CLZ(u4_sig_coeff_map)); first_sig_scan_pos = CTZ(u4_sig_coeff_map); - - if(ps_codec->s_parse.s_cu.i4_cu_transquant_bypass -#ifdef ENABLE_MAIN_REXT_PROFILE - || explicit_rdpcm_flag -#endif - || (PRED_MODE_INTRA == ps_codec->s_parse.s_cu.i4_pred_mode -#ifdef ENABLE_MAIN_REXT_PROFILE - && ps_sps->i1_implicit_rdpcm_enabled_flag -#else - && 0 -#endif - && transform_skip_flag - && (intra_pred_mode == 10 || intra_pred_mode == 26))) - { - sign_hidden = 0; - } - else - { - sign_hidden = ((last_sig_scan_pos - first_sig_scan_pos) > 3); - } + sign_hidden = (((last_sig_scan_pos - first_sig_scan_pos) > 3) && !ps_codec->s_parse.s_cu.i4_cu_transquant_bypass); u4_coeff_abs_level_greater2_map = 0; @@ -843,22 +766,7 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, num_sig_coeff = 0; sum_abs_level = 0; - -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 sb_type = 2 * (c_idx == 0 ? 1 : 0); - if(ps_sps->i1_persistent_rice_adaptation_enabled_flag) - { - if(!(transform_skip_flag == 0 && ps_codec->s_parse.s_cu.i4_cu_transquant_bypass == 0)) - { - sb_type += 1; - } - rice_param = ps_cabac->ai4_rice_stat_coeff[sb_type] / 4; - } - else -#endif - { - rice_param = 0; - } + rice_param = 0; { UWORD32 clz; UWORD32 u4_sig_coeff_map_shift; @@ -944,36 +852,10 @@ WORD32 ihevcd_parse_residual_coding(codec_t *ps_codec, } /* update the rice param based on coeff level */ - if(base_lvl > (3 << rice_param)) + if((base_lvl > (3 << rice_param)) && (rice_param < 4)) { -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_persistent_rice_adaptation_enabled_flag) - { - rice_param += 1; - } - else -#endif - { - rice_param = MIN((rice_param + 1), 4); - } + rice_param++; } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(i1_update_stats) - { - if(coeff_abs_level_remaining - >= (3 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4))) - { - ps_cabac->ai4_rice_stat_coeff[sb_type]++; - } - else if((2 * coeff_abs_level_remaining - < (1 << (ps_cabac->ai4_rice_stat_coeff[sb_type] / 4))) - && ps_cabac->ai4_rice_stat_coeff[sb_type] > 0) - { - ps_cabac->ai4_rice_stat_coeff[sb_type]--; - } - i1_update_stats = 0; - } -#endif /* Compute absolute level */ level = base_lvl; diff --git a/decoder/ihevcd_parse_slice.c b/decoder/ihevcd_parse_slice.c index 1337d58..d6f74f9 100644 --- a/decoder/ihevcd_parse_slice.c +++ b/decoder/ihevcd_parse_slice.c @@ -120,8 +120,7 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, WORD32 log2_trafo_size, WORD32 trafo_depth, WORD32 blk_idx, - WORD32 intra_pred_mode, - WORD32 chroma_intra_pred_mode_idx) + WORD32 intra_pred_mode) { IHEVCD_ERROR_T ret = (IHEVCD_ERROR_T)IHEVCD_SUCCESS; sps_t *ps_sps; @@ -181,30 +180,13 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, { ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = 0; ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = 0; - ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = 0; - } -#endif } else { ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth - 1]; ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1]; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = - ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth - 1]; - ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = - ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth - 1]; - } -#endif } - if ((CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && log2_trafo_size > 2) || - ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) + if(trafo_depth == 0 || log2_trafo_size > 2) { ctxt_idx = IHEVC_CAB_CBCR_IDX + trafo_depth; /* CBF for Cb/Cr is sent only if the parent CBF for Cb/Cr is non-zero */ @@ -214,16 +196,6 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); AEV_TRACE("cbf_cb", value, ps_cabac->u4_range); ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] = value; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 - && (!split_transform_flag || log2_trafo_size == 3)) - { - TRACE_CABAC_CTXT("cbf_cb", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("cbf_cb", value, ps_cabac->u4_range); - ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] = value; - } -#endif } if((trafo_depth == 0) || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth - 1]) @@ -232,22 +204,11 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); AEV_TRACE("cbf_cr", value, ps_cabac->u4_range); ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth] = value; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 - && (!split_transform_flag || log2_trafo_size == 3)) - { - TRACE_CABAC_CTXT("cbf_cr", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("cbf_cr", value, ps_cabac->u4_range); - ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth] = value; - } -#endif } } if(split_transform_flag) { WORD32 intra_pred_mode_tmp; - WORD32 chroma_intra_pred_mode_tmp_idx = ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0]; x1 = x0 + ((1 << log2_trafo_size) >> 1); y1 = y0 + ((1 << log2_trafo_size) >> 1); @@ -256,27 +217,19 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, /* When depth is non-zero intra pred mode of parent node is sent */ /* This takes care of passing correct mode to all the child nodes */ intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]; - if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0]; - ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 0, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx); + ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 0, intra_pred_mode_tmp); RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret); intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[1]; - if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[1]; - ret = ihevcd_parse_transform_tree(ps_codec, x1, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 1, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx); + ret = ihevcd_parse_transform_tree(ps_codec, x1, y0, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 1, intra_pred_mode_tmp); RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret); intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[2]; - if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[2]; - ret = ihevcd_parse_transform_tree(ps_codec, x0, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 2, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx); + ret = ihevcd_parse_transform_tree(ps_codec, x0, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 2, intra_pred_mode_tmp); RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret); intra_pred_mode_tmp = trafo_depth ? intra_pred_mode : ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[3]; - if (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - chroma_intra_pred_mode_tmp_idx = trafo_depth ? chroma_intra_pred_mode_idx : ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[3]; - ret = ihevcd_parse_transform_tree(ps_codec, x1, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 3, intra_pred_mode_tmp, chroma_intra_pred_mode_tmp_idx); + ret = ihevcd_parse_transform_tree(ps_codec, x1, y1, x0, y0, log2_trafo_size - 1, trafo_depth + 1, 3, intra_pred_mode_tmp); RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret); } @@ -285,7 +238,6 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, WORD32 ctb_x_base; WORD32 ctb_y_base; WORD32 cu_qp_delta_abs; - WORD32 cbf_chroma; @@ -293,19 +245,11 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, cu_qp_delta_abs = 0; ctb_x_base = ps_codec->s_parse.i4_ctb_x << ps_sps->i1_log2_ctb_size; ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size; - cbf_chroma = ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] - || ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth]; -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - cbf_chroma |= ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth] - || ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth]; - } -#endif if((ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTRA) || (trafo_depth != 0) || - (cbf_chroma)) + (ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth]) || + (ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth])) { ctxt_idx = IHEVC_CAB_CBF_LUMA_IDX; ctxt_idx += (trafo_depth == 0) ? 1 : 0; @@ -324,31 +268,21 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, /* Initialize ps_tu to default values */ /* If required change this to WORD32 packed write */ ps_tu->b1_cb_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cb_cbf_subtu1 = 0; -#endif ps_tu->b1_cr_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cr_cbf_subtu1 = 0; -#endif ps_tu->b1_y_cbf = 0; ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2); ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2); ps_tu->b1_transquant_bypass = ps_codec->s_parse.s_cu.i4_cu_transquant_bypass; ps_tu->b3_size = (log2_trafo_size - 2); ps_tu->b7_qp = ps_codec->s_parse.u4_qp; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cb_log2_res_sign = 0; - ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cr_log2_res_sign = 0; -#endif ps_tu->b6_luma_intra_mode = intra_pred_mode; - ps_tu->b3_chroma_intra_mode_idx = chroma_intra_pred_mode_idx; + ps_tu->b3_chroma_intra_mode_idx = ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx; /* Section:7.3.12 Transform unit syntax inlined here */ - if(ps_codec->s_parse.s_cu.i1_cbf_luma || cbf_chroma) + if(ps_codec->s_parse.s_cu.i1_cbf_luma || + ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth] || + ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth]) { WORD32 intra_pred_mode_chroma; if(ps_pps->i1_cu_qp_delta_enabled_flag && !ps_codec->s_parse.i4_is_cu_qp_delta_coded) @@ -404,98 +338,32 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 0, intra_pred_mode); } - WORD32 chroma_blk_luma_intra_pred_mode = - ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? - intra_pred_mode : - ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]; - if(4 == chroma_intra_pred_mode_idx) - intra_pred_mode_chroma = chroma_blk_luma_intra_pred_mode; + if(4 == ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx) + intra_pred_mode_chroma = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]; else { - intra_pred_mode_chroma = gau1_intra_pred_chroma_modes[chroma_intra_pred_mode_idx]; + intra_pred_mode_chroma = gau1_intra_pred_chroma_modes[ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx]; - if(intra_pred_mode_chroma == chroma_blk_luma_intra_pred_mode) + if(intra_pred_mode_chroma == + ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]) { intra_pred_mode_chroma = INTRA_ANGULAR(34); } - } - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - intra_pred_mode_chroma = gau1_intra_pred_chroma_modes_422[intra_pred_mode_chroma]; - } - if(log2_trafo_size > 2 || ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - WORD32 trafo_offset = (ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444 ? 0 : 1); - WORD32 log2_trafo_size_c = MAX(2, log2_trafo_size - trafo_offset); -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_pps->i1_cross_component_prediction_enabled_flag - && ps_codec->s_parse.s_cu.i1_cbf_luma - && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER - || chroma_intra_pred_mode_idx == 4)) - { - ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS; - TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx, - 0, 3); - AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range); - - if(value != 0) - { - ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG; - TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx); - ps_tu->b1_cb_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range); - ps_tu->b3_cb_log2_res_scale_abs_plus1 = value; - } - } -#endif + } + if(log2_trafo_size > 2) + { if(ps_codec->s_parse.s_cu.ai1_cbf_cb[trafo_depth]) { ps_tu->b1_cb_cbf = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 1, intra_pred_mode_chroma); + ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size - 1, 1, intra_pred_mode_chroma); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth]) - { - ps_tu->b1_cb_cbf_subtu1 = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 1, intra_pred_mode_chroma); - } -#endif -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_pps->i1_cross_component_prediction_enabled_flag - && ps_codec->s_parse.s_cu.i1_cbf_luma - && (ps_codec->s_parse.s_cu.i4_pred_mode == PRED_MODE_INTER - || chroma_intra_pred_mode_idx == 4)) - { - ctxt_idx = IHEVC_CAB_CCP_LOG2_RES_ABS + 4; - TRACE_CABAC_CTXT("log2_res_scale_abs_plus1", ps_cabac->u4_range, ctxt_idx); - value = ihevcd_cabac_decode_bins_tunary(ps_cabac, ps_bitstrm, 4, ctxt_idx, - 0, 3); - AEV_TRACE("log2_res_scale_abs_plus1", value, ps_cabac->u4_range); - if(value != 0) - { - ctxt_idx = IHEVC_CAB_CCP_RES_SIGN_FLAG + 1; - TRACE_CABAC_CTXT("res_scale_sign_flag", ps_cabac->u4_range, ctxt_idx); - ps_tu->b1_cr_log2_res_sign = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, ctxt_idx); - AEV_TRACE("res_scale_sign_flag", value, ps_cabac->u4_range); - ps_tu->b3_cr_log2_res_scale_abs_plus1 = value; - } - } -#endif if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth]) { ps_tu->b1_cr_cbf = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size_c, 2, intra_pred_mode_chroma); + ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size - 1, 2, intra_pred_mode_chroma); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth]) - { - ps_tu->b1_cr_cbf_subtu1 = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0 + (1 << log2_trafo_size_c), log2_trafo_size_c, 1, intra_pred_mode_chroma); - } -#endif } else if(blk_idx == 3) { @@ -504,26 +372,12 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, ps_tu->b1_cb_cbf = 1; ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 1, intra_pred_mode_chroma); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cb_subtu[trafo_depth]) - { - ps_tu->b1_cb_cbf_subtu1 = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 1, intra_pred_mode_chroma); - } -#endif if(ps_codec->s_parse.s_cu.ai1_cbf_cr[trafo_depth]) { ps_tu->b1_cr_cbf = 1; ihevcd_parse_residual_coding(ps_codec, cu_x_base, cu_y_base, log2_trafo_size, 2, intra_pred_mode_chroma); } -#ifdef ENABLE_MAIN_REXT_PROFILE - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422 && ps_codec->s_parse.s_cu.ai1_cbf_cr_subtu[trafo_depth]) - { - ps_tu->b1_cr_cbf_subtu1 = 1; - ihevcd_parse_residual_coding(ps_codec, x0, y0, log2_trafo_size, 1, intra_pred_mode_chroma); - } -#endif } else { @@ -533,7 +387,7 @@ WORD32 ihevcd_parse_transform_tree(codec_t *ps_codec, } else { - if((3 != blk_idx) && (2 == log2_trafo_size && ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_YUV444)) + if((3 != blk_idx) && (2 == log2_trafo_size)) { ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE; } @@ -736,8 +590,7 @@ IHEVCD_ERROR_T ihevcd_parse_pcm_sample(codec_t *ps_codec, num_bits = ps_sps->i1_pcm_sample_bit_depth_luma; - WORD32 luma_samples = 1 << (log2_cb_size << 1); - for(i = 0; i < luma_samples; i++) + for(i = 0; i < 1 << (log2_cb_size << 1); i++) { TRACE_CABAC_CTXT("pcm_sample_luma", ps_cabac->u4_range, 0); BITS_PARSE("pcm_sample_luma", value, ps_bitstrm, num_bits); @@ -746,25 +599,15 @@ IHEVCD_ERROR_T ihevcd_parse_pcm_sample(codec_t *ps_codec, *pu1_coeff_data++ = value << (BIT_DEPTH_LUMA - num_bits); } - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) + num_bits = ps_sps->i1_pcm_sample_bit_depth_chroma; + + for(i = 0; i < (1 << (log2_cb_size << 1)) >> 1; i++) { - WORD32 chroma_samples = 0; + TRACE_CABAC_CTXT("pcm_sample_chroma", ps_cabac->u4_range, 0); + BITS_PARSE("pcm_sample_chroma", value, ps_bitstrm, num_bits); - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - chroma_samples = luma_samples << 1; - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - chroma_samples = luma_samples; - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - chroma_samples = luma_samples >> 1; - num_bits = ps_sps->i1_pcm_sample_bit_depth_chroma; - for(i = 0; i < chroma_samples; i++) - { - TRACE_CABAC_CTXT("pcm_sample_chroma", ps_cabac->u4_range, 0); - BITS_PARSE("pcm_sample_chroma", value, ps_bitstrm, num_bits); - - // ps_pcmsample_t->i1_pcm_sample_chroma[i] = value; - *pu1_coeff_data++ = value << (BIT_DEPTH_CHROMA - num_bits); - } + // ps_pcmsample_t->i1_pcm_sample_chroma[i] = value; + *pu1_coeff_data++ = value << (BIT_DEPTH_CHROMA - num_bits); } ps_codec->s_parse.pv_tu_coeff_data = pu1_coeff_data; @@ -1173,13 +1016,7 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit_intra(codec_t *ps_codec, ps_tu = ps_codec->s_parse.ps_tu; ps_tu->b1_cb_cbf = 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cb_cbf_subtu1 = 1; -#endif ps_tu->b1_cr_cbf = 1; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cr_cbf_subtu1 = 1; -#endif ps_tu->b1_y_cbf = 1; ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2); ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2); @@ -1188,12 +1025,6 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit_intra(codec_t *ps_codec, ps_tu->b7_qp = ps_codec->s_parse.u4_qp; ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE; ps_tu->b6_luma_intra_mode = INTRA_PRED_NONE; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cb_log2_res_sign = 0; - ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cr_log2_res_sign = 0; -#endif /* Set the first TU in CU flag */ { @@ -1285,52 +1116,23 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit_intra(codec_t *ps_codec, } cnt++; } - if(CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) + TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE); + value = ihevcd_cabac_decode_bin(ps_cabac, + ps_bitstrm, + IHEVC_CAB_CHROMA_PRED_MODE); + ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx = 4; + if(value) { - for(i = 0; i < part_cnt; i++) - { - TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, - IHEVC_CAB_CHROMA_PRED_MODE); - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i] = 4; - if(value) - { - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i] = - ihevcd_cabac_decode_bypass_bins(ps_cabac, - ps_bitstrm, - 2); - } - AEV_TRACE("intra_chroma_pred_mode", - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[i], - ps_cabac->u4_range); - } + ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx = + ihevcd_cabac_decode_bypass_bins(ps_cabac, + ps_bitstrm, 2); } - else if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - TRACE_CABAC_CTXT("intra_chroma_pred_mode", ps_cabac->u4_range, IHEVC_CAB_CHROMA_PRED_MODE); - value = ihevcd_cabac_decode_bin(ps_cabac, ps_bitstrm, - IHEVC_CAB_CHROMA_PRED_MODE); - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] = 4; - if (value) { - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0] = - ihevcd_cabac_decode_bypass_bins(ps_cabac, ps_bitstrm, - 2); - } - AEV_TRACE("intra_chroma_pred_mode", - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0], - ps_cabac->u4_range); + AEV_TRACE("intra_chroma_pred_mode", + ps_codec->s_parse.s_cu.i4_intra_chroma_pred_mode_idx, + ps_cabac->u4_range); + - } ihevcd_intra_pred_mode_prediction(ps_codec, log2_cb_size, x0, y0); - - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && part_mode != PART_NxN) - { - // Only required for YUV444, but done for all formats to simplify calling arguments for ihevcd_parse_transform_tree - parse_cu_t *ps_cu = &ps_codec->s_parse.s_cu; - ps_cu->ai4_intra_chroma_pred_mode_idx[1] = ps_cu->ai4_intra_chroma_pred_mode_idx[0]; - ps_cu->ai4_intra_chroma_pred_mode_idx[2] = ps_cu->ai4_intra_chroma_pred_mode_idx[0]; - ps_cu->ai4_intra_chroma_pred_mode_idx[3] = ps_cu->ai4_intra_chroma_pred_mode_idx[0]; - } } STATS_UPDATE_PU_SIZE(ps_pu); /* Increment PU pointer */ @@ -1526,13 +1328,7 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit(codec_t *ps_codec, ctb_y_base = ps_codec->s_parse.i4_ctb_y << ps_sps->i1_log2_ctb_size; ps_tu->b1_cb_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cb_cbf_subtu1 = 0; -#endif ps_tu->b1_cr_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cr_cbf_subtu1 = 0; -#endif ps_tu->b1_y_cbf = 0; ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2); ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2); @@ -1541,12 +1337,6 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit(codec_t *ps_codec, ps_tu->b7_qp = ps_codec->s_parse.u4_qp; ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE; ps_tu->b6_luma_intra_mode = INTRA_PRED_NONE; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cb_log2_res_sign = 0; - ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cr_log2_res_sign = 0; -#endif /* Set the first TU in CU flag */ { @@ -1819,8 +1609,7 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit(codec_t *ps_codec, (ps_sps->i1_max_transform_hierarchy_depth_inter); ret = ihevcd_parse_transform_tree(ps_codec, x0, y0, x0, y0, log2_cb_size, 0, 0, - ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0], - ps_codec->s_parse.s_cu.ai4_intra_chroma_pred_mode_idx[0]); + ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]); RETURN_IF((IHEVCD_ERROR_T)IHEVCD_SUCCESS != ret, ret); } else @@ -1833,13 +1622,7 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit(codec_t *ps_codec, ps_tu = ps_codec->s_parse.ps_tu; ps_tu->b1_cb_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cb_cbf_subtu1 = 0; -#endif ps_tu->b1_cr_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cr_cbf_subtu1 = 0; -#endif ps_tu->b1_y_cbf = 0; ps_tu->b4_pos_x = ((x0 - ctb_x_base) >> 2); ps_tu->b4_pos_y = ((y0 - ctb_y_base) >> 2); @@ -1848,12 +1631,6 @@ IHEVCD_ERROR_T ihevcd_parse_coding_unit(codec_t *ps_codec, ps_tu->b7_qp = ps_codec->s_parse.u4_qp; ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE; ps_tu->b6_luma_intra_mode = ps_codec->s_parse.s_cu.ai4_intra_luma_pred_mode[0]; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cb_log2_res_sign = 0; - ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cr_log2_res_sign = 0; -#endif /* Set the first TU in CU flag */ { @@ -2293,7 +2070,7 @@ IHEVCD_ERROR_T ihevcd_parse_sao(codec_t *ps_codec) { WORD32 c_idx; WORD32 sao_type_idx = 0; - for(c_idx = 0; c_idx < (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc ? 3 : 1); c_idx++) + for(c_idx = 0; c_idx < 3; c_idx++) { if((ps_slice_hdr->i1_slice_sao_luma_flag && c_idx == 0) || (ps_slice_hdr->i1_slice_sao_chroma_flag && c_idx > 0)) { @@ -2473,13 +2250,7 @@ void ihevcd_set_ctb_skip(codec_t *ps_codec) { ps_tu = ps_codec->s_parse.ps_tu; ps_tu->b1_cb_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cb_cbf_subtu1 = 0; -#endif ps_tu->b1_cr_cbf = 0; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b1_cr_cbf_subtu1 = 0; -#endif ps_tu->b1_y_cbf = 0; ps_tu->b4_pos_x = pu_x >> 2; ps_tu->b4_pos_y = pu_y >> 2; @@ -2488,12 +2259,6 @@ void ihevcd_set_ctb_skip(codec_t *ps_codec) ps_tu->b7_qp = ps_codec->s_parse.u4_qp; ps_tu->b3_chroma_intra_mode_idx = INTRA_PRED_CHROMA_IDX_NONE; ps_tu->b6_luma_intra_mode = INTRA_PRED_NONE; -#ifdef ENABLE_MAIN_REXT_PROFILE - ps_tu->b3_cb_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cb_log2_res_sign = 0; - ps_tu->b3_cr_log2_res_scale_abs_plus1 = 0; - ps_tu->b1_cr_log2_res_sign = 0; -#endif ps_tu->b1_first_tu_in_cu = 1; ps_codec->s_parse.ps_tu++; @@ -2741,19 +2506,11 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) } else if((0 == ps_pps->i1_entropy_coding_sync_enabled_flag) || (ps_pps->i1_entropy_coding_sync_enabled_flag && (0 != ps_codec->s_parse.i4_ctb_x))) { -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 ai4_stats[4] = {0}; -#endif ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm, slice_qp, cabac_init_idc, - &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0] -#ifdef ENABLE_MAIN_REXT_PROFILE - , - ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL -#endif - ); + &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) { ps_codec->i4_slice_error = 1; @@ -2845,19 +2602,11 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) * of whether it is a dependent or an independent slice */ if(0 == ps_codec->i4_slice_error) { -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 ai4_stats[4] = {0}; -#endif ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm, slice_qp, cabac_init_idc, - &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0] -#ifdef ENABLE_MAIN_REXT_PROFILE - , - ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL -#endif - ); + &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) { ps_codec->i4_slice_error = 1; @@ -2928,20 +2677,12 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) ps_codec->s_parse.u4_qp = slice_qp; if(default_ctxt) { -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD32 ai4_stats[4] = {0}; -#endif //memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models, &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0], size); ret = ihevcd_cabac_init(&ps_codec->s_parse.s_cabac, &ps_codec->s_parse.s_bitstrm, slice_qp, cabac_init_idc, - &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0] -#ifdef ENABLE_MAIN_REXT_PROFILE - , - ps_sps->i1_persistent_rice_adaptation_enabled_flag ? ai4_stats : NULL -#endif - ); + &gau1_ihevc_cab_ctxts[cabac_init_idc][slice_qp][0]); if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) { @@ -2957,14 +2698,7 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) &ps_codec->s_parse.s_bitstrm, slice_qp, cabac_init_idc, - (const UWORD8 *)&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync -#ifdef ENABLE_MAIN_REXT_PROFILE - , - ps_sps->i1_persistent_rice_adaptation_enabled_flag ? - ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync : - NULL -#endif - ); + (const UWORD8 *)&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync); if(ret != (IHEVCD_ERROR_T)IHEVCD_SUCCESS) { @@ -3075,11 +2809,6 @@ IHEVCD_ERROR_T ihevcd_parse_slice_data(codec_t *ps_codec) { WORD32 size = sizeof(ps_codec->s_parse.s_cabac.au1_ctxt_models); memcpy(&ps_codec->s_parse.s_cabac.au1_ctxt_models_sync, &ps_codec->s_parse.s_cabac.au1_ctxt_models, size); - -#ifdef ENABLE_MAIN_REXT_PROFILE - size = sizeof(ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync); - memcpy(&ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff_sync, &ps_codec->s_parse.s_cabac.ai4_rice_stat_coeff, size); -#endif } } diff --git a/decoder/ihevcd_parse_slice_header.c b/decoder/ihevcd_parse_slice_header.c index 4f63658..0fedeb0 100644 --- a/decoder/ihevcd_parse_slice_header.c +++ b/decoder/ihevcd_parse_slice_header.c @@ -403,7 +403,6 @@ IHEVCD_ERROR_T ihevcd_parse_slice_header(codec_t *ps_codec, (ps_slice_hdr->i1_slice_type > 2)) return IHEVCD_IGNORE_SLICE; - if(ps_pps->i1_output_flag_present_flag) { BITS_PARSE("pic_output_flag", value, ps_bitstrm, 1); @@ -570,10 +569,8 @@ IHEVCD_ERROR_T ihevcd_parse_slice_header(codec_t *ps_codec, BITS_PARSE("slice_sao_luma_flag", value, ps_bitstrm, 1); ps_slice_hdr->i1_slice_sao_luma_flag = value; - if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) { - BITS_PARSE("slice_sao_chroma_flag", value, ps_bitstrm, 1); - ps_slice_hdr->i1_slice_sao_chroma_flag = value; - } + BITS_PARSE("slice_sao_chroma_flag", value, ps_bitstrm, 1); + ps_slice_hdr->i1_slice_sao_chroma_flag = value; } diff --git a/decoder/ihevcd_process_slice.c b/decoder/ihevcd_process_slice.c index 4da1fb2..c9f83e8 100644 --- a/decoder/ihevcd_process_slice.c +++ b/decoder/ihevcd_process_slice.c @@ -536,13 +536,6 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) WORD32 ctb_size = 1 << ps_sps->i1_log2_ctb_size; - WORD32 h_samp_factor, v_samp_factor; - WORD32 chroma_row_strd; - WORD32 chroma_pixel_strd = 2; - - h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2; - v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1; - PROFILE_DISABLE_PROCESS_CTB(); ps_codec = ps_proc->ps_codec; @@ -975,17 +968,15 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) /*TODO: Add support for custom scaling matrices */ } + /* CTB Level pointers */ ps_proc->pu1_cur_ctb_luma = ps_proc->pu1_cur_pic_luma + (ps_proc->i4_ctb_x * ctb_size + ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma - + (ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor) - + (ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd * chroma_pixel_strd / (h_samp_factor * v_samp_factor)); - } + ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma + + ps_proc->i4_ctb_x * ctb_size + + (ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd / 2); ihevcd_iquant_itrans_recon_ctb(ps_proc); } @@ -1210,8 +1201,6 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) /* Call padding if required */ { - chroma_row_strd = ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor; - #if SAO_PROCESS_SHIFT_CTB if(0 == ps_proc->i4_ctb_x) @@ -1223,21 +1212,16 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) + (ps_proc->i4_ctb_x * ctb_size + ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd); + ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma + + ps_proc->i4_ctb_x * ctb_size + + (ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd / 2); pad_ht_luma = ctb_size; pad_ht_luma += (ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y ? 8 : 0; + pad_ht_chroma = ctb_size / 2; /* Pad left after 1st CTB is processed */ ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(ps_proc->pu1_cur_ctb_luma - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_LEFT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma - + (ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor) - + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor); - pad_ht_chroma = ctb_size / v_samp_factor; - ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr( - ps_proc->pu1_cur_ctb_chroma - (8 * v_samp_factor) * chroma_row_strd, - chroma_row_strd, pad_ht_chroma, PAD_LEFT * chroma_pixel_strd / h_samp_factor); - } + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_ctb_chroma - 16 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); } if((ps_sps->i2_pic_wd_in_ctb - 1) == ps_proc->i4_ctb_x) @@ -1250,35 +1234,22 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) + (ps_proc->i4_ctb_x * ctb_size + ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma - + (ps_proc->i4_ctb_x * ctb_size * chroma_pixel_strd / h_samp_factor) - + (ps_proc->i4_ctb_y * ctb_size * chroma_row_strd / v_samp_factor); - pad_ht_chroma = ctb_size / v_samp_factor; - } + ps_proc->pu1_cur_ctb_chroma = ps_proc->pu1_cur_pic_chroma + + ps_proc->i4_ctb_x * ctb_size + + (ps_proc->i4_ctb_y * ctb_size * ps_codec->i4_strd / 2); + pad_ht_luma = ctb_size; + pad_ht_chroma = ctb_size / 2; if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y) { pad_ht_luma += 8; - if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pad_ht_chroma += (8 * v_samp_factor); - ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr( - ps_proc->pu1_cur_pic_chroma + ((ps_sps->i2_pic_height_in_luma_samples / v_samp_factor) - (8 * v_samp_factor)) * chroma_row_strd, - chroma_row_strd, (8 * v_samp_factor), - PAD_LEFT * chroma_pixel_strd / h_samp_factor); - } + pad_ht_chroma += 16; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_pic_chroma + (ps_sps->i2_pic_height_in_luma_samples / 2 - 16) * ps_codec->i4_strd, + ps_codec->i4_strd, 16, PAD_LEFT); } /* Pad right after last CTB in the current row is processed */ ps_codec->s_func_selector.ihevc_pad_right_luma_fptr(ps_proc->pu1_cur_ctb_luma + cols_remaining - 8 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr( - ps_proc->pu1_cur_ctb_chroma + (cols_remaining * chroma_pixel_strd / h_samp_factor) - (8 * v_samp_factor) * chroma_row_strd, - chroma_row_strd, pad_ht_chroma, - PAD_RIGHT * chroma_pixel_strd / h_samp_factor); - } + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(ps_proc->pu1_cur_ctb_chroma + cols_remaining - 16 * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_RIGHT); if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y) { @@ -1287,27 +1258,14 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) /* Hence moving top padding to to end of frame, Moving it to second row also results in problems when there is only one row */ /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_top(ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT * (chroma_pixel_strd / h_samp_factor), - chroma_row_strd, - (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor), - PAD_TOP / v_samp_factor); - } + ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP / 2); - /* Pad bottom after padding left and right for current rows after processing 1st CTB row */ pu1_buf = ps_proc->pu1_cur_pic_luma + ps_codec->i4_strd * ps_sps->i2_pic_height_in_luma_samples - PAD_LEFT; + /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_buf = ps_proc->pu1_cur_pic_chroma - + chroma_row_strd * (ps_sps->i2_pic_height_in_luma_samples / v_samp_factor) - - (PAD_LEFT * chroma_pixel_strd / h_samp_factor); - ihevc_pad_bottom(pu1_buf, - chroma_row_strd, - (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor), - PAD_BOT / v_samp_factor); - } + + pu1_buf = ps_proc->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2) - PAD_LEFT; + ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT / 2); } } #else @@ -1322,10 +1280,7 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) pad_ht_chroma = ctb_size / 2; /* Pad left after 1st CTB is processed */ ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(ps_proc->pu1_cur_ctb_luma - 2 * ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_LEFT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_ctb_chroma - ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); - } + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_ctb_chroma - ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); } else if((ps_sps->i2_pic_wd_in_ctb - 1) == ps_proc->i4_ctb_x) { @@ -1337,10 +1292,7 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) pad_ht_chroma = ((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y) ? 3 * ctb_size / 2 : ctb_size / 2; /* Pad right after last CTB in the current row is processed */ ps_codec->s_func_selector.ihevc_pad_right_luma_fptr(ps_proc->pu1_cur_ctb_luma + cols_remaining - 2 * ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_luma, PAD_RIGHT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(ps_proc->pu1_cur_ctb_chroma + cols_remaining - ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_RIGHT); - } + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr(ps_proc->pu1_cur_ctb_chroma + cols_remaining - ctb_size * ps_codec->i4_strd, ps_codec->i4_strd, pad_ht_chroma, PAD_RIGHT); if((ps_sps->i2_pic_ht_in_ctb - 1) == ps_proc->i4_ctb_y) { @@ -1353,30 +1305,21 @@ IHEVCD_ERROR_T ihevcd_process(process_ctxt_t *ps_proc) ps_codec->s_func_selector.ihevc_pad_left_luma_fptr(ps_proc->pu1_cur_pic_luma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples - 2 * ctb_size), ps_codec->i4_strd, pad_ht_luma, PAD_LEFT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2 - ctb_size), - ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr(ps_proc->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2 - ctb_size), + ps_codec->i4_strd, pad_ht_chroma, PAD_LEFT); - } /* Since SAO is shifted by 8x8, chroma padding can not be done till second row is processed */ /* Hence moving top padding to to end of frame, Moving it to second row also results in problems when there is only one row */ /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_top(ps_proc->pu1_cur_pic_luma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP / 2); - } + ihevc_pad_top(ps_proc->pu1_cur_pic_chroma - PAD_LEFT, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_TOP / 2); pu1_buf = ps_proc->pu1_cur_pic_luma + ps_codec->i4_strd * ps_sps->i2_pic_height_in_luma_samples - PAD_LEFT; /* Pad top after padding left and right for current rows after processing 1st CTB row */ ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT); - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { - pu1_buf = ps_proc->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2) - PAD_LEFT; - ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT / 2); - } + pu1_buf = ps_proc->pu1_cur_pic_chroma + ps_codec->i4_strd * (ps_sps->i2_pic_height_in_luma_samples / 2) - PAD_LEFT; + ihevc_pad_bottom(pu1_buf, ps_codec->i4_strd, ps_sps->i2_pic_width_in_luma_samples + PAD_WD, PAD_BOT / 2); } } } diff --git a/decoder/ihevcd_sao.c b/decoder/ihevcd_sao.c index 2ea935a..243e2ce 100644 --- a/decoder/ihevcd_sao.c +++ b/decoder/ihevcd_sao.c @@ -364,9 +364,6 @@ void ihevcd_sao_ctb(sao_ctxt_t *ps_sao_ctxt) } - /* Chroma */ - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) - { if(0 == ps_sao->b3_cb_type_idx) { for(row = 0; row < sao_ht_chroma; row++) @@ -520,7 +517,7 @@ void ihevcd_sao_ctb(sao_ctxt_t *ps_sao_ctxt) } } - } + } } @@ -696,7 +693,6 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) /* Chroma */ - if (CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc) { UWORD32 u4_no_loop_filter_flag; WORD32 loop_filter_bit_pos; @@ -1118,7 +1114,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) ps_codec->s_func_selector.ihevc_memcpy_fptr(pu1_src_top_luma, &pu1_src_luma[(sao_ht_luma - 1) * src_strd], sao_wd_luma); } - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && ps_slice_hdr_top_left->i1_slice_sao_chroma_flag) + if(ps_slice_hdr_top_left->i1_slice_sao_chroma_flag) { if(0 == ps_sao->b3_cb_type_idx) { @@ -1439,7 +1435,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) } } } - else if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && ((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag))) + else if((!ps_slice_hdr->i1_first_slice_in_pic_flag) || (ps_pps->i1_tiles_enabled_flag)) { for(row = 0; row < sao_ht_chroma; row++) { @@ -1765,7 +1761,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) } } - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_wd_chroma) + if(0 != sao_wd_chroma) { if(ps_slice_hdr_top->i1_slice_sao_chroma_flag) { @@ -2364,7 +2360,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) } } - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && 0 != sao_ht_chroma) + if(0 != sao_ht_chroma) { if(ps_slice_hdr_left->i1_slice_sao_chroma_flag) { @@ -2999,7 +2995,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) } } - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && (0 != sao_wd_chroma) && (0 != sao_ht_chroma)) + if((0 != sao_wd_chroma) && (0 != sao_ht_chroma)) { if(ps_sao_ctxt->ps_slice_hdr->i1_slice_sao_chroma_flag) { @@ -3419,7 +3415,7 @@ void ihevcd_sao_shift_ctb(sao_ctxt_t *ps_sao_ctxt) } /* Chroma */ - if(CHROMA_FMT_IDC_MONOCHROME != ps_sps->i1_chroma_format_idc && no_loop_filter_enabled_chroma) + if(no_loop_filter_enabled_chroma) { UWORD32 u4_no_loop_filter_flag; WORD32 loop_filter_bit_pos; diff --git a/decoder/ihevcd_structs.h b/decoder/ihevcd_structs.h index 13e49b4..34a9271 100644 --- a/decoder/ihevcd_structs.h +++ b/decoder/ihevcd_structs.h @@ -119,13 +119,6 @@ typedef struct cab_ctxt */ UWORD8 au1_ctxt_models_sync[IHEVC_CAB_CTXT_END]; -#ifdef ENABLE_MAIN_REXT_PROFILE - /** golomb rice adaptation statistics */ - WORD32 ai4_rice_stat_coeff[4]; - - WORD32 ai4_rice_stat_coeff_sync[4]; -#endif - }cab_ctxt_t; typedef enum @@ -743,7 +736,7 @@ typedef struct /** * Chroma pred mode index to be used to compute intra pred mode for chroma */ - WORD32 ai4_intra_chroma_pred_mode_idx[4]; + WORD32 i4_intra_chroma_pred_mode_idx; /** * Maximum transform depth */ @@ -758,17 +751,11 @@ typedef struct * Cb CBF */ UWORD8 ai1_cbf_cb[MAX_TRAFO_DEPTH]; -#ifdef ENABLE_MAIN_REXT_PROFILE - UWORD8 ai1_cbf_cb_subtu[MAX_TRAFO_DEPTH]; -#endif /** * Cr CBF */ UWORD8 ai1_cbf_cr[MAX_TRAFO_DEPTH]; -#ifdef ENABLE_MAIN_REXT_PROFILE - UWORD8 ai1_cbf_cr_subtu[MAX_TRAFO_DEPTH]; -#endif /** * Intra split flag @@ -1478,20 +1465,8 @@ typedef struct /** Intermediate buffer to be used during inverse transform */ WORD16 *pi2_itrans_intrmd_buf; -#ifdef ENABLE_MAIN_REXT_PROFILE - /** - * residue buffer to be store output of inverse transform. - * Only used for frext tool sets - */ - WORD16 *pi2_res_luma_buf; - WORD16 *pi2_res_chroma_buf; -#endif - /** Buffer to hold output of inverse scan */ WORD16 *pi2_invscan_out; -#ifdef ENABLE_MAIN_REXT_PROFILE - WORD16 *pi2_invscan_out_subtu; -#endif /** * Top availability for current CTB level @@ -1615,14 +1590,6 @@ typedef void (*pf_intra_pred)(UWORD8 *pu1_ref, WORD32 nt, WORD32 mode); -typedef void (*pf_itrans_res)(WORD16 *pi2_src, - WORD16 *pi2_tmp, - WORD16 *pi2_dst, - WORD32 i4_src_strd, - WORD32 i4_dst_strd, - WORD32 zero_cols, - WORD32 zero_rows); - typedef void (*pf_itrans_recon)(WORD16 *pi2_src, WORD16 *pi2_tmp, UWORD8 *pu1_pred, @@ -1648,11 +1615,6 @@ typedef void (*pf_itrans_recon_dc)(UWORD8 *pu1_pred, WORD32 log2_trans_size, WORD16 i2_coeff_value); -typedef void (*pf_itrans_res_dc)(WORD16 *pi2_dst, - WORD32 dst_strd, - WORD32 log2_trans_size, - WORD16 i2_coeff_value); - typedef void (*pf_sao_luma)(UWORD8 *, WORD32, @@ -1944,11 +1906,6 @@ struct _codec_t */ UWORD32 u4_bitsbuf_size_dynamic; - /** - * Bitmask specifying the set of supported YUV output formats - */ - UWORD32 u4_enable_yuv_formats; - /** * Pointer to hold TU data for a set of CTBs or a picture */ @@ -2255,21 +2212,15 @@ struct _codec_t /** Funtion pointers for inter_pred_chroma leaf level functions */ pf_intra_pred apf_intra_pred_chroma[11]; - /** Funtion pointers for itrans leaf level functions */ - pf_itrans_res apf_itrans_res[5]; - /** Funtion pointers for itrans_recon leaf level functions */ - pf_itrans_recon apf_itrans_recon[9]; + pf_itrans_recon apf_itrans_recon[8]; /** Funtion pointers for recon leaf level functions */ - pf_recon apf_recon[9]; + pf_recon apf_recon[8]; /** Funtion pointers for itrans_recon_dc leaf level functions */ pf_itrans_recon_dc apf_itrans_recon_dc[2]; - /** Funtion pointers for itrans dc leaf level functions */ - pf_itrans_res_dc apf_itrans_res_dc; - /** Funtion pointers for sao_luma leaf level functions */ pf_sao_luma apf_sao_luma[4]; diff --git a/decoder/ihevcd_utils.c b/decoder/ihevcd_utils.c old mode 100644 new mode 100755 index 98ebd49..26c08a7 --- a/decoder/ihevcd_utils.c +++ b/decoder/ihevcd_utils.c @@ -216,22 +216,7 @@ WORD32 ihevcd_get_total_pic_buf_size(codec_t *ps_codec, num_luma_samples = (wd + PAD_WD) * (ht + PAD_HT); /* Account for chroma */ - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - num_samples = num_luma_samples * 3; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - num_samples = num_luma_samples * 2; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - { - num_samples = num_luma_samples * 3 / 2; - } - else - { - num_samples = num_luma_samples; - } + num_samples = num_luma_samples * 3 / 2; /* Number of bytes in reference pictures */ size = num_samples * max_dpb_size; @@ -313,33 +298,17 @@ WORD32 ihevcd_get_pic_mv_bank_size(WORD32 num_luma_samples) * ******************************************************************************* */ -WORD32 ihevcd_get_tu_data_size(codec_t *ps_codec, WORD32 num_luma_samples) +WORD32 ihevcd_get_tu_data_size(WORD32 num_luma_samples) { - sps_t *ps_sps = (ps_codec->s_parse.ps_sps_base + ps_codec->i4_sps_id); + WORD32 tu_data_size; WORD32 num_ctb; WORD32 num_luma_tu, num_chroma_tu, num_tu; num_ctb = num_luma_samples / (MIN_CTB_SIZE * MIN_CTB_SIZE); num_luma_tu = num_luma_samples / (MIN_TU_SIZE * MIN_TU_SIZE); - - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - num_chroma_tu = num_luma_tu << 1; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - num_chroma_tu = num_luma_tu; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - { - num_chroma_tu = num_luma_tu >> 1; - } - else - { - num_chroma_tu = 0; - } + num_chroma_tu = num_luma_tu >> 1; num_tu = num_luma_tu + num_chroma_tu; tu_data_size = 0; @@ -490,16 +459,13 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) UWORD8 *pu1_buf; pic_buf_t *ps_pic_buf; WORD32 pic_buf_size_allocated; - WORD32 h_samp_factor, v_samp_factor; - WORD32 chroma_pixel_strd = 2; + + /* Initialize Pic buffer manager */ ps_sps = ps_codec->s_parse.ps_sps; - h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2; - v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1; - /* Compute the number of Pic buffers needed */ max_dpb_size = ps_sps->ai1_sps_max_dec_pic_buffering[ps_sps->i1_sps_max_sub_layers - 1]; @@ -530,14 +496,7 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) luma_samples = (ps_codec->i4_strd) * (ps_sps->i2_pic_height_in_luma_samples + PAD_HT); - if(CHROMA_FMT_IDC_MONOCHROME == ps_sps->i1_chroma_format_idc) - { - chroma_samples = 0; - } - else - { - chroma_samples = luma_samples * 2 / (h_samp_factor * v_samp_factor); - } + chroma_samples = luma_samples / 2; /* Try to add as many buffers as possible since memory is already allocated */ /* If the number of buffers that can be added is less than max_num_bufs @@ -556,17 +515,8 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) ps_pic_buf->pu1_luma = pu1_buf + ps_codec->i4_strd * PAD_TOP + PAD_LEFT; pu1_buf += luma_samples; - if(chroma_samples) - { - ps_pic_buf->pu1_chroma = pu1_buf - + (ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor) * (PAD_TOP / v_samp_factor) - + (PAD_LEFT * chroma_pixel_strd / h_samp_factor); - pu1_buf += chroma_samples; - } - else - { - ps_pic_buf->pu1_chroma = NULL; - } + ps_pic_buf->pu1_chroma = pu1_buf + ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT; + pu1_buf += chroma_samples; /* Pad boundary pixels (one pixel on all sides) */ /* This ensures SAO does not read uninitialized pixels */ @@ -592,25 +542,21 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) pu1_buf += strd * ht; memset(pu1_buf - 1, 0, wd + 2); - if(ps_pic_buf->pu1_chroma) + pu1_buf = ps_pic_buf->pu1_chroma; + ht >>= 1; + for(i = 0; i < ht; i++) { - pu1_buf = ps_pic_buf->pu1_chroma; - ht /= v_samp_factor; - WORD32 chroma_strd_scale = chroma_pixel_strd / h_samp_factor; - for(i = 0; i < ht; i++) - { - pu1_buf[-1] = 0; - pu1_buf[-2] = 0; - pu1_buf[wd * chroma_strd_scale] = 0; - pu1_buf[wd * chroma_strd_scale + 1] = 0; - pu1_buf += (strd * chroma_strd_scale); - } - pu1_buf = ps_pic_buf->pu1_chroma; - memset(pu1_buf - (strd * chroma_strd_scale) - 2, 0, wd * chroma_strd_scale + 4); - - pu1_buf += (strd * chroma_strd_scale) * ht; - memset(pu1_buf - 2, 0, wd * chroma_strd_scale + 4); + pu1_buf[-1] = 0; + pu1_buf[-2] = 0; + pu1_buf[wd] = 0; + pu1_buf[wd + 1] = 0; + pu1_buf += strd; } + pu1_buf = ps_pic_buf->pu1_chroma; + memset(pu1_buf - strd - 2, 0, wd + 4); + + pu1_buf += strd * ht; + memset(pu1_buf - 2, 0, wd + 4); } buf_ret = ihevc_buf_mgr_add((buf_mgr_t *)ps_codec->pv_pic_buf_mgr, ps_pic_buf, i); @@ -641,8 +587,7 @@ IHEVCD_ERROR_T ihevcd_pic_buf_mgr_add_bufs(codec_t *ps_codec) break; } ps_pic_buf->pu1_luma += ps_codec->i4_strd * PAD_TOP + PAD_LEFT; - ps_pic_buf->pu1_chroma += (ps_codec->i4_strd * chroma_pixel_strd / h_samp_factor) * (PAD_TOP / v_samp_factor) - + (PAD_LEFT * chroma_pixel_strd / h_samp_factor); + ps_pic_buf->pu1_chroma += ps_codec->i4_strd * (PAD_TOP / 2) + PAD_LEFT; } } @@ -796,15 +741,15 @@ IHEVCD_ERROR_T ihevcd_check_out_buf_size(codec_t *ps_codec) if(ps_codec->e_chroma_fmt == IV_YUV_420P) u4_min_num_out_bufs = MIN_OUT_BUFS_420; - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) - u4_min_num_out_bufs = MIN_OUT_BUFS_444; - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - u4_min_num_out_bufs = MIN_OUT_BUFS_422; + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) + u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE; + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565; + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + u4_min_num_out_bufs = MIN_OUT_BUFS_RGBA8888; else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) u4_min_num_out_bufs = MIN_OUT_BUFS_420SP; - else if(ps_codec->e_chroma_fmt == IV_GRAY) - u4_min_num_out_bufs = MIN_OUT_BUFS_GRAY; if(ps_codec->e_chroma_fmt == IV_YUV_420P) { @@ -812,11 +757,23 @@ IHEVCD_ERROR_T ihevcd_check_out_buf_size(codec_t *ps_codec) au4_min_out_buf_size[1] = (wd * ht) >> 2; au4_min_out_buf_size[2] = (wd * ht) >> 2; } - else if(ps_codec->e_chroma_fmt == IV_YUV_444P) + else if(ps_codec->e_chroma_fmt == IV_YUV_422ILE) { - au4_min_out_buf_size[0] = (wd * ht); - au4_min_out_buf_size[1] = (wd * ht); - au4_min_out_buf_size[2] = (wd * ht); + au4_min_out_buf_size[0] = (wd * ht) * 2; + au4_min_out_buf_size[1] = + au4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGB_565) + { + au4_min_out_buf_size[0] = (wd * ht) * 2; + au4_min_out_buf_size[1] = + au4_min_out_buf_size[2] = 0; + } + else if(ps_codec->e_chroma_fmt == IV_RGBA_8888) + { + au4_min_out_buf_size[0] = (wd * ht) * 4; + au4_min_out_buf_size[1] = + au4_min_out_buf_size[2] = 0; } else if((ps_codec->e_chroma_fmt == IV_YUV_420SP_UV) || (ps_codec->e_chroma_fmt == IV_YUV_420SP_VU)) @@ -825,19 +782,6 @@ IHEVCD_ERROR_T ihevcd_check_out_buf_size(codec_t *ps_codec) au4_min_out_buf_size[1] = (wd * ht) >> 1; au4_min_out_buf_size[2] = 0; } - else if(ps_codec->e_chroma_fmt == IV_GRAY) - { - au4_min_out_buf_size[0] = (wd * ht); - au4_min_out_buf_size[1] = 0; - au4_min_out_buf_size[2] = 0; - } - else if(ps_codec->e_chroma_fmt == IV_YUV_422P) - { - au4_min_out_buf_size[0] = (wd * ht); - au4_min_out_buf_size[1] = (wd * ht) >> 1; - au4_min_out_buf_size[2] = (wd * ht) >> 1; - } - if(ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs) { @@ -886,8 +830,6 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) pic_buf_t *ps_cur_pic; slice_header_t *ps_slice_hdr; UWORD8 *pu1_cur_pic_luma, *pu1_cur_pic_chroma; - WORD32 h_samp_factor, v_samp_factor; - WORD32 chroma_pixel_strd = 2; WORD32 i; ps_codec->s_parse.i4_error_code = IHEVCD_SUCCESS; @@ -899,8 +841,7 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) memset(ps_codec->s_parse.pu1_pic_intra_flag, 0, num_min_cu); memset(ps_codec->s_parse.pu1_pic_no_loop_filter_flag, 0, num_min_cu); - h_samp_factor = (CHROMA_FMT_IDC_YUV444 == ps_sps->i1_chroma_format_idc) ? 1 : 2; - v_samp_factor = (CHROMA_FMT_IDC_YUV420 == ps_sps->i1_chroma_format_idc) ? 2 : 1; + if(0 == ps_codec->s_parse.i4_first_pic_init) { @@ -984,6 +925,7 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) pu1_cur_pic_luma = pu1_buf; pu1_buf = ps_cur_pic->pu1_chroma; + pu1_cur_pic_chroma = pu1_buf; #ifndef DISABLE_SEI @@ -1013,13 +955,7 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) if(0 == ps_codec->u4_pic_cnt) { memset(ps_cur_pic->pu1_luma, 128, (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * ps_sps->i2_pic_height_in_luma_samples); - if(ps_sps->i1_chroma_format_idc != CHROMA_FMT_IDC_MONOCHROME) - { - memset(ps_cur_pic->pu1_chroma, - 128, - (((ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * (chroma_pixel_strd / h_samp_factor)) - * ps_sps->i2_pic_height_in_luma_samples / v_samp_factor)); - } + memset(ps_cur_pic->pu1_chroma, 128, (ps_sps->i2_pic_width_in_luma_samples + PAD_WD) * ps_sps->i2_pic_height_in_luma_samples / 2); } /* Fill the remaining entries of the reference lists with the nearest POC @@ -1135,22 +1071,7 @@ IHEVCD_ERROR_T ihevcd_parse_pic_init(codec_t *ps_codec) ctb_luma_min_tu_cnt = pic_size / (MIN_TU_SIZE * MIN_TU_SIZE); - if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV444) - { - ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt << 1; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV422) - { - ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt; - } - else if(ps_sps->i1_chroma_format_idc == CHROMA_FMT_IDC_YUV420) - { - ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt >> 1; - } - else - { - ctb_chroma_min_tu_cnt = 0; - } + ctb_chroma_min_tu_cnt = ctb_luma_min_tu_cnt >> 1; ctb_min_tu_cnt = ctb_luma_min_tu_cnt + ctb_chroma_min_tu_cnt; diff --git a/decoder/ihevcd_utils.h b/decoder/ihevcd_utils.h index 9bc1951..893acaa 100644 --- a/decoder/ihevcd_utils.h +++ b/decoder/ihevcd_utils.h @@ -40,7 +40,7 @@ WORD32 ihevcd_get_lvl_idx(WORD32 level); WORD32 ihevcd_get_dpb_size(WORD32 level, WORD32 pic_size); WORD32 ihevcd_get_pic_mv_bank_size(WORD32 num_luma_samples); -WORD32 ihevcd_get_tu_data_size(codec_t *ps_codec, WORD32 num_luma_samples); +WORD32 ihevcd_get_tu_data_size(WORD32 num_luma_samples); WORD32 ihevcd_nctb_cnt(codec_t *ps_codec, sps_t *ps_sps); WORD32 ihevcd_get_max_luma_samples(WORD32 level); IHEVCD_ERROR_T ihevcd_get_tile_pos(pps_t *ps_pps, diff --git a/decoder/libhevcdec.cmake b/decoder/libhevcdec.cmake old mode 100644 new mode 100755 index 1db95d6..35812d4 --- a/decoder/libhevcdec.cmake +++ b/decoder/libhevcdec.cmake @@ -33,12 +33,13 @@ list( include_directories(${HEVC_ROOT}/decoder) # arm/x86 sources -if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" STREQUAL "arm64") +if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64") list( APPEND LIBHEVCDEC_ASMS "${HEVC_ROOT}/decoder/arm64/ihevcd_fmt_conv_420sp_to_420p.s" "${HEVC_ROOT}/decoder/arm64/ihevcd_fmt_conv_420sp_to_420sp.s" + "${HEVC_ROOT}/decoder/arm64/ihevcd_fmt_conv_420sp_to_rgba8888.s" "${HEVC_ROOT}/decoder/arm/ihevcd_function_selector.c" "${HEVC_ROOT}/decoder/arm/ihevcd_function_selector_noneon.c" "${HEVC_ROOT}/decoder/arm64/ihevcd_function_selector_av8.c" @@ -46,12 +47,13 @@ if("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" STREQUAL "a "${HEVC_ROOT}/decoder/arm64/ihevcd_itrans_recon_dc_luma.s") include_directories(${HEVC_ROOT}/decoder/arm64) -elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch32") +elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch32") list( APPEND LIBHEVCDEC_ASMS "${HEVC_ROOT}/decoder/arm/ihevcd_fmt_conv_420sp_to_420p.s" "${HEVC_ROOT}/decoder/arm/ihevcd_fmt_conv_420sp_to_420sp.s" + "${HEVC_ROOT}/decoder/arm/ihevcd_fmt_conv_420sp_to_rgba8888.s" "${HEVC_ROOT}/decoder/arm/ihevcd_function_selector_a9q.c" "${HEVC_ROOT}/decoder/arm/ihevcd_function_selector.c" "${HEVC_ROOT}/decoder/arm/ihevcd_function_selector_noneon.c" @@ -76,4 +78,3 @@ endif() add_library(libhevcdec STATIC ${LIBHEVC_COMMON_SRCS} ${LIBHEVC_COMMON_ASMS} ${LIBHEVCDEC_ASMS} ${LIBHEVCDEC_SRCS}) -target_compile_definitions(libhevcdec PRIVATE ENABLE_MAIN_REXT_PROFILE) diff --git a/decoder/riscv64/ihevcd_function_selector.c b/decoder/riscv64/ihevcd_function_selector.c index 066a8ab..a2a13ed 100644 --- a/decoder/riscv64/ihevcd_function_selector.c +++ b/decoder/riscv64/ihevcd_function_selector.c @@ -54,7 +54,9 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" void ihevcd_init_function_ptr(void *pv_codec) { @@ -63,7 +65,7 @@ void ihevcd_init_function_ptr(void *pv_codec) { default: case ARCH_RISCV64_GENERIC: - ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_generic(pv_codec); } } diff --git a/decoder/riscv64/ihevcd_function_selector_generic.c b/decoder/riscv64/ihevcd_function_selector_generic.c index ff2d237..f8b53ad 100644 --- a/decoder/riscv64/ihevcd_function_selector_generic.c +++ b/decoder/riscv64/ihevcd_function_selector_generic.c @@ -54,113 +54,109 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_generic(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_generic(void *pv_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + codec_t *ps_codec = (codec_t *)pv_codec; + + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; } diff --git a/decoder/x86/ihevcd_function_selector.c b/decoder/x86/ihevcd_function_selector.c index 2ad66be..b058a62 100644 --- a/decoder/x86/ihevcd_function_selector.c +++ b/decoder/x86/ihevcd_function_selector.c @@ -64,23 +64,23 @@ void ihevcd_init_function_ptr(void *pv_codec) switch(ps_codec->e_processor_arch) { case ARCH_X86_GENERIC: - ihevcd_init_function_ptr_generic(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_generic(pv_codec); break; case ARCH_X86_SSSE3: - ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_ssse3(pv_codec); break; case ARCH_X86_SSE42: - ihevcd_init_function_ptr_sse42(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_sse42(pv_codec); break; case ARCH_X86_AVX2: #ifndef DISABLE_AVX2 - ihevcd_init_function_ptr_avx2(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_avx2(pv_codec); #else - ihevcd_init_function_ptr_sse42(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_sse42(pv_codec); #endif break; default: - ihevcd_init_function_ptr_ssse3(&ps_codec->s_func_selector); + ihevcd_init_function_ptr_ssse3(pv_codec); break; } } diff --git a/decoder/x86/ihevcd_function_selector_generic.c b/decoder/x86/ihevcd_function_selector_generic.c index ff2d237..f8b53ad 100644 --- a/decoder/x86/ihevcd_function_selector_generic.c +++ b/decoder/x86/ihevcd_function_selector_generic.c @@ -54,113 +54,109 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_generic(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_generic(void *pv_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + codec_t *ps_codec = (codec_t *)pv_codec; + + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma; } diff --git a/decoder/x86/ihevcd_function_selector_sse42.c b/decoder/x86/ihevcd_function_selector_sse42.c index 432c75c..fe46cc4 100644 --- a/decoder/x86/ihevcd_function_selector_sse42.c +++ b/decoder/x86/ihevcd_function_selector_sse42.c @@ -54,113 +54,109 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_sse42(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_sse42(void *pv_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_ssse3; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_ssse3; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_ssse3; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_sse42; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_sse42; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_ssse3; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_ssse3; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_sse42; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_sse42; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_sse42; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_sse42; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_sse42; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_sse42; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_sse42; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_sse42; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_sse42; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_sse42; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_ssse3; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_sse42; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_sse42; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_sse42; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_sse42; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_ssse3; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_sse42; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_sse42; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_sse42; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_sse42; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_sse42; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_ssse3; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_sse42; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_ssse3; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_ssse3; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_ssse3; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_sse42; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_sse42; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + codec_t *ps_codec = (codec_t *)pv_codec; + + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_ssse3; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_ssse3; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_sse42; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_sse42; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_sse42; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_sse42; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_sse42; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_sse42; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_sse42; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_sse42; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_ssse3; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_sse42; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_sse42; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_sse42; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_sse42; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_sse42; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_sse42; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_ssse3; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_ssse3; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p_ssse3; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_sse42; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_sse42; } diff --git a/decoder/x86/ihevcd_function_selector_ssse3.c b/decoder/x86/ihevcd_function_selector_ssse3.c index ebb33a6..fdb471a 100644 --- a/decoder/x86/ihevcd_function_selector_ssse3.c +++ b/decoder/x86/ihevcd_function_selector_ssse3.c @@ -54,113 +54,109 @@ #include "ihevc_dpb_mgr.h" #include "ihevc_error.h" +#include "ihevcd_defs.h" #include "ihevcd_function_selector.h" +#include "ihevcd_structs.h" -void ihevcd_init_function_ptr_ssse3(func_selector_t *ps_func_selector) +void ihevcd_init_function_ptr_ssse3(void *pv_codec) { - ps_func_selector->ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_ssse3; - ps_func_selector->ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_ssse3; - ps_func_selector->ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_ssse3; - ps_func_selector->ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_ssse3; - ps_func_selector->ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_ssse3; - ps_func_selector->ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_ssse3; - ps_func_selector->ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; - ps_func_selector->ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; - ps_func_selector->ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_ref_filtering_fptr = &ihevc_intra_pred_chroma_ref_filtering; - ps_func_selector->ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_ssse3; - ps_func_selector->ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_ssse3; - ps_func_selector->ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_ssse3; - ps_func_selector->ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_ssse3; - ps_func_selector->ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_ssse3; - ps_func_selector->ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_ssse3; - ps_func_selector->ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_ssse3; - ps_func_selector->ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; - ps_func_selector->ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; - ps_func_selector->ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; - ps_func_selector->ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; - ps_func_selector->ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; - ps_func_selector->ihevc_itrans_res_4x4_ttype1_fptr = &ihevc_itrans_res_4x4_ttype1; - ps_func_selector->ihevc_itrans_res_4x4_fptr = &ihevc_itrans_res_4x4; - ps_func_selector->ihevc_itrans_res_8x8_fptr = &ihevc_itrans_res_8x8; - ps_func_selector->ihevc_itrans_res_16x16_fptr = &ihevc_itrans_res_16x16; - ps_func_selector->ihevc_itrans_res_32x32_fptr = &ihevc_itrans_res_32x32; - ps_func_selector->ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_ssse3; - ps_func_selector->ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_ssse3; - ps_func_selector->ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_ssse3; - ps_func_selector->ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_ssse3; - ps_func_selector->ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_ssse3; - ps_func_selector->ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; - ps_func_selector->ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; - ps_func_selector->ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; - ps_func_selector->ihevc_chroma_itrans_recon_32x32_fptr = &ihevc_chroma_itrans_recon_32x32; - ps_func_selector->ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; - ps_func_selector->ihevc_recon_4x4_fptr = &ihevc_recon_4x4; - ps_func_selector->ihevc_recon_8x8_fptr = &ihevc_recon_8x8; - ps_func_selector->ihevc_recon_16x16_fptr = &ihevc_recon_16x16; - ps_func_selector->ihevc_recon_32x32_fptr = &ihevc_recon_32x32; - ps_func_selector->ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; - ps_func_selector->ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; - ps_func_selector->ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; - ps_func_selector->ihevc_chroma_recon_32x32_fptr = &ihevc_chroma_recon_32x32; - ps_func_selector->ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; - ps_func_selector->ihevc_memcpy_fptr = &ihevc_memcpy; - ps_func_selector->ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; - ps_func_selector->ihevc_memset_fptr = &ihevc_memset; - ps_func_selector->ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; - ps_func_selector->ihevc_memset_16bit_fptr = &ihevc_memset_16bit; - ps_func_selector->ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; - ps_func_selector->ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; - ps_func_selector->ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; - ps_func_selector->ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; - ps_func_selector->ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_ssse3; - ps_func_selector->ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_ssse3; - ps_func_selector->ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_ssse3; - ps_func_selector->ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_ssse3; - ps_func_selector->ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_ssse3; - ps_func_selector->ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_ssse3; - ps_func_selector->ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_ssse3; - ps_func_selector->ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_ssse3; - ps_func_selector->ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_ssse3; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; - ps_func_selector->ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; - ps_func_selector->ihevcd_fmt_conv_444sp_to_444p_fptr = &ihevcd_fmt_conv_444sp_to_444p; - ps_func_selector->ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_ssse3; - ps_func_selector->ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_ssse3; - ps_func_selector->ihevcd_itrans_res_dc_fptr = &ihevcd_itrans_res_dc; + codec_t *ps_codec = (codec_t *)pv_codec; + + ps_codec->s_func_selector.ihevc_deblk_chroma_horz_fptr = &ihevc_deblk_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_deblk_chroma_vert_fptr = &ihevc_deblk_chroma_vert_ssse3; + ps_codec->s_func_selector.ihevc_deblk_luma_vert_fptr = &ihevc_deblk_luma_vert_ssse3; + ps_codec->s_func_selector.ihevc_deblk_luma_horz_fptr = &ihevc_deblk_luma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_fptr = &ihevc_inter_pred_chroma_copy_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_copy_w16out_fptr = &ihevc_inter_pred_chroma_copy_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_fptr = &ihevc_inter_pred_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_horz_w16out_fptr = &ihevc_inter_pred_chroma_horz_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_fptr = &ihevc_inter_pred_chroma_vert_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_fptr = &ihevc_inter_pred_chroma_vert_w16inp_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16inp_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_chroma_vert_w16out_fptr = &ihevc_inter_pred_chroma_vert_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_fptr = &ihevc_inter_pred_luma_horz_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_fptr = &ihevc_inter_pred_luma_vert_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16out_fptr = &ihevc_inter_pred_luma_vert_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_fptr = &ihevc_inter_pred_luma_vert_w16inp_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_fptr = &ihevc_inter_pred_luma_copy_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_copy_w16out_fptr = &ihevc_inter_pred_luma_copy_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_horz_w16out_fptr = &ihevc_inter_pred_luma_horz_w16out_ssse3; + ps_codec->s_func_selector.ihevc_inter_pred_luma_vert_w16inp_w16out_fptr = &ihevc_inter_pred_luma_vert_w16inp_w16out_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ref_substitution_fptr = &ihevc_intra_pred_chroma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_substitution_fptr = &ihevc_intra_pred_luma_ref_substitution; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ref_subst_all_avlble_fptr = &ihevc_intra_pred_luma_ref_subst_all_avlble; + ps_codec->s_func_selector.ihevc_intra_pred_ref_filtering_fptr = &ihevc_intra_pred_ref_filtering_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_dc_fptr = &ihevc_intra_pred_chroma_dc_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_horz_fptr = &ihevc_intra_pred_chroma_horz_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode2_fptr = &ihevc_intra_pred_chroma_mode2_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_18_34_fptr = &ihevc_intra_pred_chroma_mode_18_34_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_27_to_33_fptr = &ihevc_intra_pred_chroma_mode_27_to_33_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_3_to_9_fptr = &ihevc_intra_pred_chroma_mode_3_to_9_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_planar_fptr = &ihevc_intra_pred_chroma_planar_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_ver_fptr = &ihevc_intra_pred_chroma_ver_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_11_to_17_fptr = &ihevc_intra_pred_chroma_mode_11_to_17_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_chroma_mode_19_to_25_fptr = &ihevc_intra_pred_chroma_mode_19_to_25_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_11_to_17_fptr = &ihevc_intra_pred_luma_mode_11_to_17_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_19_to_25_fptr = &ihevc_intra_pred_luma_mode_19_to_25_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_dc_fptr = &ihevc_intra_pred_luma_dc_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_horz_fptr = &ihevc_intra_pred_luma_horz_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode2_fptr = &ihevc_intra_pred_luma_mode2_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_18_34_fptr = &ihevc_intra_pred_luma_mode_18_34_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_27_to_33_fptr = &ihevc_intra_pred_luma_mode_27_to_33_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_mode_3_to_9_fptr = &ihevc_intra_pred_luma_mode_3_to_9_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_planar_fptr = &ihevc_intra_pred_luma_planar_ssse3; + ps_codec->s_func_selector.ihevc_intra_pred_luma_ver_fptr = &ihevc_intra_pred_luma_ver_ssse3; + ps_codec->s_func_selector.ihevc_itrans_4x4_ttype1_fptr = &ihevc_itrans_4x4_ttype1; + ps_codec->s_func_selector.ihevc_itrans_4x4_fptr = &ihevc_itrans_4x4; + ps_codec->s_func_selector.ihevc_itrans_8x8_fptr = &ihevc_itrans_8x8; + ps_codec->s_func_selector.ihevc_itrans_16x16_fptr = &ihevc_itrans_16x16; + ps_codec->s_func_selector.ihevc_itrans_32x32_fptr = &ihevc_itrans_32x32; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_ttype1_fptr = &ihevc_itrans_recon_4x4_ttype1_ssse3; + ps_codec->s_func_selector.ihevc_itrans_recon_4x4_fptr = &ihevc_itrans_recon_4x4_ssse3; + ps_codec->s_func_selector.ihevc_itrans_recon_8x8_fptr = &ihevc_itrans_recon_8x8_ssse3; + ps_codec->s_func_selector.ihevc_itrans_recon_16x16_fptr = &ihevc_itrans_recon_16x16_ssse3; + ps_codec->s_func_selector.ihevc_itrans_recon_32x32_fptr = &ihevc_itrans_recon_32x32_ssse3; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_4x4_fptr = &ihevc_chroma_itrans_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_8x8_fptr = &ihevc_chroma_itrans_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_itrans_recon_16x16_fptr = &ihevc_chroma_itrans_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_4x4_ttype1_fptr = &ihevc_recon_4x4_ttype1; + ps_codec->s_func_selector.ihevc_recon_4x4_fptr = &ihevc_recon_4x4; + ps_codec->s_func_selector.ihevc_recon_8x8_fptr = &ihevc_recon_8x8; + ps_codec->s_func_selector.ihevc_recon_16x16_fptr = &ihevc_recon_16x16; + ps_codec->s_func_selector.ihevc_recon_32x32_fptr = &ihevc_recon_32x32; + ps_codec->s_func_selector.ihevc_chroma_recon_4x4_fptr = &ihevc_chroma_recon_4x4; + ps_codec->s_func_selector.ihevc_chroma_recon_8x8_fptr = &ihevc_chroma_recon_8x8; + ps_codec->s_func_selector.ihevc_chroma_recon_16x16_fptr = &ihevc_chroma_recon_16x16; + ps_codec->s_func_selector.ihevc_memcpy_mul_8_fptr = &ihevc_memcpy_mul_8; + ps_codec->s_func_selector.ihevc_memcpy_fptr = &ihevc_memcpy; + ps_codec->s_func_selector.ihevc_memset_mul_8_fptr = &ihevc_memset_mul_8; + ps_codec->s_func_selector.ihevc_memset_fptr = &ihevc_memset; + ps_codec->s_func_selector.ihevc_memset_16bit_mul_8_fptr = &ihevc_memset_16bit_mul_8; + ps_codec->s_func_selector.ihevc_memset_16bit_fptr = &ihevc_memset_16bit; + ps_codec->s_func_selector.ihevc_pad_left_luma_fptr = &ihevc_pad_left_luma; + ps_codec->s_func_selector.ihevc_pad_left_chroma_fptr = &ihevc_pad_left_chroma; + ps_codec->s_func_selector.ihevc_pad_right_luma_fptr = &ihevc_pad_right_luma; + ps_codec->s_func_selector.ihevc_pad_right_chroma_fptr = &ihevc_pad_right_chroma; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_fptr = &ihevc_weighted_pred_bi_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_bi_default_fptr = &ihevc_weighted_pred_bi_default_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_uni_fptr = &ihevc_weighted_pred_uni_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_fptr = &ihevc_weighted_pred_chroma_bi_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_bi_default_fptr = &ihevc_weighted_pred_chroma_bi_default_ssse3; + ps_codec->s_func_selector.ihevc_weighted_pred_chroma_uni_fptr = &ihevc_weighted_pred_chroma_uni_ssse3; + ps_codec->s_func_selector.ihevc_sao_band_offset_luma_fptr = &ihevc_sao_band_offset_luma_ssse3; + ps_codec->s_func_selector.ihevc_sao_band_offset_chroma_fptr = &ihevc_sao_band_offset_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_fptr = &ihevc_sao_edge_offset_class0_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class0_chroma_fptr = &ihevc_sao_edge_offset_class0_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_fptr = &ihevc_sao_edge_offset_class1_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class1_chroma_fptr = &ihevc_sao_edge_offset_class1_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_fptr = &ihevc_sao_edge_offset_class2_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class2_chroma_fptr = &ihevc_sao_edge_offset_class2_chroma_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_fptr = &ihevc_sao_edge_offset_class3_ssse3; + ps_codec->s_func_selector.ihevc_sao_edge_offset_class3_chroma_fptr = &ihevc_sao_edge_offset_class3_chroma_ssse3; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgba8888_fptr = &ihevcd_fmt_conv_420sp_to_rgba8888; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_rgb565_fptr = &ihevcd_fmt_conv_420sp_to_rgb565; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420sp_fptr = &ihevcd_fmt_conv_420sp_to_420sp; + ps_codec->s_func_selector.ihevcd_fmt_conv_420sp_to_420p_fptr = &ihevcd_fmt_conv_420sp_to_420p; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_luma_fptr = &ihevcd_itrans_recon_dc_luma_ssse3; + ps_codec->s_func_selector.ihevcd_itrans_recon_dc_chroma_fptr = &ihevcd_itrans_recon_dc_chroma_ssse3; } diff --git a/encoder/ihevce_api.h b/encoder/ihevce_api.h index 6a55a1d..b1f3640 100644 --- a/encoder/ihevce_api.h +++ b/encoder/ihevce_api.h @@ -76,10 +76,12 @@ /* Maximum number of processor groups supported */ #define MAX_NUMBER_PROC_GRPS 4 +#ifndef DISABLE_SEI /** @brief maximum length of CC User Data in a single frame */ #define MAX_SEI_PAYLOAD_PER_TLV (0x200) #define MAX_NUMBER_OF_SEI_PAYLOAD (10) +#endif #define IHEVCE_COMMANDS_TAG_MASK (0x0000FFFF) @@ -179,8 +181,10 @@ typedef enum IHEVCE_SYNCH_API_END_TAG = 0xFFFF, IHEVCE_SYNCH_API_FLUSH_TAG = 0x21, IHEVCE_SYNCH_API_FORCE_IDR_TAG = 0x22, +#ifndef DISABLE_SEI IHEVCE_SYNCH_API_REG_KEYFRAME_SEI_TAG = 0x23, IHEVCE_SYNCH_API_REG_ALLFRAME_SEI_TAG = 0x24, +#endif IHEVCE_SYNCH_API_SET_RES_TAG = 0x25 } IHEVCE_SYNCH_API_COMMAND_TAG_T; @@ -192,7 +196,9 @@ typedef enum IHEVCE_SYNCH_ERR_NO_PADDING = IHEVCE_SYNCH_ERROR_START + 0x14, IHEVCE_SYNCH_ERR_WRONG_LENGTH = IHEVCE_SYNCH_ERROR_START + 0x15, IHEVCE_SYNCH_ERR_FREQ_FORCE_IDR_RECEIVED = IHEVCE_SYNCH_ERROR_START + 0x16, +#ifndef DISABLE_SEI IHEVCE_SYNCH_ERR_TOO_MANY_SEI_MSG = IHEVCE_SYNCH_ERROR_START + 0x17, +#endif IHEVCE_SYNCH_ERR_SET_RES_NOT_SUPPORTED = IHEVCE_SYNCH_ERROR_START + 0x18 } IHEVCE_SYNCH_ERROR_TAG_T; @@ -437,6 +443,7 @@ typedef struct /** Enable VUI output 1: enable 0 : disable */ WORD32 i4_vui_enable; +#ifndef DISABLE_SEI /** Enable specific SEI messages in the stream * 1: enable 0 : disable */ @@ -466,6 +473,7 @@ typedef struct * 1: enable 0 : disable */ WORD32 i4_sei_mastering_disp_colour_vol_flags; +#endif /** * Array to store the display_primaries_x values @@ -497,6 +505,7 @@ typedef struct */ UWORD32 u4_min_display_mastering_luminance; +#ifndef DISABLE_SEI /** * Enable Content Level Light Info */ @@ -516,6 +525,7 @@ typedef struct * 3 : Checksum, 2 : CRC, 1 : MD5, 0 : disable */ WORD32 i4_decoded_pic_hash_sei_flag; +#endif /** Enable specific AUD messages in the stream * 1: enable 0 : disable diff --git a/encoder/ihevce_enc_loop_utils.c b/encoder/ihevce_enc_loop_utils.c index 6da2c97..4665cd0 100644 --- a/encoder/ihevce_enc_loop_utils.c +++ b/encoder/ihevce_enc_loop_utils.c @@ -6244,8 +6244,7 @@ UWORD8 ihevce_distortion_based_intra_chroma_mode_selector( u1_trans_size, nbr_flags, pu1_ref_sub_out, - 1, - CHROMA_FMT_IDC_YUV420); + 1); /* use the look up to get the function idx */ chrm_pred_func_idx = g_i4_ip_funcs[u1_chrm_mode]; @@ -6637,8 +6636,7 @@ void ihevce_intra_chroma_pred_mode_selector( trans_size, nbr_flags, (UWORD8 *)ps_ctxt->pv_ref_sub_out, - 1, - CHROMA_FMT_IDC_YUV420); + 1); /* use the look up to get the function idx */ chrm_pred_func_idx = g_i4_ip_funcs[best_chrm_mode]; @@ -7398,8 +7396,7 @@ LWORD64 ihevce_chroma_cu_prcs_rdopt( trans_size, nbr_flags, (UWORD8 *)ps_ctxt->pv_ref_sub_out, - 1, - CHROMA_FMT_IDC_YUV420); + 1); /* use the look up to get the function idx */ chrm_pred_func_idx = g_i4_ip_funcs[chrm_pred_mode]; @@ -9421,8 +9418,7 @@ void ihevce_final_rdopt_mode_prcs( chroma_trans_size, nbr_flags, (UWORD8 *)ps_ctxt->pv_ref_sub_out, - 1, - CHROMA_FMT_IDC_YUV420); + 1); /* use the look up to get the function idx */ chrm_pred_func_idx = g_i4_ip_funcs[chroma_pred_mode]; diff --git a/encoder/ihevce_error_check.c b/encoder/ihevce_error_check.c index fbdfd9e..c1fb1b9 100644 --- a/encoder/ihevce_error_check.c +++ b/encoder/ihevce_error_check.c @@ -360,6 +360,7 @@ WORD32 ihevce_hle_validate_static_params(ihevce_static_cfg_params_t *ps_static_c PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : u2_sei_max_cll %d \n", ps_static_cfg_prms->s_out_strm_prms.u2_sei_max_cll); PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : i4_sei_recovery_point_flags %d \n", ps_static_cfg_prms->s_out_strm_prms.i4_sei_recovery_point_flags); PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : i4_sei_mastering_disp_colour_vol_flags %d \n", ps_static_cfg_prms->s_out_strm_prms.i4_sei_mastering_disp_colour_vol_flags); +#endif for(i4_i = 0; i4_i < 3; i4_i++) PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : u2_display_primaries_x[i4_i] %d \n", ps_static_cfg_prms->s_out_strm_prms.au2_display_primaries_x[i4_i]); for(i4_i = 0; i4_i < 3; i4_i++) @@ -368,6 +369,7 @@ WORD32 ihevce_hle_validate_static_params(ihevce_static_cfg_params_t *ps_static_c PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : u2_white_point_y %d \n", ps_static_cfg_prms->s_out_strm_prms.u2_white_point_y); PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : u4_max_display_mastering_luminance %d \n", ps_static_cfg_prms->s_out_strm_prms.u4_max_display_mastering_luminance); PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : u4_min_display_mastering_luminance %d \n", ps_static_cfg_prms->s_out_strm_prms.u4_min_display_mastering_luminance); +#ifndef DISABLE_SEI PRINTF(ps_sys_api->pv_cb_handle, i4_res_id, i4_br_id, "IHEVCE : i4_sei_hash_flags %d \n", ps_static_cfg_prms->s_out_strm_prms.i4_decoded_pic_hash_sei_flag); #endif @@ -712,6 +714,8 @@ WORD32 ihevce_hle_validate_static_params(ihevce_static_cfg_params_t *ps_static_c } { + WORD32 sub_gop_size = (1 << ps_static_cfg_prms->s_coding_tools_prms.i4_max_temporal_layers) + << ps_static_cfg_prms->s_src_prms.i4_field_pic; WORD32 i4_max_idr_period, i4_min_idr_period, i4_max_cra_period, i4_max_i_period; WORD32 i4_max_i_distance; WORD32 i4_min_i_distance = 0, i4_non_zero_idr_period = 0x7FFFFFFF, @@ -721,12 +725,6 @@ WORD32 ihevce_hle_validate_static_params(ihevce_static_cfg_params_t *ps_static_c i4_max_cra_period = ps_static_cfg_prms->s_coding_tools_prms.i4_max_cra_open_gop_period; i4_max_i_period = ps_static_cfg_prms->s_coding_tools_prms.i4_max_i_open_gop_period; i4_max_i_distance = MAX(MAX(i4_max_idr_period, i4_max_cra_period), i4_max_i_period); - WORD32 num_b_frms = - (1 << ps_static_cfg_prms->s_coding_tools_prms.i4_max_temporal_layers) - 1; - if (i4_max_i_distance <= num_b_frms) - ps_static_cfg_prms->s_coding_tools_prms.i4_max_temporal_layers = 0; - WORD32 sub_gop_size = (1 << ps_static_cfg_prms->s_coding_tools_prms.i4_max_temporal_layers) - << ps_static_cfg_prms->s_src_prms.i4_field_pic; if(sub_gop_size > 1) { diff --git a/encoder/ihevce_hle_interface.c b/encoder/ihevce_hle_interface.c index 5f6065c..1936efc 100644 --- a/encoder/ihevce_hle_interface.c +++ b/encoder/ihevce_hle_interface.c @@ -521,9 +521,6 @@ IV_API_CALL_STATUS_T ihevce_query_io_buf_req( ps_input_bufs_req->i4_min_size_asynch_ctrl_bufs = ((MAX_SEI_PAYLOAD_PER_TLV + 16) * (MAX_NUMBER_OF_SEI_PAYLOAD - 6)) + 16; -#else - ps_input_bufs_req->i4_min_size_synch_ctrl_bufs = 16; - ps_input_bufs_req->i4_min_size_asynch_ctrl_bufs = 16; #endif for(i4_resolution_id_ctr = 0; i4_resolution_id_ctr < i4_num_resolutions; i4_resolution_id_ctr++) diff --git a/encoder/libhevcenc.cmake b/encoder/libhevcenc.cmake index 850b90e..2a0cc59 100644 --- a/encoder/libhevcenc.cmake +++ b/encoder/libhevcenc.cmake @@ -95,9 +95,7 @@ list( include_directories(${HEVC_ROOT}/encoder) # arm/x86 sources -if("${SYSTEM_NAME}" STREQUAL "Darwin") - message("Assembly optimizations not supported for MacOS") -elseif("${SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${SYSTEM_PROCESSOR}" +if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch32") list( APPEND diff --git a/encoder/osal_semaphore.c b/encoder/osal_semaphore.c index 46a7e26..9875159 100644 --- a/encoder/osal_semaphore.c +++ b/encoder/osal_semaphore.c @@ -49,10 +49,6 @@ /* System include files */ #include -#ifdef DARWIN -#include -#include -#endif #include #include @@ -123,25 +119,6 @@ void *osal_sem_create(IN void *osal_handle, IN osal_sem_attr_t *attr) sem_handle->hdl = handle; /* Create a sempahore */ -#ifdef DARWIN - static int sem_counter = 0; - char sem_name[32]; - snprintf(sem_name, sizeof(sem_name), "/osal_sem_%d", sem_counter++); - - sem_t *sem = sem_open(sem_name, O_CREAT, 0644, attr->value); - if(sem == SEM_FAILED){ - handle->free(sem_handle->mmr_handle, sem_handle); - return 0; - } - sem_handle->sem_handle = sem; - sem_handle->sem_name = strdup(sem_name); - if(sem_handle->sem_name == NULL){ - sem_close(sem); - sem_unlink(sem_name); - handle->free(sem_handle->mmr_handle, sem_handle); - return 0; - } -#else if(-1 == sem_init( &(sem_handle->sem_handle), /* Semaphore handle */ 0, /* Shared only between threads */ @@ -150,7 +127,6 @@ void *osal_sem_create(IN void *osal_handle, IN osal_sem_attr_t *attr) handle->free(sem_handle->mmr_handle, sem_handle); return 0; } -#endif return sem_handle; } @@ -195,20 +171,11 @@ WORD32 osal_sem_destroy(IN void *sem_handle) return OSAL_ERROR; /* Destroy the semaphore */ -#ifdef DARWIN - if(0 == sem_close(handle->sem_handle) && 0 == sem_unlink(handle->sem_name)) - { - free(handle->sem_name); - handle->hdl->free(handle->mmr_handle, handle); - return OSAL_SUCCESS; - } -#else if(0 == sem_destroy(&(handle->sem_handle))) { handle->hdl->free(handle->mmr_handle, handle); return OSAL_SUCCESS; } -#endif return OSAL_ERROR; } @@ -252,11 +219,7 @@ WORD32 osal_sem_wait(IN void *sem_handle) sem_handle_t *handle = (sem_handle_t *)sem_handle; /* Wait on Semaphore object infinitly */ -#ifdef DARWIN - return sem_wait(handle->sem_handle); -#else return sem_wait(&(handle->sem_handle)); -#endif } } @@ -295,11 +258,7 @@ WORD32 osal_sem_post(IN void *sem_handle) sem_handle_t *handle = (sem_handle_t *)sem_handle; /* Semaphore Post */ -#ifdef DARWIN - return sem_post(handle->sem_handle); -#else return sem_post(&(handle->sem_handle)); -#endif } } @@ -338,13 +297,8 @@ WORD32 osal_sem_count(IN void *sem_handle, OUT WORD32 *count) { sem_handle_t *handle = (sem_handle_t *)sem_handle; -#ifdef DARWIN - if(-1 == sem_getvalue(handle->sem_handle, count)) - return OSAL_ERROR; -#else if(-1 == sem_getvalue(&(handle->sem_handle), count)) return OSAL_ERROR; -#endif return OSAL_SUCCESS; } diff --git a/encoder/osal_semaphore.h b/encoder/osal_semaphore.h index 3421ece..e42b9fa 100644 --- a/encoder/osal_semaphore.h +++ b/encoder/osal_semaphore.h @@ -56,12 +56,7 @@ /* typedef integer. */ typedef struct { -#ifdef DARWIN - sem_t *sem_handle; /* Semaphore handle */ - char *sem_name; /* Semaphore name */ -#else sem_t sem_handle; /* Semaphore handle */ -#endif void *mmr_handle; /* Pointer to memory manager handle */ osal_t *hdl; /* Associated OSAL handle */ diff --git a/encoder/osal_thread.c b/encoder/osal_thread.c index 9fe2a41..76b4495 100644 --- a/encoder/osal_thread.c +++ b/encoder/osal_thread.c @@ -66,9 +66,7 @@ #include #include #include /*for CPU_SET, etc.. */ -#ifndef DARWIN -#include -#endif +#include #include /* User include files */ @@ -298,19 +296,14 @@ WORD32 osal_thread_sleep(IN UWORD32 milli_seconds) timer.tv_sec = milli_seconds / 1000; milli_seconds -= (timer.tv_sec * 1000); timer.tv_nsec = milli_seconds * MEGA_CONST; -#ifdef DARWIN - if(0 == nanosleep(&timer, NULL)) - { - return OSAL_SUCCESS; - } -#else + /* Using Monotonic clock to sleep, also flag is set to 0 for relative */ /* time to current clock time */ if(0 == clock_nanosleep(CLOCK_MONOTONIC, 0, &timer, NULL)) { return OSAL_SUCCESS; } -#endif + return OSAL_ERROR; } } @@ -710,11 +703,5 @@ void osal_print_last_error(IN const STRWORD8 *string) WORD32 osal_get_current_tid(void) { -#ifdef DARWIN - uint64_t tid; - pthread_threadid_np(NULL, &tid); - return tid; -#else return syscall(__NR_gettid); -#endif } diff --git a/fuzzer/hevc_dec_fuzzer.cmake b/fuzzer/hevc_dec_fuzzer.cmake index 43c5c9d..28e89fd 100644 --- a/fuzzer/hevc_dec_fuzzer.cmake +++ b/fuzzer/hevc_dec_fuzzer.cmake @@ -1,4 +1,2 @@ -if(NOT "${SYSTEM_NAME}" STREQUAL "Darwin") - libhevc_add_fuzzer(hevc_dec_fuzzer libhevcdec SOURCES - ${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cpp) -endif() \ No newline at end of file +libhevc_add_fuzzer(hevc_dec_fuzzer libhevcdec SOURCES + ${HEVC_ROOT}/fuzzer/hevc_dec_fuzzer.cpp) diff --git a/fuzzer/hevc_dec_fuzzer.cpp b/fuzzer/hevc_dec_fuzzer.cpp index 3c55b1e..be3a054 100644 --- a/fuzzer/hevc_dec_fuzzer.cpp +++ b/fuzzer/hevc_dec_fuzzer.cpp @@ -32,15 +32,11 @@ #include "iv.h" #include "ivd.h" -#include "fuzzer/FuzzedDataProvider.h" - #define NELEMENTS(x) (sizeof(x) / sizeof(x[0])) #define ivd_api_function ihevcd_cxa_api_function const IV_COLOR_FORMAT_T supportedColorFormats[] = { IV_YUV_420P, IV_YUV_420SP_UV, IV_YUV_420SP_VU, - IV_GRAY}; - -const uint32_t enableYuvFormatBitFields[] = {0, 1, 2, 3}; + IV_YUV_422ILE, IV_RGB_565, IV_RGBA_8888}; /* Decoder ignores invalid arch, i.e. for arm build, if SSSE3 is requested, * decoder defaults to a supported configuration. So same set of supported @@ -49,10 +45,17 @@ const IVD_ARCH_T supportedArchitectures[] = { ARCH_ARM_NONEON, ARCH_ARM_A9Q, ARCH_ARM_NEONINTR, ARCH_ARMV8_GENERIC, ARCH_X86_GENERIC, ARCH_X86_SSSE3, ARCH_X86_SSE42}; +enum { + OFFSET_COLOR_FORMAT = 6, + OFFSET_NUM_CORES, + OFFSET_ARCH, + /* Should be the last entry */ + OFFSET_MAX, +}; + const static int kMaxNumDecodeCalls = 100; const static int kSupportedColorFormats = NELEMENTS(supportedColorFormats); const static int kSupportedArchitectures = NELEMENTS(supportedArchitectures); -const static int kEnableYuvFormatBitFields = NELEMENTS(enableYuvFormatBitFields); const static int kMaxCores = 4; void *iv_aligned_malloc(void *ctxt, WORD32 alignment, WORD32 size) { void *buf = NULL; @@ -70,32 +73,33 @@ void iv_aligned_free(void *ctxt, void *buf) { class Codec { public: - Codec(FuzzedDataProvider &fdp); + Codec(IV_COLOR_FORMAT_T colorFormat, size_t numCores); ~Codec(); - void createCodec(FuzzedDataProvider &fdp); + void createCodec(); void deleteCodec(); void resetCodec(); - void setCores(FuzzedDataProvider &fdp); + void setCores(); void allocFrame(); void freeFrame(); void decodeHeader(const uint8_t *data, size_t size); IV_API_CALL_STATUS_T decodeFrame(const uint8_t *data, size_t size, size_t *bytesConsumed); void setParams(IVD_VIDEO_DECODE_MODE_T mode); - void setArchitecture(FuzzedDataProvider &fdp); + void setArchitecture(IVD_ARCH_T arch); private: IV_COLOR_FORMAT_T mColorFormat; + size_t mNumCores; iv_obj_t *mCodec; ivd_out_bufdesc_t mOutBufHandle; uint32_t mWidth; uint32_t mHeight; }; -Codec::Codec(FuzzedDataProvider &fdp) { - mColorFormat = - (IV_COLOR_FORMAT_T)fdp.PickValueInArray(supportedColorFormats); +Codec::Codec(IV_COLOR_FORMAT_T colorFormat, size_t numCores) { + mColorFormat = colorFormat; + mNumCores = numCores; mCodec = nullptr; mWidth = 0; mHeight = 0; @@ -105,7 +109,7 @@ Codec::Codec(FuzzedDataProvider &fdp) { Codec::~Codec() {} -void Codec::createCodec(FuzzedDataProvider &fdp) { +void Codec::createCodec() { IV_API_CALL_STATUS_T ret; ihevcd_cxa_create_ip_t create_ip{}; ihevcd_cxa_create_op_t create_op{}; @@ -119,7 +123,6 @@ void Codec::createCodec(FuzzedDataProvider &fdp) { create_ip.s_ivd_create_ip_t.pf_aligned_free = iv_aligned_free; create_ip.s_ivd_create_ip_t.pv_mem_ctxt = NULL; create_ip.s_ivd_create_ip_t.u4_size = sizeof(ihevcd_cxa_create_ip_t); - create_ip.u4_enable_yuv_formats = fdp.PickValueInArray(enableYuvFormatBitFields); create_op.s_ivd_create_op_t.u4_size = sizeof(ihevcd_cxa_create_op_t); ret = ivd_api_function(NULL, (void *)&create_ip, (void *)&create_op); @@ -154,13 +157,14 @@ void Codec::resetCodec() { ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op); } -void Codec::setCores(FuzzedDataProvider &fdp) { +void Codec::setCores() { ihevcd_cxa_ctl_set_num_cores_ip_t s_ctl_ip{}; ihevcd_cxa_ctl_set_num_cores_op_t s_ctl_op{}; + s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL; s_ctl_ip.e_sub_cmd = (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_NUM_CORES; - s_ctl_ip.u4_num_cores = (fdp.ConsumeIntegral() % kMaxCores) + 1; + s_ctl_ip.u4_num_cores = mNumCores; s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_ip_t); s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_num_cores_op_t); @@ -183,13 +187,14 @@ void Codec::setParams(IVD_VIDEO_DECODE_MODE_T mode) { ivd_api_function(mCodec, (void *)&s_ctl_ip, (void *)&s_ctl_op); } -void Codec::setArchitecture(FuzzedDataProvider &fdp) { +void Codec::setArchitecture(IVD_ARCH_T arch) { ihevcd_cxa_ctl_set_processor_ip_t s_ctl_ip{}; ihevcd_cxa_ctl_set_processor_op_t s_ctl_op{}; + s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL; s_ctl_ip.e_sub_cmd = (IVD_CONTROL_API_COMMAND_TYPE_T)IHEVCD_CXA_CMD_CTL_SET_PROCESSOR; - s_ctl_ip.u4_arch = (IVD_ARCH_T)fdp.PickValueInArray(supportedArchitectures); + s_ctl_ip.u4_arch = arch; s_ctl_ip.u4_soc = SOC_GENERIC; s_ctl_ip.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_ip_t); s_ctl_op.u4_size = sizeof(ihevcd_cxa_ctl_set_processor_op_t); @@ -221,8 +226,16 @@ void Codec::allocFrame() { sizes[1] = mWidth * mHeight >> 1; num_bufs = 2; break; - case IV_GRAY: - sizes[0] = mWidth * mHeight; + case IV_YUV_422ILE: + sizes[0] = mWidth * mHeight * 2; + num_bufs = 1; + break; + case IV_RGB_565: + sizes[0] = mWidth * mHeight * 2; + num_bufs = 1; + break; + case IV_RGBA_8888: + sizes[0] = mWidth * mHeight * 4; num_bufs = 1; break; case IV_YUV_420P: @@ -334,13 +347,20 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { if (size < 1) { return 0; } - FuzzedDataProvider fdp(data, size); - + size_t colorFormatOfst = std::min((size_t)OFFSET_COLOR_FORMAT, size - 1); + size_t numCoresOfst = std::min((size_t)OFFSET_NUM_CORES, size - 1); + size_t architectureOfst = std::min((size_t)OFFSET_ARCH, size - 1); + size_t architectureIdx = data[architectureOfst] % kSupportedArchitectures; + IVD_ARCH_T arch = (IVD_ARCH_T)supportedArchitectures[architectureIdx]; + size_t colorFormatIdx = data[colorFormatOfst] % kSupportedColorFormats; + IV_COLOR_FORMAT_T colorFormat = + (IV_COLOR_FORMAT_T)(supportedColorFormats[colorFormatIdx]); + uint32_t numCores = (data[numCoresOfst] % kMaxCores) + 1; size_t numDecodeCalls = 0; - Codec *codec = new Codec(fdp); - codec->createCodec(fdp); - codec->setArchitecture(fdp); - codec->setCores(fdp); + Codec *codec = new Codec(colorFormat, numCores); + codec->createCodec(); + codec->setArchitecture(arch); + codec->setCores(); codec->decodeHeader(data, size); codec->setParams(IVD_DECODE_FRAME); codec->allocFrame(); diff --git a/fuzzer/hevc_enc_fuzzer.cmake b/fuzzer/hevc_enc_fuzzer.cmake index 29371bd..908b2f1 100644 --- a/fuzzer/hevc_enc_fuzzer.cmake +++ b/fuzzer/hevc_enc_fuzzer.cmake @@ -1,4 +1,2 @@ -if(NOT "${SYSTEM_NAME}" STREQUAL "Darwin") - libhevc_add_fuzzer(hevc_enc_fuzzer libhevcenc SOURCES - ${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cpp) -endif() \ No newline at end of file +libhevc_add_fuzzer(hevc_enc_fuzzer libhevcenc SOURCES + ${HEVC_ROOT}/fuzzer/hevc_enc_fuzzer.cpp) diff --git a/fuzzer/hevc_enc_fuzzer.cpp b/fuzzer/hevc_enc_fuzzer.cpp index 0c8e69f..a4308a7 100644 --- a/fuzzer/hevc_enc_fuzzer.cpp +++ b/fuzzer/hevc_enc_fuzzer.cpp @@ -18,7 +18,6 @@ * Originally developed and contributed by Ittiam Systems Pvt. Ltd, Bangalore */ #include -#include #include #include @@ -65,7 +64,9 @@ enum { IDX_MAX_CRA_OPEN_GOP, IDX_ENABLE_SPS_AT_CDR, IDX_ENABLE_VUI, +#ifndef DISABLE_SEI IDX_ENABLE_SEI, +#endif IDX_ARCH_TYPE, IDX_ENABLE_FORCE_IDR, IDX_ENABLE_DYNAMIC_BITRATE, @@ -133,8 +134,10 @@ bool Codec::initEncoder(const uint8_t *data) { mEncParams.s_out_strm_prms.i4_sps_at_cdr_enable = data[IDX_ENABLE_SPS_AT_CDR] & 0x01; mEncParams.s_out_strm_prms.i4_vui_enable = data[IDX_ENABLE_VUI] & 0x01; +#ifndef DISABLE_SEI mEncParams.s_out_strm_prms.i4_sei_enable_flag = data[IDX_ENABLE_SEI] & 0x01; +#endif mEncParams.e_arch_type = ((data[IDX_ARCH_TYPE] & 0x03) == 0x00) ? ARCH_ARM_NONEON : ARCH_NA; mIsForceIdrEnabled = data[IDX_ENABLE_FORCE_IDR] & 0x01; mIsDynamicBitrateChangeEnabled = data[IDX_ENABLE_DYNAMIC_BITRATE] & 0x01; diff --git a/test/decoder/main.c b/test/decoder/main.c index ce93527..3325188 100644 --- a/test/decoder/main.c +++ b/test/decoder/main.c @@ -50,7 +50,6 @@ #include "iv.h" #include "ivd.h" -#include "ihevc_defs.h" #include "ihevcd_cxa.h" #include "ithread.h" @@ -228,9 +227,6 @@ typedef struct WORD32 quit; WORD32 paused; - /* Enable YUV formats */ - UWORD32 u4_enable_yuv_formats; - /* Active threads present*/ UWORD32 i4_active_threads; @@ -285,7 +281,6 @@ typedef enum PICLEN, PICLEN_FILE, - ENABLE_YUV_FORMAT, KEEP_THREADS_ACTIVE, }ARGUMENT_T; @@ -327,7 +322,7 @@ static const argument_t argument_mapping[] = { "--", "--save_chksum", SAVE_CHKSUM, "Save Check sum file\n" }, { "--", "--chroma_format", CHROMA_FORMAT, - "Output Chroma format Supported values YUV_420P, YUV_420SP_UV, YUV_420SP_VU, GRAY, YUV_444P\n" }, + "Output Chroma format Supported values YUV_420P, YUV_422ILE, RGB_565, YUV_420SP_UV, YUV_420SP_VU\n" }, { "-n", "--num_frames", NUM_FRAMES, "Number of frames to be decoded\n" }, { "--", "--num_cores", NUM_CORES, @@ -352,8 +347,6 @@ static const argument_t argument_mapping[] = "Set Architecture. Supported values ARM_NONEON, ARM_A9Q, ARM_A7, ARM_A5, ARM_NEONINTR, X86_GENERIC, X86_SSSE3, X86_SSE4 \n" }, { "--", "--soc", SOC, "Set SOC. Supported values GENERIC, HISI_37X \n" }, - { "--", "--enable_yuv_format", ENABLE_YUV_FORMAT, - "Enable specific YUV formats" }, {"--", "--keep_threads_active", KEEP_THREADS_ACTIVE, "Keep threads active"}, }; @@ -972,10 +965,7 @@ void dump_output(vid_dec_ctx_t *ps_app_ctx, if(NULL == s_dump_disp_frm_buf.pv_y_buf) return; - if(ps_app_ctx->e_output_chroma_format == IV_YUV_420P - || ps_app_ctx->e_output_chroma_format == IV_YUV_444P - || ps_app_ctx->e_output_chroma_format == IV_YUV_422P - || ps_app_ctx->e_output_chroma_format == IV_GRAY) + if(ps_app_ctx->e_output_chroma_format == IV_YUV_420P) { #if DUMP_SINGLE_BUF { @@ -997,20 +987,17 @@ void dump_output(vid_dec_ctx_t *ps_app_ctx, buf += s_dump_disp_frm_buf.u4_y_strd; } - if(ps_app_ctx->e_output_chroma_format != IV_GRAY) + buf = (UWORD8 *)s_dump_disp_frm_buf.pv_u_buf; + for(i = 0; i < s_dump_disp_frm_buf.u4_u_ht; i++) { - buf = (UWORD8*)s_dump_disp_frm_buf.pv_u_buf; - for(i = 0; i < s_dump_disp_frm_buf.u4_u_ht; i++) - { - fwrite(buf, 1, s_dump_disp_frm_buf.u4_u_wd, ps_op_file); - buf += s_dump_disp_frm_buf.u4_u_strd; - } - buf = (UWORD8*)s_dump_disp_frm_buf.pv_v_buf; - for(i = 0; i < s_dump_disp_frm_buf.u4_v_ht; i++) - { - fwrite(buf, 1, s_dump_disp_frm_buf.u4_v_wd, ps_op_file); - buf += s_dump_disp_frm_buf.u4_v_strd; - } + fwrite(buf, 1, s_dump_disp_frm_buf.u4_u_wd, ps_op_file); + buf += s_dump_disp_frm_buf.u4_u_strd; + } + buf = (UWORD8 *)s_dump_disp_frm_buf.pv_v_buf; + for(i = 0; i < s_dump_disp_frm_buf.u4_v_ht; i++) + { + fwrite(buf, 1, s_dump_disp_frm_buf.u4_v_wd, ps_op_file); + buf += s_dump_disp_frm_buf.u4_v_strd; } } @@ -1018,30 +1005,27 @@ void dump_output(vid_dec_ctx_t *ps_app_ctx, if(0 != chksum_save) { UWORD8 au1_y_chksum[16]; + UWORD8 au1_u_chksum[16]; + UWORD8 au1_v_chksum[16]; calc_md5_cksum((UWORD8 *)s_dump_disp_frm_buf.pv_y_buf, s_dump_disp_frm_buf.u4_y_strd, s_dump_disp_frm_buf.u4_y_wd, s_dump_disp_frm_buf.u4_y_ht, au1_y_chksum); - fwrite(au1_y_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); + calc_md5_cksum((UWORD8 *)s_dump_disp_frm_buf.pv_u_buf, + s_dump_disp_frm_buf.u4_u_strd, + s_dump_disp_frm_buf.u4_u_wd, + s_dump_disp_frm_buf.u4_u_ht, + au1_u_chksum); + calc_md5_cksum((UWORD8 *)s_dump_disp_frm_buf.pv_v_buf, + s_dump_disp_frm_buf.u4_v_strd, + s_dump_disp_frm_buf.u4_v_wd, + s_dump_disp_frm_buf.u4_v_ht, + au1_v_chksum); - if(ps_app_ctx->e_output_chroma_format != IV_GRAY) - { - UWORD8 au1_u_chksum[16]; - UWORD8 au1_v_chksum[16]; - calc_md5_cksum((UWORD8 *)s_dump_disp_frm_buf.pv_u_buf, - s_dump_disp_frm_buf.u4_u_strd, - s_dump_disp_frm_buf.u4_u_wd, - s_dump_disp_frm_buf.u4_u_ht, - au1_u_chksum); - calc_md5_cksum((UWORD8 *)s_dump_disp_frm_buf.pv_v_buf, - s_dump_disp_frm_buf.u4_v_strd, - s_dump_disp_frm_buf.u4_v_wd, - s_dump_disp_frm_buf.u4_v_ht, - au1_v_chksum); - fwrite(au1_u_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); - fwrite(au1_v_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); - } + fwrite(au1_y_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); + fwrite(au1_u_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); + fwrite(au1_v_chksum, sizeof(UWORD8), 16, ps_op_chksum_file); } #endif } @@ -1076,6 +1060,28 @@ void dump_output(vid_dec_ctx_t *ps_app_ctx, } #endif } + else if(ps_app_ctx->e_output_chroma_format == IV_RGBA_8888) + { + UWORD8 *buf; + + buf = (UWORD8 *)s_dump_disp_frm_buf.pv_y_buf; + for(i = 0; i < s_dump_disp_frm_buf.u4_y_ht; i++) + { + fwrite(buf, 1, s_dump_disp_frm_buf.u4_y_wd * 4, ps_op_file); + buf += s_dump_disp_frm_buf.u4_y_strd * 4; + } + } + else + { + UWORD8 *buf; + + buf = (UWORD8 *)s_dump_disp_frm_buf.pv_y_buf; + for(i = 0; i < s_dump_disp_frm_buf.u4_y_ht; i++) + { + fwrite(buf, 1, s_dump_disp_frm_buf.u4_y_strd * 2, ps_op_file); + buf += s_dump_disp_frm_buf.u4_y_strd * 2; + } + } fflush(ps_op_file); fflush(ps_op_chksum_file); @@ -1187,6 +1193,7 @@ ARGUMENT_T get_argument(CHAR *name) void parse_argument(vid_dec_ctx_t *ps_app_ctx, CHAR *argument, CHAR *value) { ARGUMENT_T arg; + arg = get_argument(argument); switch(arg) { @@ -1231,16 +1238,16 @@ void parse_argument(vid_dec_ctx_t *ps_app_ctx, CHAR *argument, CHAR *value) case CHROMA_FORMAT: if((strcmp(value, "YUV_420P")) == 0) ps_app_ctx->e_output_chroma_format = IV_YUV_420P; - else if((strcmp(value, "YUV_444P")) == 0) - ps_app_ctx->e_output_chroma_format = IV_YUV_444P; + else if((strcmp(value, "YUV_422ILE")) == 0) + ps_app_ctx->e_output_chroma_format = IV_YUV_422ILE; + else if((strcmp(value, "RGB_565")) == 0) + ps_app_ctx->e_output_chroma_format = IV_RGB_565; + else if((strcmp(value, "RGBA_8888")) == 0) + ps_app_ctx->e_output_chroma_format = IV_RGBA_8888; else if((strcmp(value, "YUV_420SP_UV")) == 0) ps_app_ctx->e_output_chroma_format = IV_YUV_420SP_UV; else if((strcmp(value, "YUV_420SP_VU")) == 0) ps_app_ctx->e_output_chroma_format = IV_YUV_420SP_VU; - else if((strcmp(value, "GRAY")) == 0) - ps_app_ctx->e_output_chroma_format = IV_GRAY; - else if((strcmp(value, "YUV_422P")) == 0) - ps_app_ctx->e_output_chroma_format = IV_YUV_422P; else { printf("\nInvalid colour format setting it to IV_YUV_420P\n"); @@ -1336,10 +1343,6 @@ void parse_argument(vid_dec_ctx_t *ps_app_ctx, CHAR *argument, CHAR *value) sscanf(value, "%s", ps_app_ctx->ac_piclen_fname); break; - case ENABLE_YUV_FORMAT: - sscanf(value, "%d", &ps_app_ctx->u4_enable_yuv_formats); - break; - case KEEP_THREADS_ACTIVE: sscanf(value, "%d", &ps_app_ctx->i4_active_threads); break; @@ -1392,7 +1395,7 @@ void read_cfg_file(vid_dec_ctx_t *ps_app_ctx, FILE *fp_cfg_file) argument[0] = '\0'; /* Reading Input File Name */ sscanf(line, "%s %s %s", argument, value, description); - if(argument[0] == '\0' || argument[0] == '#') + if(argument[0] == '\0') continue; parse_argument(ps_app_ctx, argument, value); @@ -2167,7 +2170,6 @@ int main(WORD32 argc, CHAR *argv[]) s_create_ip.s_ivd_create_ip_t.u4_size = sizeof(ihevcd_cxa_create_ip_t); s_create_op.s_ivd_create_op_t.u4_size = sizeof(ihevcd_cxa_create_op_t); s_create_ip.u4_enable_frame_info = s_app_ctx.u4_frame_info_enable; - s_create_ip.u4_enable_yuv_formats = s_app_ctx.u4_enable_yuv_formats; s_create_ip.u4_keep_threads_active = s_app_ctx.i4_active_threads; @@ -2417,23 +2419,23 @@ int main(WORD32 argc, CHAR *argv[]) s_ctl_op.u4_min_out_buf_size[2] = 0; break; } - case IV_YUV_422P: + case IV_YUV_422ILE: { - s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT; - s_ctl_op.u4_min_out_buf_size[1] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT >> 1; - s_ctl_op.u4_min_out_buf_size[2] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT >> 1; + s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT * 2; + s_ctl_op.u4_min_out_buf_size[1] = 0; + s_ctl_op.u4_min_out_buf_size[2] = 0; break; } - case IV_YUV_444P: + case IV_RGBA_8888: { - s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT; - s_ctl_op.u4_min_out_buf_size[1] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT; - s_ctl_op.u4_min_out_buf_size[2] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT; + s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT * 4; + s_ctl_op.u4_min_out_buf_size[1] = 0; + s_ctl_op.u4_min_out_buf_size[2] = 0; break; } - case IV_GRAY: + case IV_RGB_565: { - s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT; + s_ctl_op.u4_min_out_buf_size[0] = ADAPTIVE_MAX_WD * ADAPTIVE_MAX_HT * 2; s_ctl_op.u4_min_out_buf_size[1] = 0; s_ctl_op.u4_min_out_buf_size[2] = 0; break; @@ -3011,6 +3013,7 @@ int main(WORD32 argc, CHAR *argv[]) /*************************************************************************/ /* Get SEI mastering display color volume parameters */ /*************************************************************************/ +#ifndef DISABLE_SEI if(1 == ps_video_decode_op->u4_output_present) { @@ -3036,6 +3039,8 @@ int main(WORD32 argc, CHAR *argv[]) } +#endif + if((1 == s_app_ctx.display) && (1 == ps_video_decode_op->u4_output_present)) { diff --git a/test/decoder/test.cfg b/test/decoder/test.cfg index 44cb400..d0c6e29 100644 --- a/test/decoder/test.cfg +++ b/test/decoder/test.cfg @@ -1,22 +1,14 @@ -### Decoder configuration file - -### Source and Destination Files ---input str.bin ---output out.yuv - - ### Destination Control Flags ---save_output 1 +--input /data/local/tmp/hevcdec/crew_720p_2mbps.265 +--save_output 0 --num_frames -1 ---loopback 0 ---chroma_format YUV_420P # options: {YUV_420P, YUV_420SP_UV, YUV_420SP_VU, GRAY, YUV_444P, YUV_422P} - -### Profile Settings ---enable_yuv_format 13 # options: {bit 0: 400, bit 1: X, bit 2: 422, bit 3: 444 } - -### Display settings +--output /data/local/tmp/hevcdec/out.yuv +--chroma_format YUV_420P --share_display_buf 0 +--max_wd 1920 +--max_ht 1080 +--max_level 41 +--num_cores 2 +--loopback 0 --display 0 - -### Performance Settings ---num_cores 1 ---arch X86_GENERIC # options: {ARM_NONEON, ARM_A9Q, ARMV8_GENERIC, X86_GENERIC, X86_SSSE3, X86_SSE42} +--arch ARM_A9Q +--soc GENERIC diff --git a/test/encoder/app.h b/test/encoder/app.h index 26959a9..3e4e4d4 100644 --- a/test/encoder/app.h +++ b/test/encoder/app.h @@ -203,7 +203,9 @@ typedef struct ihevce_static_cfg_params_t s_static_cfg_prms; +#ifndef DISABLE_SEI char ai1_sei_payload_path[STR_LEN]; +#endif } appl_ctxt_t; diff --git a/test/encoder/main.c b/test/encoder/main.c index 49d1aec..d40c3cf 100644 --- a/test/encoder/main.c +++ b/test/encoder/main.c @@ -466,6 +466,7 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR ps_static_prms->s_out_strm_prms.i4_vui_enable = i4_value; break; +#ifndef DISABLE_SEI case SEI_ENABLE_FLAGS: sscanf(value, "%d", &i4_value); ps_static_prms->s_out_strm_prms.i4_sei_enable_flag = i4_value; @@ -505,6 +506,7 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR sscanf(value, "%d", &i4_value); ps_static_prms->s_out_strm_prms.i4_sei_mastering_disp_colour_vol_flags = i4_value; break; +#endif case DISPLAY_PRIMARIES_X: { @@ -513,10 +515,12 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR const char s[2] = ","; WORD32 i; +#ifndef DISABLE_SEI if(0 == ps_static_prms->s_out_strm_prms.i4_sei_mastering_disp_colour_vol_flags) { break; } +#endif sscanf(value, "%s", pu1_keywd_str); str = (char *)pu1_keywd_str; @@ -547,10 +551,12 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR const char s[2] = ","; WORD32 i; +#ifndef DISABLE_SEI if(0 == ps_static_prms->s_out_strm_prms.i4_sei_mastering_disp_colour_vol_flags) { break; } +#endif sscanf(value, "%s", pu1_keywd_str); str = (char *)pu1_keywd_str; @@ -594,6 +600,7 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR ps_static_prms->s_out_strm_prms.u4_min_display_mastering_luminance = i4_value; break; +#ifndef DISABLE_SEI case SEI_CLL_INFO_ENABLE: sscanf(value, "%d", &i4_value); ps_static_prms->s_out_strm_prms.i4_sei_cll_enable = i4_value; @@ -608,6 +615,7 @@ IHEVCE_PLUGIN_STATUS_T parse_argument(appl_ctxt_t *ps_ctxt, CHAR *argument, CHAR sscanf(value, "%d", &i4_value); ps_static_prms->s_out_strm_prms.u2_sei_avg_cll = i4_value; break; +#endif case TILES_ENABLED_FLAG: sscanf(value, "%d", &i4_value); diff --git a/tests/common/common.cmake b/tests/common/common.cmake deleted file mode 100644 index ebeb7ca..0000000 --- a/tests/common/common.cmake +++ /dev/null @@ -1,22 +0,0 @@ -enable_testing() -libhevc_add_gtest_executable( - ihevc_luma_inter_pred_test - SOURCES ${HEVC_ROOT}/tests/common/ihevc_luma_inter_pred_test.cc -) - -libhevc_add_gtest_executable( - ihevc_luma_intra_pred_test - SOURCES ${HEVC_ROOT}/tests/common/ihevc_luma_intra_pred_test.cc -) - -libhevc_add_gtest_executable( - ihevc_itrans_res_test - SOURCES ${HEVC_ROOT}/tests/common/ihevc_itrans_res_test.cc -) - -libhevc_add_gtest_executable( - ihevc_itrans_recon_test - SOURCES ${HEVC_ROOT}/tests/common/ihevc_itrans_recon_test.cc -) - -include(GoogleTest) diff --git a/tests/common/func_selector.cc b/tests/common/func_selector.cc deleted file mode 100644 index c35d32e..0000000 --- a/tests/common/func_selector.cc +++ /dev/null @@ -1,115 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_inter_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -// clang-format on - -const func_selector_t ref = []() { - func_selector_t ret = {}; -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) - ihevcd_init_function_ptr_generic(&ret); -#elif defined(__aarch64__) || defined(__arm__) - ihevcd_init_function_ptr_noneon(&ret); -#endif - return ret; -}(); - -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) -const func_selector_t test_ssse3 = []() { - func_selector_t ret = {}; - ihevcd_init_function_ptr_ssse3(&ret); - return ret; -}(); - -const func_selector_t test_sse42 = []() { - func_selector_t ret = {}; - ihevcd_init_function_ptr_sse42(&ret); - return ret; -}(); - -#ifndef DISABLE_AVX2 -const func_selector_t test_avx2 = []() { - func_selector_t ret = {}; - ihevcd_init_function_ptr_avx2(&ret); - return ret; -}(); -#endif -#elif defined(__aarch64__) -const func_selector_t test_arm64 = []() { - func_selector_t ret = {}; -#ifdef DARWIN - ihevcd_init_function_ptr_noneon(&ret); -#else - ihevcd_init_function_ptr_av8(&ret); -#endif - return ret; -}(); -#elif defined(__arm__) -const func_selector_t test_arm32 = []() { - func_selector_t ret = {}; -#ifdef DARWIN - ihevcd_init_function_ptr_noneon(&ret); -#else - ihevcd_init_function_ptr_a9q(&ret); -#endif - return ret; -}(); -#endif - -const func_selector_t *get_ref_func_ptr() { return &ref; } - -const func_selector_t *get_tst_func_ptr(IVD_ARCH_T arch) { - switch (arch) { -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) - case ARCH_X86_SSSE3: - return &test_ssse3; - case ARCH_X86_SSE42: - return &test_sse42; -#ifndef DISABLE_AVX2 - case ARCH_X86_AVX2: - return &test_avx2; -#endif -#elif defined(__aarch64__) - case ARCH_ARMV8_GENERIC: - return &test_arm64; -#elif defined(__arm__) - case ARCH_ARM_A9Q: - return &test_arm32; -#endif - default: - return nullptr; - } -} diff --git a/tests/common/func_selector.h b/tests/common/func_selector.h deleted file mode 100644 index 5738aef..0000000 --- a/tests/common/func_selector.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef __FUNC_SELECTOR_H__ -#define __FUNC_SELECTOR_H__ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_inter_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -// clang-format on - -const func_selector_t *get_ref_func_ptr(); -const func_selector_t *get_tst_func_ptr(IVD_ARCH_T arch); - -#endif /* __FUNC_SELECTOR_H__ */ \ No newline at end of file diff --git a/tests/common/ihevc_itrans_recon_test.cc b/tests/common/ihevc_itrans_recon_test.cc deleted file mode 100644 index 77a4ede..0000000 --- a/tests/common/ihevc_itrans_recon_test.cc +++ /dev/null @@ -1,176 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "func_selector.h" -#include "ihevc_defs.h" -#include "ihevc_itrans_recon.h" -#include "ihevc_macros.h" -#include "ihevc_structs.h" -#include "ihevc_typedefs.h" -#include "tests_common.h" - -namespace { - -// Test parameters: trans_size, ttype (0: normal, 1: ttype1), arch, -// non_zero_rows, non_zero_cols (number of non-zero rows/columns) -using ITransReconTestParam = std::tuple; - -class ITransReconTest : public ::testing::TestWithParam { -protected: - void SetUp() override { - std::tie(trans_size, ttype, arch, num_non_zero_rows, num_non_zero_cols) = - GetParam(); - - src_strd = trans_size; - pred_strd = trans_size; - dst_strd = trans_size; - - pi2_src.resize(trans_size * trans_size); - // pi2_tmp needs to be large enough to hold intermediate data of width * - // height 16bits. - pi2_tmp.resize(trans_size * trans_size); - pu1_pred.resize(trans_size * trans_size); - pu1_dst_ref.resize(trans_size * trans_size); - pu1_dst_tst.resize(trans_size * trans_size); - - ref_func_selector = get_ref_func_ptr(); - tst_func_selector = get_tst_func_ptr(arch); - } - - template void RunTest(FuncPtr func_ptr) { - std::mt19937 rng(0); - std::uniform_int_distribution coeff_dist(-32768, 32767); - std::uniform_int_distribution pixel_dist(0, 255); - - // Populate pi2_src so that the requested number of rows and columns - // are potentially non-zero. Rows [0, non_zero_rows) and columns - // [0, non_zero_cols) form the non-zero region; everything else is zero. - std::fill(pi2_src.begin(), pi2_src.end(), 0); - for (int i = 0; i < trans_size; i++) { - for (int j = 0; j < trans_size; j++) { - if (i < num_non_zero_rows && j < num_non_zero_cols) { - pi2_src[i * src_strd + j] = coeff_dist(rng); - } - } - } - - for (auto &v : pu1_pred) - v = pixel_dist(rng); - - WORD32 non_zero_rows_mask = 0; - for (int i = 0; i < num_non_zero_rows && i < trans_size; i++) { - non_zero_rows_mask |= (1u << i); - } - - WORD32 non_zero_cols_mask = 0; - for (int j = 0; j < num_non_zero_cols && j < trans_size; j++) { - non_zero_cols_mask |= (1u << j); - } - - WORD32 mask = (trans_size == 32) - ? 0xFFFFFFFFu - : ((static_cast(1u) << trans_size) - 1u); - WORD32 zero_cols = (~non_zero_cols_mask) & mask; - WORD32 zero_rows = (~non_zero_rows_mask) & mask; - - (ref_func_selector->*func_ptr)( - pi2_src.data(), pi2_tmp.data(), pu1_pred.data(), pu1_dst_ref.data(), - src_strd, pred_strd, dst_strd, zero_cols, zero_rows); - (tst_func_selector->*func_ptr)( - pi2_src.data(), pi2_tmp.data(), pu1_pred.data(), pu1_dst_tst.data(), - src_strd, pred_strd, dst_strd, zero_cols, zero_rows); - ASSERT_NO_FATAL_FAILURE(compare_output( - pu1_dst_ref, pu1_dst_tst, trans_size, trans_size, dst_strd)); - } - - int trans_size; - int ttype; - IVD_ARCH_T arch; - const func_selector_t *ref_func_selector; - const func_selector_t *tst_func_selector; - - WORD32 src_strd; - WORD32 pred_strd; - WORD32 dst_strd; - WORD32 num_non_zero_rows; - WORD32 num_non_zero_cols; - std::vector pi2_src; - std::vector pi2_tmp; - std::vector pu1_pred; - std::vector pu1_dst_ref; - std::vector pu1_dst_tst; -}; - -TEST_P(ITransReconTest, Run) { - if (trans_size == 4) { - if (ttype == 1) { - RunTest(&func_selector_t::ihevc_itrans_recon_4x4_ttype1_fptr); - } else { - RunTest(&func_selector_t::ihevc_itrans_recon_4x4_fptr); - } - } else if (trans_size == 8) { - RunTest(&func_selector_t::ihevc_itrans_recon_8x8_fptr); - } else if (trans_size == 16) { - RunTest(&func_selector_t::ihevc_itrans_recon_16x16_fptr); - } else if (trans_size == 32) { -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) - GTEST_SKIP() << "SSE4.2 and SSSE3 are not matching C implementation for " - "ihevc_itrans_recon_32x32_fptr"; -#endif - RunTest(&func_selector_t::ihevc_itrans_recon_32x32_fptr); - } -} - -std::string PrintITransReconTestParam( - const testing::TestParamInfo &info) { - WORD32 trans_size, ttype, non_zero_rows, non_zero_cols; - IVD_ARCH_T arch; - std::tie(trans_size, ttype, arch, non_zero_rows, non_zero_cols) = info.param; - std::stringstream ss; - ss << "size_" << trans_size << "_ttype_" << ttype << "_nzr_" << non_zero_rows - << "_nzc_" << non_zero_cols << "_" << get_arch_str(arch); - return ss.str(); -} - -std::vector GenerateITransReconTestParams() { - std::vector params; - const WORD32 nz_options[] = {1, 2, 4, 8, 16, 32}; - - auto add_params_for_size = [&](int size, const int *ttypes, int num_ttypes) { - for (int t = 0; t < num_ttypes; t++) { - int ttype = ttypes[t]; - for (auto arch : ga_tst_arch) { - for (WORD32 nnzr : nz_options) { - if (nnzr > size) - continue; - for (WORD32 nnzc : nz_options) { - if (nnzc > size) - continue; - params.emplace_back(size, ttype, arch, nnzr, nnzc); - } - } - } - } - }; - - const int ttypes4[] = {0, 1}; - const int ttypesOther[] = {0}; - - add_params_for_size(4, ttypes4, 2); - add_params_for_size(8, ttypesOther, 1); - add_params_for_size(16, ttypesOther, 1); - add_params_for_size(32, ttypesOther, 1); - - return params; -} - -INSTANTIATE_TEST_SUITE_P(ITransRecon, ITransReconTest, - ::testing::ValuesIn(GenerateITransReconTestParams()), - PrintITransReconTestParam); - -} // namespace diff --git a/tests/common/ihevc_itrans_res_test.cc b/tests/common/ihevc_itrans_res_test.cc deleted file mode 100644 index 1819bce..0000000 --- a/tests/common/ihevc_itrans_res_test.cc +++ /dev/null @@ -1,138 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_itrans_res.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -#include "func_selector.h" -#include "tests_common.h" -// clang-format on - -// Test parameters: trans_size, ttype (0: normal, 1: ttype1), arch -using ITransResTestParam = std::tuple; - -class ITransResTest : public ::testing::TestWithParam { -protected: - void SetUp() override { - std::tie(trans_size, ttype, arch) = GetParam(); - src_strd = trans_size; - dst_strd = trans_size; - - // Input buffer (coefficients) - src_buf.resize(trans_size * trans_size); - - // Temporary buffer (intermediate 16-bit data) - // Size needed: width * height * 16 bits = width * height * 2 bytes - // pi2_tmp is WORD16*, so we need width * height elements - tmp_buf.resize(trans_size * trans_size); - - // Output buffers - dst_buf_ref.resize(trans_size * trans_size); - dst_buf_tst.resize(trans_size * trans_size); - - std::mt19937 rng(12345); - std::uniform_int_distribution dist(-32768, 32767); - - for (auto &v : src_buf) { - v = static_cast(dist(rng)); - } - - // Fill dst buffers with pattern - std::fill(dst_buf_ref.begin(), dst_buf_ref.end(), 0xCDCD); - std::fill(dst_buf_tst.begin(), dst_buf_tst.end(), 0xCDCD); - - tst = get_tst_func_ptr(arch); - ref = get_ref_func_ptr(); - } - - template void RunTest(FuncPtr func_ptr) { - (ref->*func_ptr)(src_buf.data(), tmp_buf.data(), dst_buf_ref.data(), - src_strd, dst_strd, 0, 0); - (tst->*func_ptr)(src_buf.data(), tmp_buf.data(), dst_buf_tst.data(), - src_strd, dst_strd, 0, 0); - - ASSERT_NO_FATAL_FAILURE(compare_output( - dst_buf_ref, dst_buf_tst, trans_size, trans_size, dst_strd)); - } - - int trans_size; - int ttype; - IVD_ARCH_T arch; - int src_strd, dst_strd; - std::vector src_buf; - std::vector tmp_buf; - std::vector dst_buf_ref; - std::vector dst_buf_tst; - const func_selector_t *tst; - const func_selector_t *ref; -}; - -TEST_P(ITransResTest, Run) { - if (trans_size == 4) { - if (ttype == 1) { - RunTest(&func_selector_t::ihevc_itrans_res_4x4_ttype1_fptr); - } else { - RunTest(&func_selector_t::ihevc_itrans_res_4x4_fptr); - } - } else if (trans_size == 8) { - RunTest(&func_selector_t::ihevc_itrans_res_8x8_fptr); - } else if (trans_size == 16) { - RunTest(&func_selector_t::ihevc_itrans_res_16x16_fptr); - } else if (trans_size == 32) { - RunTest(&func_selector_t::ihevc_itrans_res_32x32_fptr); - } -} - -std::string PrintITransResTestParam( - const testing::TestParamInfo &info) { - int trans_size, ttype; - IVD_ARCH_T arch; - std::tie(trans_size, ttype, arch) = info.param; - std::stringstream ss; - ss << "size_" << trans_size << "_ttype_" << ttype << "_" - << get_arch_str(arch); - return ss.str(); -} - -// Instantiate tests -// Size 4: ttype 0 and 1 -INSTANTIATE_TEST_SUITE_P(ITransRes4x4, ITransResTest, - ::testing::Combine(::testing::Values(4), - ::testing::Values(0, 1), - ::testing::ValuesIn(ga_tst_arch)), - PrintITransResTestParam); - -// Size 8, 16, 32: ttype 0 -INSTANTIATE_TEST_SUITE_P(ITransResOther, ITransResTest, - ::testing::Combine(::testing::Values(8, 16, 32), - ::testing::Values(0), - ::testing::ValuesIn(ga_tst_arch)), - PrintITransResTestParam); diff --git a/tests/common/ihevc_luma_inter_pred_test.cc b/tests/common/ihevc_luma_inter_pred_test.cc deleted file mode 100644 index 5a41802..0000000 --- a/tests/common/ihevc_luma_inter_pred_test.cc +++ /dev/null @@ -1,179 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_inter_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -#include "func_selector.h" -#include "tests_common.h" -// clang-format on - -// Test parameters: width, height, src_stride_mul, dst_stride_mul, coeff_idx, -// arch -using LumaInterPredTestParam = - std::tuple, int, int, int, IVD_ARCH_T>; -template -class LumaInterPredTest - : public ::testing::TestWithParam { -protected: - void SetUp() override { - - std::pair block_size; - std::tie(block_size, src_strd_mul, dst_strd_mul, coeff_idx, arch) = - GetParam(); - std::tie(wd, ht) = block_size; - src_strd = wd * src_strd_mul; - dst_strd = wd * dst_strd_mul; - - dst_buf_ref.resize(dst_strd * ht); - dst_buf_tst.resize(dst_strd * ht); - - // Set pv_src to a valid position within src_buf to allow negative indexing - pv_src = (srcType *)g_src8_buf.data() + kTapSize / 2 * src_strd; - pv_dst_ref = dst_buf_ref.data(); - pv_dst_tst = dst_buf_tst.data(); - - pi1_coeffs = gai1_ihevc_luma_filter[coeff_idx]; - tst = get_tst_func_ptr(arch); - ref = get_ref_func_ptr(); - } - - template void RunTest(FuncPtr func_ptr) { - (ref->*func_ptr)(pv_src, pv_dst_ref, src_strd, dst_strd, pi1_coeffs, ht, - wd); - (tst->*func_ptr)(pv_src, pv_dst_tst, src_strd, dst_strd, pi1_coeffs, ht, - wd); - ASSERT_NO_FATAL_FAILURE( - compare_output(dst_buf_ref, dst_buf_tst, wd, ht, dst_strd)); - } - - int wd, ht, src_strd_mul, dst_strd_mul, coeff_idx; - int src_strd, dst_strd; - std::vector dst_buf_ref; - std::vector dst_buf_tst; - srcType *pv_src; - dstType *pv_dst_ref; - dstType *pv_dst_tst; - WORD8 *pi1_coeffs; - IVD_ARCH_T arch; - const func_selector_t *tst; - const func_selector_t *ref; -}; - -class LumaInterPred_8_8_Test : public LumaInterPredTest {}; -class LumaInterPred_8_16_Test : public LumaInterPredTest {}; -class LumaInterPred_16_8_Test : public LumaInterPredTest {}; -class LumaInterPred_16_16_Test : public LumaInterPredTest {}; - -TEST_P(LumaInterPred_8_8_Test, LumaCopyTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_copy_fptr); -} - -TEST_P(LumaInterPred_8_8_Test, LumaHorzTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_horz_fptr); -} - -TEST_P(LumaInterPred_8_8_Test, LumaVertTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_vert_fptr); -} - -TEST_P(LumaInterPred_8_16_Test, LumaCopyTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_copy_w16out_fptr); -} - -TEST_P(LumaInterPred_8_16_Test, LumaHorzTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_horz_w16out_fptr); -} - -TEST_P(LumaInterPred_8_16_Test, LumaVertTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_vert_w16out_fptr); -} - -TEST_P(LumaInterPred_16_8_Test, LumaVertTest) { - RunTest(&func_selector_t::ihevc_inter_pred_luma_vert_w16inp_fptr); -} - -TEST_P(LumaInterPred_16_16_Test, LumaVertTest) { -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) - // TODO: SSE4.2 and SSSE3 are not matching C implementation - GTEST_SKIP() << "SSE4.2 and SSSE3 are not matching C implementation for " - "ihevc_inter_pred_luma_vert_w16inp_w16out_fptr"; -#endif - RunTest(&func_selector_t::ihevc_inter_pred_luma_vert_w16inp_w16out_fptr); -} - -auto kLumaInterPredTestParams = - ::testing::Combine(::testing::ValuesIn(kPUBlockSizes), - ::testing::Values(1, 2), // Src Stride Multiplier - ::testing::Values(1, 2), // Dst Stride Multiplier - ::testing::Values(0, 1, 2, 3), // Coeff index - ::testing::ValuesIn(ga_tst_arch) // arch - ); - -std::string PrintLumaInterPredTestParam( - const testing::TestParamInfo &info) { - int wd, ht, src_strd_mul, dst_strd_mul, coeff_idx; - IVD_ARCH_T arch; - std::pair block_size; - std::tie(block_size, src_strd_mul, dst_strd_mul, coeff_idx, arch) = - info.param; - std::tie(wd, ht) = block_size; - std::stringstream ss; - ss << wd << "x" << ht << "_src_stride_" << src_strd_mul * wd << "_dst_stride_" - << dst_strd_mul * wd << "_coeff_" << coeff_idx << "_" - << get_arch_str(arch); - return ss.str(); -} - -INSTANTIATE_TEST_SUITE_P(LumaCopyTest, LumaInterPred_8_8_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaHorzTest, LumaInterPred_8_8_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaVertTest, LumaInterPred_8_8_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaCopyTest, LumaInterPred_8_16_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaHorzTest, LumaInterPred_8_16_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaVertTest, LumaInterPred_8_16_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaVertTest, LumaInterPred_16_8_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); - -INSTANTIATE_TEST_SUITE_P(LumaVertTest, LumaInterPred_16_16_Test, - kLumaInterPredTestParams, PrintLumaInterPredTestParam); diff --git a/tests/common/ihevc_luma_intra_pred_test.cc b/tests/common/ihevc_luma_intra_pred_test.cc deleted file mode 100644 index 1a1b635..0000000 --- a/tests/common/ihevc_luma_intra_pred_test.cc +++ /dev/null @@ -1,146 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_intra_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -#include "func_selector.h" -#include "tests_common.h" -// clang-format on - -// Test parameters: block_size, mode, dst_stride_mul, arch -using LumaIntraPredTestParam = std::tuple; - -class LumaIntraPredTest - : public ::testing::TestWithParam { -protected: - void SetUp() override { - std::tie(nt, mode, dst_strd_mul, arch) = GetParam(); - src_strd = 1; // Intra pred reference is usually dense - dst_strd = nt * dst_strd_mul; - - // Reference buffer size: 4 * nt + 1 - int ref_size = 4 * nt + 1; - ref_buf.resize(ref_size); - - // Initialize reference buffer with random data - std::mt19937 rng(12345); - std::uniform_int_distribution dist(0, 255); - for (auto &v : ref_buf) { - v = static_cast(dist(rng)); - } - - // Use a pointer aligned or offset to ensure we have valid data - // The function expects pu1_ref to point to the start of the reference array - // Top-left is usually at index 2*nt. - // We just pass the data pointer. - pu1_ref = ref_buf.data(); - - dst_buf_ref.resize(dst_strd * nt); - dst_buf_tst.resize(dst_strd * nt); - - // Initialize dst buffers with pattern to detect over/under writes - std::fill(dst_buf_ref.begin(), dst_buf_ref.end(), 0xCD); - std::fill(dst_buf_tst.begin(), dst_buf_tst.end(), 0xCD); - - pu1_dst_ref = dst_buf_ref.data(); - pu1_dst_tst = dst_buf_tst.data(); - - tst = get_tst_func_ptr(arch); - ref = get_ref_func_ptr(); - } - - template void RunTest(FuncPtr func_ptr) { - (ref->*func_ptr)(pu1_ref, src_strd, pu1_dst_ref, dst_strd, nt, mode); - (tst->*func_ptr)(pu1_ref, src_strd, pu1_dst_tst, dst_strd, nt, mode); - ASSERT_NO_FATAL_FAILURE( - compare_output(dst_buf_ref, dst_buf_tst, nt, nt, dst_strd)); - } - - int nt, mode, dst_strd_mul; - int src_strd, dst_strd; - std::vector ref_buf; - std::vector dst_buf_ref; - std::vector dst_buf_tst; - UWORD8 *pu1_ref; - UWORD8 *pu1_dst_ref; - UWORD8 *pu1_dst_tst; - IVD_ARCH_T arch; - const func_selector_t *tst; - const func_selector_t *ref; -}; - -TEST_P(LumaIntraPredTest, Run) { - if (mode == 0) - RunTest(&func_selector_t::ihevc_intra_pred_luma_planar_fptr); - else if (mode == 1) - RunTest(&func_selector_t::ihevc_intra_pred_luma_dc_fptr); - else if (mode == 2) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode2_fptr); - else if (mode >= 3 && mode <= 9) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode_3_to_9_fptr); - else if (mode == 10) { - GTEST_SKIP() << "SIMD implementation is not matching C implementation for " - "ihevc_intra_pred_luma_horz_fptr"; - RunTest(&func_selector_t::ihevc_intra_pred_luma_horz_fptr); - } else if (mode >= 11 && mode <= 17) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode_11_to_17_fptr); - else if (mode == 18 || mode == 34) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode_18_34_fptr); - else if (mode >= 19 && mode <= 25) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode_19_to_25_fptr); - else if (mode == 26) { - GTEST_SKIP() << "SIMD implementation is not matching C implementation for " - "ihevc_intra_pred_luma_ver_fptr"; - RunTest(&func_selector_t::ihevc_intra_pred_luma_ver_fptr); - } else if (mode >= 27 && mode <= 33) - RunTest(&func_selector_t::ihevc_intra_pred_luma_mode_27_to_33_fptr); - else - FAIL() << "Invalid mode: " << mode; -} - -std::string PrintLumaIntraPredTestParam( - const testing::TestParamInfo &info) { - int nt, mode, dst_strd_mul; - IVD_ARCH_T arch; - std::tie(nt, mode, dst_strd_mul, arch) = info.param; - std::stringstream ss; - ss << "nt_" << nt << "_mode_" << mode << "_dst_stride_" << nt * dst_strd_mul - << "_" << get_arch_str(arch); - return ss.str(); -} - -INSTANTIATE_TEST_SUITE_P( - LumaIntraPred, LumaIntraPredTest, - ::testing::Combine(::testing::Values(4, 8, 16, 32), ::testing::Range(0, 35), - ::testing::Values(1, 2), // Dst Stride Multiplier - ::testing::ValuesIn(ga_tst_arch)), - PrintLumaIntraPredTestParam); diff --git a/tests/common/tests_common.cc b/tests/common/tests_common.cc deleted file mode 100644 index b840157..0000000 --- a/tests/common/tests_common.cc +++ /dev/null @@ -1,99 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_inter_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -#include "tests_common.h" -// clang-format on - -const std::vector> kPUBlockSizes = { - // clang-format off - {4, 4}, - {8, 8}, {8, 4}, {4, 8}, - {16, 16}, {16, 12}, {16, 8}, {16, 4}, {12, 16}, {8, 16}, {4, 16}, - {32, 32}, {32, 24}, {32, 16}, {32, 8}, {24, 32}, {16, 32}, {8, 32}, - {64, 64}, {64, 48}, {64, 32}, {64, 16}, {48, 64}, {32, 64}, {16, 64}, - // clang-format on -}; - -const std::vector g_src8_buf = []() { - // allocate twice to account for WORD16 as well - std::vector buf(kMaxSize * kMaxHeight * 2); - std::mt19937 rng(12345); - std::uniform_int_distribution dist(0, 255); - for (auto &v : buf) - v = static_cast(dist(rng)); - return buf; -}(); - -std::string get_arch_str(IVD_ARCH_T arch) { - std::string arch_str; - switch (arch) { - case ARCH_X86_GENERIC: - arch_str = "GENERIC"; - break; - case ARCH_X86_SSSE3: - arch_str = "SSSE3"; - break; - case ARCH_X86_SSE42: - arch_str = "SSE42"; - break; - case ARCH_X86_AVX2: - arch_str = "AVX2"; - break; - case ARCH_ARMV8_GENERIC: - arch_str = "ARMV8"; - break; - case ARCH_ARM_A9Q: - arch_str = "A9Q"; - break; - default: - arch_str = "UNKNOWN"; - break; - } - return arch_str; -} - -const std::vector ga_tst_arch = { -#if defined(__x86_64__) || defined(_M_X64) || defined(__i386) || \ - defined(_M_IX86) - ARCH_X86_SSSE3, - ARCH_X86_SSE42, -#ifndef DISABLE_AVX2 - ARCH_X86_AVX2, -#endif // DISABLE_AVX2 -#elif defined(__aarch64__) - ARCH_ARMV8_GENERIC, -#elif defined(__arm__) - ARCH_ARM_A9Q, -#endif -}; \ No newline at end of file diff --git a/tests/common/tests_common.h b/tests/common/tests_common.h deleted file mode 100644 index bd31278..0000000 --- a/tests/common/tests_common.h +++ /dev/null @@ -1,61 +0,0 @@ -/****************************************************************************** - * - * Copyright (C) 2026 Ittiam Systems Pvt Ltd, Bangalore - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at: - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - ******************************************************************************/ -#ifndef __TESTS_COMMON_H__ -#define __TESTS_COMMON_H__ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -// clang-format off -#include "ihevc_typedefs.h" -#include "ihevc_inter_pred.h" -#include "ihevcd_function_selector.h" -#include "iv.h" -#include "ivd.h" -// clang-format on - -static constexpr int kMaxSize = 64; -static constexpr int kTapSize = 8; -static constexpr int kMaxHeight = kMaxSize + kTapSize; - -extern const std::vector> kPUBlockSizes; -extern const std::vector g_src8_buf; -extern const std::vector ga_tst_arch; - -// Compare outputs -template -static void compare_output(const std::vector &ref, - const std::vector &test, int wd, int ht, - int dst_strd) { - int size_bytes = wd * sizeof(T); - for (int i = 0; i < ht; ++i) { - int cmp = memcmp(ref.data() + i * dst_strd, test.data() + i * dst_strd, - size_bytes); - ASSERT_EQ(0, cmp) << "Mismatch at row " << i << " for size " << wd << "x" - << ht; - } -} - -std::string get_arch_str(IVD_ARCH_T arch); -#endif /* __TESTS_COMMON_H__ */ \ No newline at end of file