Projects
Essentials
kvazaar
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 17
View file
kvazaar.changes
Changed
@@ -1,4 +1,30 @@ ------------------------------------------------------------------- +Wed Oct 13 15:32:42 UTC 2021 - Luigi Baldoni <aloisio@gmx.com> + +- Update to version 2.1.0 + * With this release, the license was changed from LGPL2.1 to + 3-Clause BSD, allowing more liberties in using Kvazaar. + Features: + * Option to use a custom table for fast bitrate estimation + weights (--fast-coeff-table <file>) + * Tools to create new weight sets for fast bitrate estimation + (--fast-rd-sampling, --fastrd-accuracy-check, + --fastrd-outdir), documented in rdcost-weight-tool/README.txt + * Added support for Y4M input in addition to YUV (Autodetected, + manually enable using --input-file-format=y4m) + * Allow writing out block statistics for debugging + (--stats-file-prefix) + Optimizations: + * New AVX2 implementations for interpolation filters + Fixes: + * DTS offset was incorrect at the beginning of the sequence + when using GOP + * Added VPS information about reordering and buffering, fixes + VLC playback + * Removed pthread_exit() on mingw to fix media-autobuild suite + * Renamed truncate function to not overlap with POSIX one. + +------------------------------------------------------------------- Wed Apr 22 16:16:28 UTC 2020 - Luigi Baldoni <aloisio@gmx.com> - Update to version 2.0.0
View file
kvazaar.spec
Changed
@@ -1,7 +1,7 @@ # # spec file for package kvazaar # -# Copyright (c) 2020 Packman Team <packman@links2linux.de> +# Copyright (c) 2021 Packman Team <packman@links2linux.de> # Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties @@ -20,10 +20,10 @@ %define libname libkvazaar %define libmver 6 Name: kvazaar -Version: 2.0.0 +Version: 2.1.0 Release: 0 Summary: HEVC encoder -License: LGPL-2.1-or-later +License: BSD-3-Clause Group: Productivity/Multimedia/Video/Editors and Convertors URL: http://ultravideo.cs.tut.fi/#encoder Source0: https://github.com/ultravideo/%{name}/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz @@ -72,19 +72,19 @@ %install %make_install find %{buildroot} -type f -name "*.la" -delete -print -rm %{buildroot}%{_defaultdocdir}/%{name}/COPYING +rm %{buildroot}%{_defaultdocdir}/%{name}/LICENSE* %post -n %{libname}%{libmver} -p /sbin/ldconfig %postun -n %{libname}%{libmver} -p /sbin/ldconfig %files -%license COPYING +%license LICENSE %doc CREDITS README.md %{_bindir}/%{name} %{_mandir}/man1/%{name}.1%{ext_man} %files -n %{libname}%{libmver} -%license COPYING +%license LICENSE %doc CREDITS README.md %{_libdir}/%{libname}.so.%{libmver}*
View file
kvazaar-2.0.0.tar.gz/.travis.yml
Deleted
@@ -1,53 +0,0 @@ -language: c - -# Use container based infrastructure. -sudo: false - -addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - autoconf - - gcc-4.8 - - libtool - - valgrind - - yasm - -matrix: - fast_finish: true - - include: - - compiler: clang - env: KVZ_TEST_VALGRIND=1 KVAZAAR_OVERRIDE_angular_pred=generic - - - compiler: clang - env: CFLAGS='-fsanitize=thread' - - - compiler: clang - env: CFLAGS='-fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=alignment' - - - compiler: gcc-4.8 - env: CFLAGS='-fsanitize=address' - - # We have some Mac specific code and Mac sometimes has odd build issues. - - os: osx - compiler: clang # gcc is actually clang on Travis OS X - install: true - script: - - ./autogen.sh - - ./configure --enable-werror || (cat config.log && false) - - make --jobs=2 V=1 - - make check TESTS=kvazaar_tests - -install: bash .travis-install.bash - -script: - - ./autogen.sh - - ./configure --enable-werror || (cat config.log && false) - - make --jobs=2 V=1 - - make check VERBOSE=1 - -after_script: - # Disable errors to work around Travis not knowing how to fix their stuff. - - set +e
View file
kvazaar-2.0.0.tar.gz/COPYING
Deleted
@@ -1,559 +0,0 @@ -Kvazaar is free software: you can redistribute it and/or modify it under -the terms of the GNU Lesser General Public License as published by the -Free Software Foundation; either version 2.1 of the License, or (at your -option) any later version. - -Copyright to the code is held by the following parties: -2012-2015 Tampere University of Technology -2014 CES-Creative Electronic Systems SA -2013-2015 Private individuals who contributed to Kvazaar -2010-2012 ITU/ISO/IEC - - -This program incorporates work covered by the following copyright and -permission notice, all changes are however licensed under LGPLv2.1: - The copyright in this software is being made available under the BSD - License, included below. This software may be subject to other third party - and contributor rights, including patent rights, and no such rights are - granted under this license. - - Copyright (c) 2010-2012, ITU/ISO/IEC - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of the ITU/ISO/IEC nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - THE POSSIBILITY OF SUCH DAMAGE. - - -Kvazaar uses x264asm abstraction layer -library (included in src/x86/x86inc.asm) -licensed under ISC license. - - -Kvazaar uses "Greatest" C unit testing library, licensed under ISC license. -A fork of the library is included in the git project as a submodule. The -original can be found at https://github.com/silentbicycle/greatest . - - -Copy of GPLv2 (also available at http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt): -GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not
View file
kvazaar-2.1.0.tar.gz/.github
Added
+(directory)
View file
kvazaar-2.1.0.tar.gz/.github/workflows
Added
+(directory)
View file
kvazaar-2.1.0.tar.gz/.github/workflows/kvazaar.yml
Added
@@ -0,0 +1,83 @@ +name: Kvazaar_tests + +on: + push: + pull_request: + types: [closed] + +jobs: + basic-test: + runs-on: self-hosted + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j VERBOSE=1 + + test-ubsan: + runs-on: self-hosted + env: + CC: gcc + CFLAGS: -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=alignment + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-asan: + runs-on: self-hosted + env: + CC: gcc + CFLAGS: -fsanitize=address + ASAN_OPTIONS: detect_leaks=0 + # AddressSanitizer adds some extra symbols so we expect a failure from + # the external symbols test. + XFAIL_TESTS: test_external_symbols.sh + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-tsan: + runs-on: self-hosted + env: + CC: gcc + CFLAGS: -fsanitize=thread + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-valgrind: + runs-on: self-hosted + + env: + KVAZAAR_OVERRIDE_angular_pred: generic + + steps: + - uses: actions/checkout@v2 + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && KVZ_TEST_VALGRIND=1 make check -j4 VERBOSE=1
View file
kvazaar-2.1.0.tar.gz/.github/workflows/pull_request.yml
Added
@@ -0,0 +1,102 @@ +name: Kvazaar_pr_tests + +on: + pull_request_target: + types: [labeled] + +jobs: + + basic-test: + runs-on: self-hosted + if: contains(github.event.pull_request.labels.*.name, 'safe to test') + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j VERBOSE=1 + + test-ubsan: + runs-on: self-hosted + if: contains(github.event.pull_request.labels.*.name, 'safe to test') + env: + CC: gcc + CFLAGS: -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=alignment + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-asan: + runs-on: self-hosted + if: contains(github.event.pull_request.labels.*.name, 'safe to test') + env: + CC: gcc + CFLAGS: -fsanitize=address + ASAN_OPTIONS: detect_leaks=0 + # AddressSanitizer adds some extra symbols so we expect a failure from + # the external symbols test. + XFAIL_TESTS: test_external_symbols.sh + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-tsan: + runs-on: self-hosted + if: contains(github.event.pull_request.labels.*.name, 'safe to test') + env: + CC: gcc + CFLAGS: -fsanitize=thread + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && make check -j4 VERBOSE=1 + + test-valgrind: + runs-on: self-hosted + if: contains(github.event.pull_request.labels.*.name, 'safe to test') + + env: + KVAZAAR_OVERRIDE_angular_pred: generic + + steps: + - uses: actions/checkout@v2 + with: + ref: ${{github.event.pull_request.head.ref}} + repository: ${{github.event.pull_request.head.repo.full_name}} + - name: configure + run: ./autogen.sh && ./configure --enable-werror || (cat config.log && false) + - name: make + run: make -j + - name: Run tests + run: export PATH="/home/docker/bin:${PATH}" && KVZ_TEST_VALGRIND=1 make check -j4 VERBOSE=1 \ No newline at end of file
View file
kvazaar-2.0.0.tar.gz/.gitlab-ci.yml -> kvazaar-2.1.0.tar.gz/.gitlab-ci.yml
Changed
@@ -32,7 +32,7 @@ variables: CFLAGS: '-fsanitize=thread' # Temporarily suppress known errors or false positives. - TSAN_OPTIONS: 'suppressions=/builds/TIE/ultravideo/kvazaar/tests/tsan_suppressions.txt' + TSAN_OPTIONS: 'suppressions=/builds/cs/ultravideo/kvazaar/tests/tsan_suppressions.txt' test-ubsan: <<: *test-template @@ -58,3 +58,8 @@ - ./autogen.sh - ./configure --enable-werror || (cat config.log && false) - make --jobs=8 VERBOSE=1 distcheck + +test-10bit: + <<: *test-template + variables: + CFLAGS: '-DKVZ_BIT_DEPTH=10'
View file
kvazaar-2.0.0.tar.gz/Dockerfile -> kvazaar-2.1.0.tar.gz/Dockerfile
Changed
@@ -22,12 +22,11 @@ # List of needed packages to be able to build kvazaar with autotools ENV REQUIRED_PACKAGES automake autoconf libtool m4 build-essential git yasm pkgconf -ADD . kvazaar +COPY . kvazaar # Run all the commands in one RUN so we don't have any extra history # data in the image. RUN apt-get update \ && apt-get install -y $REQUIRED_PACKAGES \ - && apt-get clean \ && cd kvazaar \ && ./autogen.sh \ && ./configure --disable-shared \ @@ -35,7 +34,6 @@ && make install \ && AUTOINSTALLED_PACKAGES=`apt-mark showauto` \ && apt-get remove --purge --force-yes -y $REQUIRED_PACKAGES $AUTOINSTALLED_PACKAGES \ - && apt-get clean autoclean \ && apt-get autoremove -y \ && rm -rf /var/lib/{apt,dpkg,cache,log}/
View file
kvazaar-2.1.0.tar.gz/LICENSE
Added
@@ -0,0 +1,27 @@ +Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, this + list of conditions and the following disclaimer in the documentation and/or + other materials provided with the distribution. + +* Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
View file
kvazaar-2.1.0.tar.gz/LICENSE.greatest
Added
@@ -0,0 +1,3 @@ +Kvazaar uses "Greatest" C unit testing library, licensed under ISC license. +A fork of the library is included in the git project as a submodule. The +original can be found at https://github.com/silentbicycle/greatest .
View file
kvazaar-2.1.0.tar.gz/LICENSE.x264asm
Added
@@ -0,0 +1,2 @@ +Kvazaar uses x264asm abstraction layer -library (included in src/x86/x86inc.asm) +licensed under ISC license.
View file
kvazaar-2.0.0.tar.gz/Makefile.am -> kvazaar-2.1.0.tar.gz/Makefile.am
Changed
@@ -4,7 +4,7 @@ dist_man1_MANS = doc/kvazaar.1 -dist_doc_DATA = COPYING CREDITS README.md +dist_doc_DATA = LICENSE LICENSE.greatest LICENSE.x264asm CREDITS README.md EXTRA_DIST = \ build \
View file
kvazaar-2.0.0.tar.gz/README.md -> kvazaar-2.1.0.tar.gz/README.md
Changed
@@ -1,14 +1,14 @@ Kvazaar ======= -An open-source HEVC encoder licensed under LGPLv2.1 +An open-source HEVC encoder licensed under 3-clause BSD -Join channel #kvazaar_hevc in Freenode IRC network to contact us. +Join channel [#ultravideo](https://web.libera.chat/#ultravideo) in [Libera.Chat](https://libera.chat/) IRC network to contact us. Kvazaar is still under development. Speed and RD-quality will continue to improve. -http://ultravideo.cs.tut.fi/#encoder for more information. +http://ultravideo.fi/#encoder for more information. -- Linux/Mac [![Build Status](https://travis-ci.org/ultravideo/kvazaar.svg?branch=master)](https://travis-ci.org/ultravideo/kvazaar) +- Linux [![Kvazaar_tests](https://github.com/ultravideo/kvazaar/actions/workflows/kvazaar.yml/badge.svg)](https://github.com/ultravideo/kvazaar/actions/workflows/kvazaar.yml) - Windows [![Build status](https://ci.appveyor.com/api/projects/status/88sg1h25lp0k71pu?svg=true)](https://ci.appveyor.com/project/Ultravideo/kvazaar) ## Table of Contents @@ -78,6 +78,10 @@ --input-format <string> : P420 or P400 [P420] --input-bitdepth <int> : 8-16 [8] --loop-input : Re-read input file forever. + --input-file-format <string> : Input file format [auto] + - auto: Check the file ending for format + - y4m (skips frame headers) + - yuv Options: --help : Print this help message and exit. @@ -103,6 +107,10 @@ - intra_pred_modes: Intra prediction modes. --key <string> : Encryption key [16,213,27,56,255,127,242,112, 97,126,197,204,25,59,38,30] + --stats-file-prefix : A prefix used for stats files that include + bits, lambda, distortion, and qp for each ctu. + These are meant for debugging and are not + written unless the prefix is defined. Video structure: -q, --qp <integer> : Quantization parameter [22] @@ -236,6 +244,16 @@ - sensitive: Terminate even earlier. --fast-residual-cost <int> : Skip CABAC cost for residual coefficients when QP is below the limit. [0] + --fast-coeff-table <string> : Read custom weights for residual + coefficients from a file instead of using + defaults [default] + --fast-rd-sampling : Enable learning data sampling for fast coefficient + table generation + --fastrd-accuracy-check : Evaluate the accuracy of fast coefficient + prediction + --fastrd-outdir : Directory to which to output sampled data or accuracy + data, into <fastrd-outdir>/0.txt to 50.txt, one file + for each QP that blocks were estimated on --(no-)intra-rdo-et : Check intra modes in rdo stage only until a zero coefficient CU is found. [disabled] --(no-)early-skip : Try to find skip cu from merge candidates. @@ -323,7 +341,7 @@ ``` QP +4 o o o o -+3 o o o o o o ++3 o o o o o o +2 o o o o ooooooo +1 o o o o o o ooooooooo g8d4t1 g8d3t1 g8d2t1 g8d1t1
View file
kvazaar-2.0.0.tar.gz/appveyor.yml -> kvazaar-2.1.0.tar.gz/appveyor.yml
Changed
@@ -1,8 +1,3 @@ -# Only the whitelisted branches get built, regardless of build config -branches: - only: - - master - # Email the author if their commit either failed to build or fixed a failed build # good -> bad, bad -> bad, bad -> good but not good -> good notifications: @@ -20,7 +15,7 @@ - .gitlab-ci.yml - .travis-install.bash - .travis.yml - - COPYING + - LICENSE - CREDITS - README.md - docs.doxy @@ -37,13 +32,16 @@ - Release # Build with multiple compilers / build suites -image: Visual Studio 2015 environment: matrix: - - platform: Win32 - - platform: x64 - - MSYSTEM: MINGW32 - - MSYSTEM: MINGW64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + platform: Win32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + platform: x64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + MSYSTEM: MINGW32 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + MSYSTEM: MINGW64 for: -
View file
kvazaar-2.0.0.tar.gz/build/kvazaar_lib/kvazaar_lib.vcxproj -> kvazaar-2.1.0.tar.gz/build/kvazaar_lib/kvazaar_lib.vcxproj
Changed
@@ -164,6 +164,7 @@ <ClCompile Include="..\..\src\nal.c" /> <ClCompile Include="..\..\src\rate_control.c" /> <ClCompile Include="..\..\src\rdo.c" /> + <ClCompile Include="..\..\src\fast_coeff_cost.c" /> <ClCompile Include="..\..\src\sao.c" /> <ClCompile Include="..\..\src\scalinglist.c" /> <ClCompile Include="..\..\src\search.c" /> @@ -298,6 +299,7 @@ <ClInclude Include="..\..\src\nal.h" /> <ClInclude Include="..\..\src\rate_control.h" /> <ClInclude Include="..\..\src\rdo.h" /> + <ClInclude Include="..\..\src\fast_coeff_cost.h" /> <ClInclude Include="..\..\src\sao.h" /> <ClInclude Include="..\..\src\scalinglist.h" /> <ClInclude Include="..\..\src\search.h" /> @@ -342,4 +344,4 @@ <ImportGroup Label="ExtensionTargets"> <Import Project="..\yasm\vsyasm.targets" /> </ImportGroup> -</Project> \ No newline at end of file +</Project>
View file
kvazaar-2.0.0.tar.gz/build/kvazaar_lib/kvazaar_lib.vcxproj.filters -> kvazaar-2.1.0.tar.gz/build/kvazaar_lib/kvazaar_lib.vcxproj.filters
Changed
@@ -174,6 +174,9 @@ <ClCompile Include="..\..\src\rdo.c"> <Filter>Compression</Filter> </ClCompile> + <ClCompile Include="..\..\src\fast_coeff_cost.c"> + <Filter>Compression</Filter> + </ClCompile> <ClCompile Include="..\..\src\inter.c"> <Filter>Reconstruction</Filter> </ClCompile> @@ -348,6 +351,9 @@ <ClInclude Include="..\..\src\rdo.h"> <Filter>Compression</Filter> </ClInclude> + <ClInclude Include="..\..\src\fast_coeff_cost.h"> + <Filter>Compression</Filter> + </ClInclude> <ClInclude Include="..\..\src\strategies\strategies-common.h"> <Filter>Optimization\strategies</Filter> </ClInclude> @@ -483,4 +489,4 @@ <Filter>Optimization\strategies\x86_asm</Filter> </YASM> </ItemGroup> -</Project> \ No newline at end of file +</Project>
View file
kvazaar-2.0.0.tar.gz/configure.ac -> kvazaar-2.1.0.tar.gz/configure.ac
Changed
@@ -23,7 +23,7 @@ # # Here is a somewhat sane guide to lib versioning: http://apr.apache.org/versioning.html ver_major=6 -ver_minor=2 +ver_minor=6 ver_release=0 # Prevents configure from adding a lot of defines to the CFLAGS
View file
kvazaar-2.0.0.tar.gz/doc/kvazaar.1 -> kvazaar-2.1.0.tar.gz/doc/kvazaar.1
Changed
@@ -1,4 +1,4 @@ -.TH KVAZAAR "1" "April 2020" "kvazaar v2.0.0" "User Commands" +.TH KVAZAAR "1" "October 2021" "kvazaar v2.1.0" "User Commands" .SH NAME kvazaar \- open source HEVC encoder .SH SYNOPSIS @@ -49,6 +49,12 @@ .TP \fB\-\-loop\-input Re\-read input file forever. +.TP +\fB\-\-input\-file\-format <string> +Input file format [auto] + \- auto: Check the file ending for format + \- y4m (skips frame headers) + \- yuv .SS "Options:" .TP @@ -94,6 +100,12 @@ \fB\-\-key <string> Encryption key [16,213,27,56,255,127,242,112, 97,126,197,204,25,59,38,30] +.TP +\fB\-\-stats\-file\-prefix +A prefix used for stats files that include +bits, lambda, distortion, and qp for each ctu. +These are meant for debugging and are not +written unless the prefix is defined. .SS "Video structure:" .TP @@ -315,6 +327,24 @@ Skip CABAC cost for residual coefficients when QP is below the limit. [0] .TP +\fB\-\-fast\-coeff\-table <string> +Read custom weights for residual + coefficients from a file instead of using + defaults [default] +.TP +\fB\-\-fast\-rd\-sampling +Enable learning data sampling for fast coefficient + table generation +.TP +\fB\-\-fastrd\-accuracy\-check +Evaluate the accuracy of fast coefficient + prediction +.TP +\fB\-\-fastrd\-outdir +Directory to which to output sampled data or accuracy + data, into <fastrd\-outdir>/0.txt to 50.txt, one file + for each QP that blocks were estimated on +.TP \fB\-\-(no\-)intra\-rdo\-et Check intra modes in rdo stage only until a zero coefficient CU is found. [disabled]
View file
kvazaar-2.1.0.tar.gz/examples
Added
+(directory)
View file
kvazaar-2.1.0.tar.gz/examples/README.md
Added
@@ -0,0 +1,14 @@ +Examples +======== +Examples of external files for use with Kvazaar. + +## Region of interest (roi) files +A simple text file can be used with the `--roi` switch to setup regions of interest for encoding. +Header row of the file will tell how many regions the encoded frames are divided (columns, rows). +The header must be followed by a data row with number entries equal to columns * rows. +The data row will tell the encoder which delta QP value will be assigned to each region. +The included example file will split frames into four regions with the top regions having a delta QP of +5 +``` +2 2 +5 5 0 0 +``` \ No newline at end of file
View file
kvazaar-2.1.0.tar.gz/examples/fast_coeff_table.txt
Added
@@ -0,0 +1,51 @@ +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.046152 4.874163 3.830968 6.617950 +0.040648 4.920004 3.922710 6.572261 +0.033854 4.982197 4.021474 6.518219 +0.027073 5.056451 4.082557 6.471514 +0.021064 5.125763 4.113825 6.436425 +0.016605 5.170554 4.119091 6.423091 +0.012953 5.196849 4.128659 6.422746 +0.010218 5.194947 4.166336 6.431305 +0.007970 5.177114 4.217242 6.429468 +0.006442 5.138598 4.275070 6.396064 +0.005184 5.093265 4.337876 6.352651 +0.004134 5.046189 4.413434 6.310742 +0.003239 5.001028 4.492965 6.264692 +0.002689 4.959881 4.569652 6.198468 +0.002280 4.920991 4.642861 6.123074 +0.001940 4.886799 4.709124 6.049688 +0.001631 4.858057 4.767754 5.986929 +0.001409 4.839546 4.813134 5.951025 +0.001223 4.823649 4.856675 5.933274 +0.001055 4.806288 4.904500 5.940060 +0.000899 4.789201 4.950018 5.955955 +0.000781 4.776673 4.981798 5.982144 +0.000683 4.766721 5.006732 6.019175 +0.000603 4.757364 5.030649 6.081959 +0.000529 4.746016 5.059187 6.158720 +0.000460 4.729670 5.100437 6.254217 +0.000397 4.711187 5.150631 6.364452 +0.000345 4.692304 5.213098 6.506122 +0.000300 4.674471 5.279962 6.667672 +0.000264 4.660182 5.342776 6.836979 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093 +0.000237 4.649543 5.392507 6.977093
View file
kvazaar-2.1.0.tar.gz/examples/roi.txt
Added
@@ -0,0 +1,2 @@ +2 2 +5 5 0 0 \ No newline at end of file
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool
Added
+(directory)
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/README.txt
Added
@@ -0,0 +1,35 @@ +To extract the block costs, build Kvazaar as usual, and edit relevant +parameters in the beginning of extract_rdcosts.py and run_filter.py, most +importantly the number of cores and the set of video sequences you want to +encode to extract costs. Run extract_rdcosts.py, it will use Kvazaar to encode +each sequence and extract the costs measured there for the quantized blocks. +The costs are stored compressed and sorted by block QP, in the following +format: + +Size (B) | Description +----------+------------ +4 | size: Coeff group size, in int16's +4 | ccc: Coeff group's coding cost +size * 2 | coeffs: Coeff group data + +To analyze the costs by running a linear regression over them, build the two +tools using: + +$ gcc filter_rdcosts.c -O2 -o frcosts_matrix +$ gcc ols_2ndpart.c -O2 -o ols_2ndpart + +Then run the regression in parallel by running run_filter.py. The reason to do +it this way is because the data is stored compressed, so there is no way to +mmap it in Matlab/Octave/something; the data sets are absolutely huge (larger +than reasonable amounts of RAM in a decent workstation), but this way we can +store the data compressed and process it in O(1) memory complexity, so it can +be done as widely parallelized as you have CPU cores. The result files each +consist of 4 numbers, which represent an approximate linear solution to the +corresponding set of costs: the price in bits of a coefficient whose absolute +value is a) 0, b) 1, c) 2, d) 3 or higher. + +After that, run rdcost_do_avg.py. It will calculate a per-QP average of the +costs over the set of the sequences having been run (ie. for each QP, take the +results for that QP for each sequence, and calculate their average). This data +is what you can use to fill in the default_fast_coeff_cost_wts table in +src/fast_coeff_cost.h.
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/build.sh
Added
@@ -0,0 +1,4 @@ +#!/bin/sh + +gcc -O2 filter_rdcosts.c -o frcosts_matrix +gcc -O2 ols_2ndpart.c -o ols_2ndpart
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/extract_rdcosts.py
Added
@@ -0,0 +1,166 @@ +#!/usr/bin/env python3 + +import glob +import gzip +import os +import subprocess +import threading +import time + +# Where logs and sampled data will wind up, and where the sequences are read. +# Do note that the sequences variable is supposed to be a tuple, because you +# could have multiple sets of sequences. +logdir = "/tmp/rdcost/logs" +ofdir = "/tmp/rdcost/data" +sequences = ("/opt/test_seqs/custom_seqs/*/*.yuv",) + +# Note that n_kvazaars * len(dest_qps) has to be less than the max number of +# fd's that a process can have (check it out: ulimit -a, likely 1024) +smt_threads = 8 # Kinda lazy, but just match this to your cpu +n_kvz_threads = 1 # How many threads each kvz instance is running? +n_kvazaars = smt_threads // n_kvz_threads + +# You likely will not need to change anything below this line +kvz_srcdir = lambda path: os.path.join( + os.path.dirname( + os.path.dirname( + os.path.realpath(__file__) + ) + ), "src", path) + + +dest_qps = tuple(range(51)) +base_qps = tuple(range(12, 43)) + +kvzargs = [kvz_srcdir("kvazaar"), "--threads", str(n_kvz_threads), "--preset=ultrafast", "--fastrd-sampling", "--fast-residual-cost=0"] +kvzenv = {"LD_LIBRARY_PATH": kvz_srcdir(".libs/")} + +class MultiPipeGZOutManager: + pipe_fn_template = "%02i.txt" + gzout_fn_template = "%02i.txt.gz" + + def __init__(self, odpath, dest_qps): + self.odpath = odpath + self.dest_qps = dest_qps + + self.pipe_fns = [] + self.gzout_fns = [] + for qp in dest_qps: + pipe_fn = os.path.join(self.odpath, self.pipe_fn_template % qp) + gzout_fn = os.path.join(self.odpath, self.gzout_fn_template % qp) + + self.pipe_fns.append(pipe_fn) + self.gzout_fns.append(gzout_fn) + + def __enter__(self): + os.makedirs(self.odpath, exist_ok=True) + for pipe_fn in self.pipe_fns: + try: + os.unlink(pipe_fn) + except FileNotFoundError: + pass + os.mkfifo(pipe_fn) + return self + + def __exit__(self, *_): + for pipe_fn in self.pipe_fns: + os.unlink(pipe_fn) + + def items(self): + for pipe_fn, gzout_fn in zip(self.pipe_fns, self.gzout_fns): + yield (pipe_fn, gzout_fn) + +class MTSafeIterable: + def __init__(self, iterable): + self.lock = threading.Lock() + self.iterable = iterable + + def __iter__(self): + return self + + def __next__(self): + with self.lock: + return next(self.iterable) + +def combinations(xi, yi): + for x in xi: + for y in yi: + yield (x, y) + +def chain(lol): + for l in lol: + for i in l: + yield i + +# Would've used Popen with gzip, but "gzip [fifo]" with an unconnected fifo +# will detect the situation and not block, but just consider it an empty +# file. Don't like it when tools outsmart their user.. +def do_gzip(in_fn, out_fn): + BLOCK_SZ = 65536 + PRINT_MULT = 1024 + with open(in_fn, "rb") as inf, gzip.open(out_fn, "wb") as outf: + num_read = 0 + print_next_thres = BLOCK_SZ * PRINT_MULT + while True: + block = inf.read(BLOCK_SZ) + num_read += len(block) + if (num_read >= print_next_thres): + print(" read %8i MB from %s" % (num_read / (1024 * 1024), in_fn)) + print_next_thres += BLOCK_SZ * PRINT_MULT + + if (len(block) == 0): + break + outf.write(block) + + print(" finished %8i MB from %s" % (num_read / (1024 * 1024), in_fn)) + +def run_job(job): + ifpath, qp = job + ifname = os.path.basename(ifpath) + + jobname = "%s-qp%i" % (ifname, qp) + hevcname = "%s.hevc" % jobname + logname = "%s.log" % jobname + odname = jobname + + hevcpath = os.path.join("/tmp", hevcname) + logpath = os.path.join(logdir, logname) + odpath = os.path.join(ofdir, odname) + + my_kvzargs = kvzargs + ["-i", ifpath, + "--qp", str(qp), + "-o", hevcpath, + "--fastrd-outdir", odpath] + + with open(logpath, "w") as lf: + with MultiPipeGZOutManager(odpath, dest_qps) as pipes_and_outputs: + gzip_threads = [] + for pipe_fn, out_fn in pipes_and_outputs.items(): + gzip_thread = threading.Thread(target=do_gzip, args=(pipe_fn, out_fn)) + gzip_thread.start() + gzip_threads.append(gzip_thread) + + kvz = subprocess.Popen(my_kvzargs, env=kvzenv, stderr=lf) + kvz.wait() + +def threadfunc(joblist): + for job in joblist: + run_job(job) + +def main(): + assert(isinstance(sequences, tuple)) + for d in (logdir, ofdir): + os.makedirs(d, exist_ok=True) + + jobs = combinations(chain(map(glob.glob, sequences)), base_qps) + joblist = MTSafeIterable(jobs) + + threads = [threading.Thread(target=threadfunc, args=(joblist,)) for _ in range(n_kvazaars)] + for thread in threads: + thread.start() + + for thread in threads: + thread.join() + +if (__name__ == "__main__"): + main()
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/filter_rdcosts.c
Added
@@ -0,0 +1,134 @@ +#include <assert.h> +#include <stdio.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + +#define BUFSZ (64 * 64 * sizeof(uint16_t)) +#define NUM_COEFF_BUCKETS (4) +#define NUM_OTHER_BUCKETS (0) +#define NUM_TOTAL_BUCKETS ((NUM_COEFF_BUCKETS) + (NUM_OTHER_BUCKETS)) +#define MAX_COEFF_BUCKET ((NUM_COEFF_BUCKETS) - 1) + +#define clz(x) __builtin_clz(x) +#define ilog2(x) (sizeof(x) * 8 - clz(x) - 1) + +void print_coeffs(const int16_t *buf, uint32_t size, uint32_t ccc) +{ + uint32_t i; + printf("Buf size %u, ccc %u\n", size, ccc); + for (i = 0; i < size; i++) + printf("%i ", buf[i]); + printf("\n"); +} + +void count_coeffs(const int16_t *buf, uint32_t size, uint64_t *buckets, uint64_t *num_signs, uint16_t *excess) +{ + *excess = 0; + uint32_t i; + + for (i = 0; i < size; i++) { + int16_t curr = buf[i]; + int16_t is_signed = curr >> 15; + *num_signs += (is_signed & 1); + + uint16_t abs = (curr ^ is_signed) - is_signed; + if (abs > MAX_COEFF_BUCKET) { + *excess += abs - MAX_COEFF_BUCKET; + abs = MAX_COEFF_BUCKET; + } + + buckets[abs]++; + } +} + +void print_buckets(const uint64_t *buckets, uint64_t num_signs) +{ + uint32_t i; + for (i = 0; i < NUM_COEFF_BUCKETS; i++) + printf("%3u: %lu\n", i, buckets[i]); + printf("Signs: %lu\n", num_signs); +} + +void update_matrix(const uint64_t *buckets, uint64_t *mat) +{ + for (int y = 0; y < NUM_TOTAL_BUCKETS; y++) { + for (int x = 0; x < NUM_TOTAL_BUCKETS; x++) { + int curr_pos = y * NUM_TOTAL_BUCKETS + x; + mat[curr_pos] += buckets[x] * buckets[y]; + } + } +} + +static inline int is_power_of_two(uint32_t u) +{ + return (u & (u - 1)) == 0; +} + +int process_rdcosts(FILE *in, FILE *out) +{ + void *buf = malloc(BUFSZ); + uint32_t *u32buf = (uint32_t *)buf; + int16_t *i16buf = (int16_t *)buf; + int rv = 0; + + float weights[NUM_TOTAL_BUCKETS] = {0.0f}; + + uint64_t mat[NUM_TOTAL_BUCKETS * NUM_TOTAL_BUCKETS] = {0}; + + while (!feof(in)) { + uint32_t size, ccc, size_sqrt; + uint64_t cg_buckets[NUM_TOTAL_BUCKETS] = {0}; + uint64_t cg_num_signs = 0; + uint16_t excess = 0; + size_t n_read; + + n_read = fread(buf, sizeof(uint32_t), 2, in); + size = u32buf[0]; + ccc = u32buf[1]; + + // Can't rely on feof() alone when reading from a pipe that might only get + // closed long after the last data has been poured in + if (n_read == 0) { + break; + } + if (feof(in) || n_read < 2) { + fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u u32's\n", n_read); + rv = 1; + goto out; + } + if (!is_power_of_two(size)) { + fprintf(stderr, "Errorneous block size %u\n", size); + rv = 1; + goto out; + } + + size_sqrt = 1 << (ilog2(size) >> 1); + n_read = fread(buf, sizeof(int16_t), size, in); + if (n_read != size) { + fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u i16's\n", n_read); + rv = 1; + goto out; + } + + count_coeffs(i16buf, size, cg_buckets, &cg_num_signs, &excess); + update_matrix(cg_buckets, mat); + } + for (int y = 0; y < NUM_TOTAL_BUCKETS; y++) { + for (int x = 0; x < NUM_TOTAL_BUCKETS; x++) { + int curr_pos = y * NUM_TOTAL_BUCKETS + x; + printf("%lu ", mat[curr_pos]); + } + printf("\n"); + } + fflush(stdout); + +out: + free(buf); + return rv; +} + +int main(int ar, char **av) +{ + return process_rdcosts(stdin, stdout); +}
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/invert_matrix.m
Added
@@ -0,0 +1,3 @@ +A = dlmread("/dev/stdin"); +B = inv(A); +dlmwrite("/dev/stdout", B, " ");
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/ols_2ndpart.c
Added
@@ -0,0 +1,132 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <stdint.h> + +#define BUFSZ (64 * 64 * sizeof(uint16_t)) +#define NUM_COEFF_BUCKETS (4) +#define NUM_OTHER_BUCKETS (0) +#define NUM_TOTAL_BUCKETS ((NUM_COEFF_BUCKETS) + (NUM_OTHER_BUCKETS)) +#ifdef ERR_SQUARED +#define STEPSIZE (0.00000001f * 0.000001f) +#else +#define STEPSIZE (0.00000001f) +#endif + +#define clz(x) __builtin_clz(x) +#define ilog2(x) (sizeof(x) * 8 - clz(x) - 1) +#define coord(x,y,w) ((x)+((y)*(w))) + +void update_result(const uint64_t *buckets, uint64_t ccc, const double *mat, double *res) +{ + for (int y = 0; y < NUM_TOTAL_BUCKETS; y++) { + double addend = 0.0; + for (int x = 0; x < NUM_TOTAL_BUCKETS; x++) { + addend += mat[coord(x, y, NUM_TOTAL_BUCKETS)] * (double)buckets[x]; + } + addend *= (double)ccc; + res[y] += addend; + } +} + +void read_matrix(const char *fn, double *mat) +{ + FILE *f = fopen(fn, "r"); + for (int y = 0; y < NUM_TOTAL_BUCKETS; y++) { + for (int x = 0; x < NUM_TOTAL_BUCKETS; x++) { + float curr; + fscanf(f, "%f", &curr); + mat[x + y * NUM_TOTAL_BUCKETS] = curr; + } + } + fclose(f); +} + +void count_coeffs(const int16_t *buf, uint32_t size, uint64_t *buckets, uint64_t *num_signs) +{ + uint32_t i; + for (i = 0; i < size; i++) { + int16_t curr = buf[i]; + int16_t is_signed = curr >> 15; + *num_signs += (is_signed & 1); + + uint16_t abs = (curr ^ is_signed) - is_signed; + if (abs >= NUM_COEFF_BUCKETS) + abs = NUM_COEFF_BUCKETS - 1; + + buckets[abs]++; + } +} + +static inline int is_power_of_two(uint32_t u) +{ + return (u & (u - 1)) == 0; +} + +int process_rdcosts(FILE *in, FILE *out, const double *mat) +{ + void *buf = malloc(BUFSZ); + uint32_t *u32buf = (uint32_t *)buf; + int16_t *i16buf = (int16_t *)buf; + int rv = 0; + + double res[NUM_TOTAL_BUCKETS] = {0.0}; + + while (!feof(in)) { + uint32_t size, ccc, size_sqrt; + uint64_t cg_buckets[NUM_TOTAL_BUCKETS] = {0}; + uint64_t cg_num_signs = 0; + size_t n_read; + + n_read = fread(buf, sizeof(uint32_t), 2, in); + size = u32buf[0]; + ccc = u32buf[1]; + + // Can't rely on feof() alone when reading from a pipe that might only get + // closed long after the last data has been poured in + if (n_read == 0) { + break; + } + if (feof(in) || n_read < 2) { + fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u u32's\n", n_read); + rv = 1; + goto out; + } + if (!is_power_of_two(size)) { + fprintf(stderr, "Errorneous block size %u\n", size); + rv = 1; + goto out; + } + + size_sqrt = 1 << (ilog2(size) >> 1); + + n_read = fread(buf, sizeof(int16_t), size, in); + if (n_read != size) { + fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u i16's\n", n_read); + rv = 1; + goto out; + } + + count_coeffs(i16buf, size, cg_buckets, &cg_num_signs); + update_result(cg_buckets, ccc, mat, res); + } + + for (int y = 0; y < NUM_TOTAL_BUCKETS; y++) + fprintf(out, "%g\n", (float)(res[y])); + +out: + free(buf); + return rv; +} + +int main(int ar, char **av) +{ + double mat[NUM_TOTAL_BUCKETS * NUM_TOTAL_BUCKETS] = {0.0}; + if (ar != 2) { + fprintf(stderr, "gib matrix plz\n"); + return 1; + } + read_matrix(av[1], mat); + return process_rdcosts(stdin, stdout, mat); +} +
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/rdcost_do_avg.py
Added
@@ -0,0 +1,38 @@ +#!/usr/bin/env python3 + +import glob +import sys + +result_path_template = "/tmp/rdcost/coeff_buckets/*-qp%02i.result" + +def main(): + results = [] + for qp in range(51): + curr_sums = [0.0] * 4 + curr_count = 0 + result_files = glob.glob(result_path_template % qp) + for fn in result_files: + with open(fn) as f: + contents = f.readlines() + if (len(contents) != 4): + print("Faulty file contents at %s, skipping" % fn, file=sys.stderr) + continue + nums = tuple(map(float, contents)) + if (all(n == 0.0 for n in nums)): + print("All-zero file %s, skipping" % fn) + continue + + curr_count += 1 + for i in range(len(curr_sums)): + curr_sums[i] += nums[i] + + if (curr_count > 0): + curr_avgs = tuple(curr_sum / curr_count for curr_sum in curr_sums) + else: + curr_avgs = (0, 0, 0, 0) + + results.append(curr_avgs) + print("\n".join(("QP %2i: " % i + ", ".join("%.6f" for _ in range(4)) % res for i, res in enumerate(results)))) + +if (__name__ == "__main__"): + main()
View file
kvazaar-2.1.0.tar.gz/rdcost-weight-tool/run_filter.py
Added
@@ -0,0 +1,154 @@ +#!/usr/bin/env python3 + +import glob +import gzip +import os +import re +import subprocess +import sys +import tempfile +import threading +import time + +# You should change these to your liking +n_threads = 8 +datadirs = "/tmp/rdcost/data/" +resultdir = "/tmp/rdcost/coeff_buckets" + +gzargs = ["gzip", "-d"] +filtargs = ["./frcosts_matrix"] +octargs = ["octave-cli", "invert_matrix.m"] +filt2args = ["./ols_2ndpart"] + +class MultiPipeManager: + pipe_fn_template = "%02i.txt" + + def __init__(self, odpath, dest_qps): + self.odpath = odpath + self.dest_qps = dest_qps + + self.pipe_fns = [] + for qp in dest_qps: + pipe_fn = os.path.join(self.odpath, self.pipe_fn_template % qp) + self.pipe_fns.append(pipe_fn) + + def __enter__(self): + os.makedirs(self.odpath, exist_ok=True) + for pipe_fn in self.pipe_fns: + try: + os.unlink(pipe_fn) + except FileNotFoundError: + pass + os.mkfifo(pipe_fn) + return self + + def __exit__(self, *_): + for pipe_fn in self.pipe_fns: + os.unlink(pipe_fn) + + def items(self): + for pipe_fn in self.pipe_fns: + yield pipe_fn + +class MTSafeIterable: + def __init__(self, iterable): + self.lock = threading.Lock() + self.iterable = iterable + + def __iter__(self): + return self + + def __next__(self): + with self.lock: + return next(self.iterable) + +def read_in_blocks(f): + BLOCK_SZ = 65536 + while True: + block = f.read(BLOCK_SZ) + if (len(block) == 0): + break + else: + yield block + +def exhaust_gzs(sink_f, gzs): + for gz in gzs: + with gzip.open(gz, "rb") as f: + if (gz == "/tmp/rdcost/data/RaceHorses_416x240_30.yuv-qp22/20.txt.gz"): + print("kjeh") + print(" Doing %s ..." % gz) + for block in read_in_blocks(f): + sink_f.write(block) + sink_f.flush() + +def run_job(jobname, input_gzs): + resultpath = os.path.join(resultdir, "%s.result" % jobname) + print("Running job %s" % jobname) + + with tempfile.NamedTemporaryFile() as tf: + filt = subprocess.Popen(filtargs, stdin=subprocess.PIPE, stdout=subprocess.PIPE) + octa = subprocess.Popen(octargs, stdin=filt.stdout, stdout=tf) + + try: + exhaust_gzs(filt.stdin, input_gzs) + except OSError as e: + print("OSError %s" % e, file=sys.stderr) + raise + + filt.stdin.close() + filt.wait() + octa.wait() + + if (filt.returncode != 0): + print("First stage failed: %s" % jobname, file=sys.stderr) + assert(0) + + with open(resultpath, "w") as rf: + f2a = filt2args + [tf.name] + f2 = subprocess.Popen(f2a, stdin=subprocess.PIPE, stdout=rf) + exhaust_gzs(f2.stdin, input_gzs) + f2.communicate() + if (filt.returncode != 0): + print("Second stage failed: %s" % jobname, file=sys.stderr) + assert(0) + + print("Job %s done" % jobname) + +def threadfunc(joblist): + for jobname, job in joblist: + run_job(jobname, job) + +def scan_datadirs(path): + seq_names = set() + for dirent in os.scandir(path): + if (not dirent.is_dir()): + continue + match = re.search("^([A-Za-z0-9_]+\.yuv)-qp[0-9]{1,2}$", dirent.name) + if (not match is None): + seq_name = match.groups()[0] + seq_names.add(seq_name) + + for seq_name in seq_names: + seq_glob = os.path.join(path, seq_name + "-qp*/") + + for qp in range(51): + job_name = seq_name + "-qp%02i" % qp + qp_fn = "%02i.txt.gz" % qp + yield job_name, glob.glob(os.path.join(seq_glob, qp_fn)) + +def main(): + for d in (datadirs, resultdir): + os.makedirs(d, exist_ok=True) + + jobs = scan_datadirs(datadirs) + joblist = MTSafeIterable(iter(jobs)) + + threads = [threading.Thread(target=threadfunc, args=(joblist,)) for _ in range(n_threads)] + for thread in threads: + thread.start() + + for thread in threads: + thread.join() + +if (__name__ == "__main__"): + main()
View file
kvazaar-2.0.0.tar.gz/src/Makefile.am -> kvazaar-2.1.0.tar.gz/src/Makefile.am
Changed
@@ -71,6 +71,8 @@ encoder_state-geometry.h \ encode_coding_tree.c \ encode_coding_tree.h \ + fast_coeff_cost.c \ + fast_coeff_cost.h \ filter.c \ filter.h \ global.h \
View file
kvazaar-2.0.0.tar.gz/src/bitstream.c -> kvazaar-2.1.0.tar.gz/src/bitstream.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "bitstream.h"
View file
kvazaar-2.0.0.tar.gz/src/bitstream.h -> kvazaar-2.1.0.tar.gz/src/bitstream.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/cabac.c -> kvazaar-2.1.0.tar.gz/src/cabac.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "cabac.h"
View file
kvazaar-2.0.0.tar.gz/src/cabac.h -> kvazaar-2.1.0.tar.gz/src/cabac.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/cfg.c -> kvazaar-2.1.0.tar.gz/src/cfg.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "cfg.h" @@ -73,6 +85,7 @@ cfg->vui.chroma_loc = 0; /* left center */ cfg->aud_enable = 0; cfg->cqmfile = NULL; + cfg->fast_coeff_table_fn = NULL; cfg->ref_frames = 1; cfg->gop_len = 4; cfg->gop_lowdelay = true; @@ -163,6 +176,13 @@ cfg->intra_bit_allocation = false; cfg->clip_neighbour = true; + cfg->file_format = KVZ_FORMAT_AUTO; + + cfg->stats_file_prefix = NULL; + + cfg->fastrd_sampling_on = 0; + cfg->fastrd_accuracy_check_on = 0; + cfg->fastrd_learning_outdir_fn = NULL; return 1; } @@ -170,11 +190,13 @@ { if (cfg) { FREE_POINTER(cfg->cqmfile); + FREE_POINTER(cfg->fast_coeff_table_fn); FREE_POINTER(cfg->tiles_width_split); FREE_POINTER(cfg->tiles_height_split); FREE_POINTER(cfg->slice_addresses_in_ts); FREE_POINTER(cfg->roi.dqps); FREE_POINTER(cfg->optional_key); + FREE_POINTER(cfg->fastrd_learning_outdir_fn); } free(cfg); @@ -448,8 +470,10 @@ static const char * const scaling_list_names[] = { "off", "custom", "default", NULL }; static const char * const rc_algorithm_names[] = { "no-rc", "lambda", "oba", NULL }; - static const char * const preset_values[11][25*2] = { + static const char * const file_format_names[] = {"auto", "y4m", "yuv", NULL}; + + static const char * const preset_values[11][25*2] = { { "ultrafast", "rd", "0", @@ -850,6 +874,30 @@ cfg->cqmfile = cqmfile; cfg->scaling_list = KVZ_SCALING_LIST_CUSTOM; } + else if OPT("fast-coeff-table") { + char* fast_coeff_table_fn = strdup(value); + if (!fast_coeff_table_fn) { + fprintf(stderr, "Failed to allocate memory for fast coeff table file name.\n"); + return 0; + } + FREE_POINTER(cfg->fast_coeff_table_fn); + cfg->fast_coeff_table_fn = fast_coeff_table_fn; + } + else if OPT("fastrd-sampling") { + cfg->fastrd_sampling_on = 1; + } + else if OPT("fastrd-accuracy-check") { + cfg->fastrd_accuracy_check_on = 1; + } + else if OPT("fastrd-outdir") { + char *fastrd_learning_outdir_fn = strdup(value); + if (!fastrd_learning_outdir_fn) { + fprintf(stderr, "Failed to allocate memory for fast RD learning outfile name.\n"); + return 0; + } + FREE_POINTER(cfg->fastrd_learning_outdir_fn); + cfg->fastrd_learning_outdir_fn = fastrd_learning_outdir_fn; + } else if OPT("scaling-list") { int8_t scaling_list = KVZ_SCALING_LIST_OFF; int result = parse_enum(value, scaling_list_names, &scaling_list); @@ -1359,6 +1407,20 @@ else if OPT("clip-neighbour") { cfg->clip_neighbour = atobool(value); } + else if OPT("input-file-format") { + int8_t file_format = 0; + if (!parse_enum(value, file_format_names, &file_format)) { + fprintf(stderr, "Invalid input file format %s. Valid values include %s, %s, and %s\n", value, + file_format_names[0], + file_format_names[1], + file_format_names[2]); + return 0; + } + cfg->file_format = file_format; + } + else if OPT("stats-file-prefix") { + cfg->stats_file_prefix = strdup(value); + } else { return 0; }
View file
kvazaar-2.0.0.tar.gz/src/cfg.h -> kvazaar-2.1.0.tar.gz/src/cfg.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/checkpoint.c -> kvazaar-2.1.0.tar.gz/src/checkpoint.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "checkpoint.h"
View file
kvazaar-2.0.0.tar.gz/src/checkpoint.h -> kvazaar-2.1.0.tar.gz/src/checkpoint.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/cli.c -> kvazaar-2.1.0.tar.gz/src/cli.c
Changed
@@ -1,22 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /* * \file @@ -47,7 +59,7 @@ { "input-fps", required_argument, NULL, 0 }, { "deblock", required_argument, NULL, 0 }, { "no-deblock", no_argument, NULL, 0 }, - { "sao", optional_argument, NULL, 0 }, + { "sao", required_argument, NULL, 0 }, { "no-sao", no_argument, NULL, 0 }, { "rdoq", no_argument, NULL, 0 }, { "no-rdoq", no_argument, NULL, 0 }, @@ -149,6 +161,12 @@ { "no-intra-bits", no_argument, NULL, 0 }, { "clip-neighbour", no_argument, NULL, 0 }, { "no-clip-neighbour", no_argument, NULL, 0 }, + { "input-file-format", required_argument, NULL, 0 }, + { "stats-file-prefix", required_argument, NULL, 0 }, + { "fast-coeff-table", required_argument, NULL, 0 }, + { "fastrd-sampling", no_argument, NULL, 0 }, + { "fastrd-accuracy-check", no_argument, NULL, 0 }, + { "fastrd-outdir", required_argument, NULL, 0 }, {0, 0, 0, 0} }; @@ -185,6 +203,32 @@ } /** +* \brief Try to detect file format from file name automatically +* +* \param file_name file name to get format from +* \return 0 (auto) if no format is detected, or id of the format +*/ +static int detect_file_format(const char *file_name) { + if (!file_name) return 0; + + // Find the last dot in the file name. + // If delim is not found, return 0 + char* sub_str = (char*)strrchr(file_name, '.'); + if (!sub_str) return 0; + if (strlen(sub_str) != 4) return 0; + char ending_lower_case[4]; + for(int i = 0; i < 4; i++){ + ending_lower_case[i] = tolower(sub_str[i]); + } + + // KVZ_FILE_FORMAT + if (strncmp(ending_lower_case, ".y4m", 4) == 0) return 1; + else if (strncmp(ending_lower_case, ".yuv", 4) == 0) return 2; + + return 0; +} + +/** * \brief Parse command line arguments. * \param argc Number of arguments * \param argv Argument list @@ -289,8 +333,14 @@ goto done; } + // Check the file name for format + if (opts->config->file_format == KVZ_FORMAT_AUTO) { + opts->config->file_format = detect_file_format(opts->input); + } + // Set resolution automatically if necessary - if (opts->config->width == 0 && opts->config->height == 0) { + if ((opts->config->file_format == KVZ_FORMAT_AUTO || opts->config->file_format == KVZ_FORMAT_YUV) + && opts->config->width == 0 && opts->config->height == 0) { ok = select_input_res_auto(opts->input, &opts->config->width, &opts->config->height); goto done; } @@ -333,7 +383,7 @@ { fprintf(stdout, "Kvazaar " VERSION_STRING "\n" - "Kvazaar license: LGPL version 2\n"); + "Kvazaar license: 3-clause BSD\n"); } @@ -370,6 +420,10 @@ " --input-format <string> : P420 or P400 [P420]\n" " --input-bitdepth <int> : 8-16 [8]\n" " --loop-input : Re-read input file forever.\n" + " --input-file-format <string> : Input file format [auto]\n" + " - auto: Check the file ending for format\n" + " - y4m (skips frame headers)\n" + " - yuv\n" "\n" /* Word wrap to this width to stay under 80 characters (including ") *************/ "Options:\n" @@ -396,6 +450,10 @@ " - intra_pred_modes: Intra prediction modes.\n" " --key <string> : Encryption key [16,213,27,56,255,127,242,112,\n" " 97,126,197,204,25,59,38,30]\n" + " --stats-file-prefix : A prefix used for stats files that include\n" + " bits, lambda, distortion, and qp for each ctu.\n" + " These are meant for debugging and are not\n" + " written unless the prefix is defined.\n" "\n" /* Word wrap to this width to stay under 80 characters (including ") *************/ "Video structure:\n" @@ -531,6 +589,16 @@ " - sensitive: Terminate even earlier.\n" " --fast-residual-cost <int> : Skip CABAC cost for residual coefficients\n" " when QP is below the limit. [0]\n" + " --fast-coeff-table <string> : Read custom weights for residual\n" + " coefficients from a file instead of using\n" + " defaults [default]\n" + " --fast-rd-sampling : Enable learning data sampling for fast coefficient\n" + " table generation\n" + " --fastrd-accuracy-check : Evaluate the accuracy of fast coefficient\n" + " prediction\n" + " --fastrd-outdir : Directory to which to output sampled data or accuracy\n" + " data, into <fastrd-outdir>/0.txt to 50.txt, one file\n" + " for each QP that blocks were estimated on\n" " --(no-)intra-rdo-et : Check intra modes in rdo stage only until\n" " a zero coefficient CU is found. [disabled]\n" " --(no-)early-skip : Try to find skip cu from merge candidates.\n"
View file
kvazaar-2.0.0.tar.gz/src/cli.h -> kvazaar-2.1.0.tar.gz/src/cli.h
Changed
@@ -1,24 +1,36 @@ #ifndef CLI_H_ #define CLI_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \file
View file
kvazaar-2.0.0.tar.gz/src/constraint.c -> kvazaar-2.1.0.tar.gz/src/constraint.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "constraint.h"
View file
kvazaar-2.0.0.tar.gz/src/constraint.h -> kvazaar-2.1.0.tar.gz/src/constraint.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "ml_intra_cu_depth_pred.h"
View file
kvazaar-2.0.0.tar.gz/src/context.c -> kvazaar-2.1.0.tar.gz/src/context.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "context.h"
View file
kvazaar-2.0.0.tar.gz/src/context.h -> kvazaar-2.1.0.tar.gz/src/context.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/cu.c -> kvazaar-2.1.0.tar.gz/src/cu.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include <string.h>
View file
kvazaar-2.0.0.tar.gz/src/cu.h -> kvazaar-2.1.0.tar.gz/src/cu.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/encmain.c -> kvazaar-2.1.0.tar.gz/src/encmain.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /* @@ -200,7 +212,7 @@ args->opts->config->height, args->encoder->cfg.input_bitdepth, args->encoder->bitdepth, - frame_in); + frame_in, args->opts->config->file_format); if (!read_success) { // reading failed if (feof(args->input)) { @@ -219,7 +231,7 @@ args->opts->config->height, args->encoder->cfg.input_bitdepth, args->encoder->bitdepth, - frame_in); + frame_in, args->opts->config->file_format); if (!read_success) { fprintf(stderr, "Could not re-open input file, shutting down!\n"); retval = RETVAL_FAILURE; @@ -266,7 +278,11 @@ // Do some cleaning up. args->api->picture_free(frame_in); + // This thread exit call causes problems with media auto-build suite + // The environment compiles with MINGW using a different pthreads lib + #if !defined(__MINGW32__) && !defined(__MINGW64__) pthread_exit(NULL); + #endif return NULL; } @@ -311,6 +327,92 @@ } /** +* \brief Reads the information in y4m header +* +* \param input Pointer to the input file +* \param config Pointer to the config struct +*/ +static bool read_header(FILE* input, kvz_config* config) { + char buffer[256]; + bool end_of_header = false; + + while(!end_of_header) { + for (int i = 0; i < 256; i++) { + buffer[i] = getc(input); + // Start code of frame data + if (buffer[i] == 0x0A) { + for (; i > 0; i--) { + ungetc(buffer[i], input); + } + end_of_header = true; + break; + } + // Header sections are separated by space (ascii 0x20) + if (buffer[i] == 0x20) { + // Header start sequence does not hold any addition information, so it can be skipped + if ((i == 9) && strncmp(buffer, "YUV4MPEG2 ", 10) == 0) { + break; + } + switch (buffer[0]) { + // Width + case 'W': + // Exclude starting 'W' and the space at the end with substr + config->width = atoi(&buffer[1]); + break; + // Height + case 'H': + // Exclude starting 'H' and the space at the end with substr + config->height = atoi(&buffer[1]); + break; + // Framerate (or start code of frame) + case 'F': + // The header has no ending signature other than the start code of a frame + if (i > 5 && strncmp(buffer, "FRAME", 5) == 0) { + for (; i > 0; i--) { + ungetc(buffer[i], input); + } + end_of_header = true; + break; + } + else { + config->framerate_num = atoi(&buffer[1]); + for (int j = 0; j < i; j++) { + if (buffer[j] == ':') { + config->framerate_denom = atoi(&buffer[j + 1]); + } + } + break; + } + // Interlacing + case 'I': + break; + // Aspect ratio + case 'A': + break; + // Colour space + case 'C': + break; + // Comment + case 'X': + break; + default: + fprintf(stderr, "Unknown header argument starting with '%i'\n", buffer[0]); + break; + } + break; + } + } + } + + if (config->width == 0 || config->height == 0 || config->framerate_num == 0 || config->framerate_denom == 0) { + fprintf(stderr, "Failed to read necessary info from y4m headers. Width, height and frame rate must be present in the headers.\n"); + return false; + } + + return true; +} + +/** * \brief Program main function. * \param argc Argument count from commandline * \param argv Argument list @@ -409,6 +511,13 @@ } } + // Parse headers if input data is in y4m container + if (opts->config->file_format == KVZ_FORMAT_Y4M) { + if (!read_header(input, opts->config)) { + goto exit_failure; + } + } + enc = api->encoder_open(opts->config); if (!enc) { fprintf(stderr, "Failed to open encoder.\n"); @@ -422,7 +531,7 @@ encoder->in.width, encoder->in.height, encoder->in.real_width, encoder->in.real_height); - if (opts->seek > 0 && !yuv_io_seek(input, opts->seek, opts->config->width, opts->config->height)) { + if (opts->seek > 0 && !yuv_io_seek(input, opts->seek, opts->config->width, opts->config->height, opts->config->file_format)) { fprintf(stderr, "Failed to seek %d frames.\n", opts->seek); goto exit_failure; }
View file
kvazaar-2.0.0.tar.gz/src/encode_coding_tree.c -> kvazaar-2.1.0.tar.gz/src/encode_coding_tree.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encode_coding_tree.h" @@ -25,6 +37,7 @@ #include "cu.h" #include "encoder.h" #include "extras/crypto.h" +#include "global.h" #include "imagelist.h" #include "inter.h" #include "intra.h" @@ -269,8 +282,9 @@ if (state->must_code_qp_delta) { const int qp_pred = kvz_get_cu_ref_qp(state, x_cu, y_cu, state->last_qp); const int qp_delta = cur_cu->qp - qp_pred; - assert(KVZ_BIT_DEPTH == 8 && "This range applies only to 8-bit encoding."); - assert(qp_delta >= -26 && qp_delta <= 25 && "QP delta not in valid range [-26, 25]."); // This range applies only to 8-bit encoding + // Possible deltaQP range depends on bit depth as stated in HEVC specification. + assert(qp_delta >= KVZ_QP_DELTA_MIN && qp_delta <= KVZ_QP_DELTA_MAX && "QP delta not in valid range."); + const int qp_delta_abs = ABS(qp_delta); cabac_data_t* cabac = &state->cabac;
View file
kvazaar-2.0.0.tar.gz/src/encode_coding_tree.h -> kvazaar-2.1.0.tar.gz/src/encode_coding_tree.h
Changed
@@ -4,21 +4,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/encoder.c -> kvazaar-2.1.0.tar.gz/src/encoder.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encoder.h" @@ -28,9 +40,10 @@ #include "cfg.h" #include "gop.h" +#include "rdo.h" #include "strategyselector.h" #include "kvz_math.h" - +#include "fast_coeff_cost.h" /** * \brief Strength of QP adjustments when using adaptive QP for 360 video. @@ -232,6 +245,7 @@ encoder->cfg.tiles_width_split = NULL; encoder->cfg.tiles_height_split = NULL; encoder->cfg.slice_addresses_in_ts = NULL; + encoder->cfg.fast_coeff_table_fn = NULL; if (encoder->cfg.gop_len > 0) { if (encoder->cfg.gop_lowdelay) { @@ -244,7 +258,8 @@ } if( encoder->cfg.intra_qp_offset_auto ) { - encoder->cfg.intra_qp_offset = encoder->cfg.gop_len > 1 ? -kvz_math_ceil_log2( encoder->cfg.gop_len ) + 1 : 0; + // Limit offset to -3 since HM/VTM seems to use it even for 32 frame gop + encoder->cfg.intra_qp_offset = encoder->cfg.gop_len > 1 ? MAX(-(int8_t)kvz_math_ceil_log2( encoder->cfg.gop_len ) + 1, -3) : 0; } // Disable GOP and QP offset for all-intra coding @@ -338,6 +353,31 @@ encoder->scaling_list.use_default_list = 1; } + if (cfg->fast_coeff_table_fn) { + FILE *fast_coeff_table_f = fopen(cfg->fast_coeff_table_fn, "rb"); + if (fast_coeff_table_f == NULL) { + fprintf(stderr, "Could not open fast coeff table file.\n"); + goto init_failed; + } + if (kvz_fast_coeff_table_parse(&encoder->fast_coeff_table, fast_coeff_table_f) != 0) { + fprintf(stderr, "Failed to parse fast coeff table, using default\n"); + kvz_fast_coeff_use_default_table(&encoder->fast_coeff_table); + } + fclose(fast_coeff_table_f); + } else { + kvz_fast_coeff_use_default_table(&encoder->fast_coeff_table); + } + + if (cfg->fastrd_sampling_on || cfg->fastrd_accuracy_check_on) { + if (cfg->fastrd_learning_outdir_fn == NULL) { + fprintf(stderr, "No output file defined for Fast RD sampling or accuracy check.\n"); + goto init_failed; + } + if (kvz_init_rdcost_outfiles(cfg->fastrd_learning_outdir_fn) != 0) { + goto init_failed; + } + } + kvz_scalinglist_process(&encoder->scaling_list, encoder->bitdepth); kvz_encoder_control_input_init(encoder, encoder->cfg.width, encoder->cfg.height); @@ -692,6 +732,8 @@ kvz_threadqueue_free(encoder->threadqueue); encoder->threadqueue = NULL; + kvz_close_rdcost_outfiles(); + free(encoder); }
View file
kvazaar-2.0.0.tar.gz/src/encoder.h -> kvazaar-2.1.0.tar.gz/src/encoder.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -30,7 +42,7 @@ #include "kvazaar.h" #include "scalinglist.h" #include "threadqueue.h" - +#include "fast_coeff_cost.h" /* Encoder control options, the main struct */ typedef struct encoder_control_t @@ -135,6 +147,8 @@ int32_t poc_lsb_bits; + fast_coeff_table_t fast_coeff_table; + } encoder_control_t; encoder_control_t* kvz_encoder_control_init(const kvz_config *cfg);
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-bitstream.c -> kvazaar-2.1.0.tar.gz/src/encoder_state-bitstream.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encoder_state-bitstream.h" @@ -100,6 +112,7 @@ #ifdef KVZ_DEBUG printf("=========== Video Parameter Set ID: 0 ===========\n"); #endif + const encoder_control_t* encoder = state->encoder_control; WRITE_U(stream, 0, 4, "vps_video_parameter_set_id"); WRITE_U(stream, 3, 2, "vps_reserved_three_2bits" ); @@ -112,12 +125,18 @@ WRITE_U(stream, 0, 1, "vps_sub_layer_ordering_info_present_flag"); - //for each layer - for (int i = 0; i < 1; i++) { - WRITE_UE(stream, 1, "vps_max_dec_pic_buffering"); - WRITE_UE(stream, 0, "vps_num_reorder_pics"); - WRITE_UE(stream, 0, "vps_max_latency_increase"); + if (encoder->cfg.gop_lowdelay) { + const int dpb = encoder->cfg.ref_frames; + WRITE_UE(stream, dpb - 1, "vps_max_dec_pic_buffering_minus1"); + WRITE_UE(stream, 0, "vps_max_num_reorder_pics"); + } + else { + // Clip to non-negative values to prevent problems with GOP=0 + const int dpb = MIN(16, encoder->cfg.gop_len); + WRITE_UE(stream, MAX(dpb - 1, 0), "vps_max_dec_pic_buffering_minus1"); + WRITE_UE(stream, MAX(encoder->cfg.gop_len - 1, 0), "vps_max_num_reorder_pics"); } + WRITE_UE(stream, 0, "vps_max_latency_increase"); WRITE_U(stream, 0, 6, "vps_max_nuh_reserved_zero_layer_id"); WRITE_UE(stream, 0, "vps_max_op_sets_minus1"); @@ -1064,11 +1083,12 @@ state->frame->total_bits_coded = state->previous_encoder_state->frame->total_bits_coded; } state->frame->total_bits_coded += newpos - curpos; - if(state->encoder_control->cfg.rc_algorithm == KVZ_OBA) { + if(state->encoder_control->cfg.rc_algorithm == KVZ_OBA || state->encoder_control->cfg.stats_file_prefix) { kvz_update_after_picture(state); } - state->frame->cur_gop_bits_coded = state->previous_encoder_state->frame->cur_gop_bits_coded; + if(state->frame->gop_offset) + state->frame->cur_gop_bits_coded = state->previous_encoder_state->frame->cur_gop_bits_coded; state->frame->cur_gop_bits_coded += newpos - curpos; }
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-bitstream.h -> kvazaar-2.1.0.tar.gz/src/encoder_state-bitstream.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-ctors_dtors.c -> kvazaar-2.1.0.tar.gz/src/encoder_state-ctors_dtors.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encoder_state-ctors_dtors.h"
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-ctors_dtors.h -> kvazaar-2.1.0.tar.gz/src/encoder_state-ctors_dtors.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-geometry.c -> kvazaar-2.1.0.tar.gz/src/encoder_state-geometry.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encoder_state-geometry.h"
View file
kvazaar-2.0.0.tar.gz/src/encoder_state-geometry.h -> kvazaar-2.1.0.tar.gz/src/encoder_state-geometry.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/encoderstate.c -> kvazaar-2.1.0.tar.gz/src/encoderstate.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "encoderstate.h"
View file
kvazaar-2.0.0.tar.gz/src/encoderstate.h -> kvazaar-2.1.0.tar.gz/src/encoderstate.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -64,6 +76,8 @@ //! \brief Lambda value which was used for this LCU double lambda; + double adjust_lambda; + //! \brief Rate control alpha parameter double rc_alpha; @@ -73,6 +87,7 @@ int i_cost; int8_t qp; + int8_t adjust_qp; uint8_t skipped; } lcu_stats_t;
View file
kvazaar-2.1.0.tar.gz/src/estimate.m
Added
@@ -0,0 +1,5 @@ +data = dlmread("/dev/stdin", " "); +coeffs = data(1:end, 1:5); +costs = data(1:end, 6); +[beta, sigma, r] = ols(costs, coeffs); +disp(beta)
View file
kvazaar-2.1.0.tar.gz/src/fast_coeff_cost.c
Added
@@ -0,0 +1,88 @@ +/***************************************************************************** + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ + +#include "fast_coeff_cost.h" +#include "kvazaar.h" +#include "encoderstate.h" + +// Note: Assumes that costs are non-negative, for pretty obvious reasons +static uint16_t to_q88(float f) +{ + return (uint16_t)(f * 256.0f + 0.5f); +} + +static uint64_t to_4xq88(const float f[4]) +{ + int i; + uint64_t result = 0; + + for (i = 3; i >= 0; i--) { + result <<= 16; + result |= to_q88(f[i]); + } + return result; +} + +int kvz_fast_coeff_table_parse(fast_coeff_table_t *fast_coeff_table, FILE *fast_coeff_table_f) +{ + int i; + uint64_t *wts_by_qp = fast_coeff_table->wts_by_qp; + + for (i = 0; i < MAX_FAST_COEFF_COST_QP; i++) { + float curr_wts[4]; + + if (fscanf(fast_coeff_table_f, "%f %f %f %f\n", curr_wts + 0, + curr_wts + 1, + curr_wts + 2, + curr_wts + 3) != 4) { + return 1; + } + wts_by_qp[i] = to_4xq88(curr_wts); + } + return 0; +} + +void kvz_fast_coeff_use_default_table(fast_coeff_table_t *fast_coeff_table) +{ + int i; + uint64_t *wts_by_qp = fast_coeff_table->wts_by_qp; + + for (i = 0; i < MAX_FAST_COEFF_COST_QP; i++) { + wts_by_qp[i] = to_4xq88(default_fast_coeff_cost_wts[i]); + } +} + +uint64_t kvz_fast_coeff_get_weights(const encoder_state_t *state) +{ + const fast_coeff_table_t *table = &(state->encoder_control->fast_coeff_table); + return table->wts_by_qp[state->qp]; +}
View file
kvazaar-2.1.0.tar.gz/src/fast_coeff_cost.h
Added
@@ -0,0 +1,110 @@ +/***************************************************************************** + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ + +#ifndef FAST_COEFF_COST_H_ +#define FAST_COEFF_COST_H_ + +#include <stdio.h> +#include "kvazaar.h" +// #include "encoderstate.h" + +#define MAX_FAST_COEFF_COST_QP 50 + +typedef struct { + uint64_t wts_by_qp[MAX_FAST_COEFF_COST_QP]; +} fast_coeff_table_t; + +// Weights for 4 buckets (coeff 0, coeff 1, coeff 2, coeff >= 3), for QPs from +// 0 to MAX_FAST_COEFF_COST_QP +static const float default_fast_coeff_cost_wts[][4] = { + // Just extend it by stretching the first actual values.. + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.164240, 4.161530, 3.509033, 6.928047}, + // up to here + {0.164240, 4.161530, 3.509033, 6.928047}, + {0.162844, 4.055940, 3.564467, 6.861493}, + {0.128729, 4.311973, 3.942837, 6.935403}, + {0.110956, 4.433190, 3.945753, 6.877697}, + {0.095026, 4.483547, 4.194173, 6.781540}, + {0.075046, 4.633703, 4.084193, 6.698600}, + {0.052426, 4.967223, 4.027210, 6.549197}, + {0.040219, 5.141820, 3.982650, 6.461557}, + {0.035090, 5.192493, 3.830950, 6.418477}, + {0.029845, 5.211647, 3.815457, 6.345440}, + {0.023522, 5.322213, 3.816537, 6.360677}, + {0.021305, 5.225923, 3.842700, 6.325787}, + {0.015878, 5.183090, 3.956003, 6.329680}, + {0.010430, 5.099230, 4.176803, 6.305400}, + {0.008433, 5.030257, 4.237587, 6.270133}, + {0.006500, 4.969247, 4.339397, 6.217827}, + {0.004929, 4.923500, 4.442413, 6.183523}, + {0.003715, 4.915583, 4.429090, 6.125320}, + {0.003089, 4.883907, 4.562790, 6.156447}, + {0.002466, 4.881063, 4.629883, 6.142643}, + {0.002169, 4.882493, 4.646313, 6.127663}, + {0.002546, 4.793337, 4.837413, 6.199270}, + {0.001314, 4.808853, 4.828337, 6.243437}, + {0.001154, 4.862603, 4.846883, 6.205523}, + {0.000984, 4.866403, 4.859330, 6.240893}, + {0.000813, 4.856633, 4.924527, 6.293413}, + {0.001112, 4.789260, 5.009880, 6.433540}, + {0.000552, 4.760747, 5.090447, 6.599380}, + {0.000391, 4.961447, 5.111033, 6.756370}, + {0.000332, 4.980953, 5.138127, 6.867420}, + {0.000201, 5.181957, 4.740160, 6.460997}, + {0.000240, 5.185390, 4.874840, 6.819093}, + {0.000130, 5.270350, 4.734213, 6.826240}, + {0.000104, 5.371937, 4.595087, 6.659253}, + {0.000083, 5.362000, 4.617470, 6.837770}, + {0.000069, 5.285997, 4.754993, 7.159043}, + {0.000049, 5.488470, 4.396107, 6.727357}, + {0.000058, 4.958940, 4.580460, 6.477740}, + {0.000028, 5.521253, 4.440493, 7.205017}, + {0.000000, 0.000000, 0.000000, 0.000000}, + {0.000019, 5.811260, 4.399110, 7.336310}, +}; + +typedef struct encoder_state_t encoder_state_t; + +int kvz_fast_coeff_table_parse(fast_coeff_table_t *fast_coeff_table, FILE *fast_coeff_table_f); +void kvz_fast_coeff_use_default_table(fast_coeff_table_t *fast_coeff_table); +uint64_t kvz_fast_coeff_get_weights(const encoder_state_t *state); + +#endif // FAST_COEFF_COST_H_
View file
kvazaar-2.0.0.tar.gz/src/filter.c -> kvazaar-2.1.0.tar.gz/src/filter.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "filter.h"
View file
kvazaar-2.0.0.tar.gz/src/filter.h -> kvazaar-2.1.0.tar.gz/src/filter.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/global.h -> kvazaar-2.1.0.tar.gz/src/global.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -206,7 +218,7 @@ // NOTE: When making a release, check to see if incrementing libversion in // configure.ac is necessary. #ifndef KVZ_VERSION -#define KVZ_VERSION 2.0.0 +#define KVZ_VERSION 2.1.0 #endif #define VERSION_STRING QUOTE_EXPAND(KVZ_VERSION) @@ -349,4 +361,8 @@ # define COMPILE_ARM 0 #endif +// Min & max delta QP limits based on bit depth +#define KVZ_QP_DELTA_MIN -(26 + 3 * (KVZ_BIT_DEPTH - 8)) +#define KVZ_QP_DELTA_MAX 25 + 3 * (KVZ_BIT_DEPTH - 8) + #endif
View file
kvazaar-2.0.0.tar.gz/src/gop.h -> kvazaar-2.1.0.tar.gz/src/gop.h
Changed
@@ -1,24 +1,36 @@ #ifndef GOP_H_ #define GOP_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2018 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ #include <kvazaar.h>
View file
kvazaar-2.0.0.tar.gz/src/image.c -> kvazaar-2.1.0.tar.gz/src/image.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "image.h" @@ -477,33 +489,46 @@ ref->stride) >> (KVZ_BIT_DEPTH - 8); } else { // Extrapolate pixels from outside the frame. - kvz_extended_block block; - kvz_get_extended_block(pic_x, - pic_y, - ref_x - pic_x, - ref_y - pic_y, - 0, - 0, - ref->y, - ref->width, - ref->height, - 0, - block_width, - block_height, - &block); + + // Space for extrapolated pixels and the part from the picture + // The extrapolation function will set the pointers and stride. + kvz_pixel ext_buffer[LCU_LUMA_SIZE]; + kvz_pixel *ext = NULL; + kvz_pixel *ext_origin = NULL; + int ext_s = 0; + kvz_epol_args epol_args = { + .src = ref->y, + .src_w = ref->width, + .src_h = ref->height, + .src_s = ref->stride, + .blk_x = ref_x, + .blk_y = ref_y, + .blk_w = block_width, + .blk_h = block_height, + .pad_l = 0, + .pad_r = 0, + .pad_t = 0, + .pad_b = 0, + .pad_b_simd = 0, + }; + + // Initialize separately. Gets rid of warning + // about using nonstandard extension. + epol_args.buf = ext_buffer; + epol_args.ext = &ext; + epol_args.ext_origin = &ext_origin; + epol_args.ext_s = &ext_s; + + kvz_get_extended_block(&epol_args); const kvz_pixel *pic_data = &pic->y[pic_y * pic->stride + pic_x]; unsigned satd = kvz_satd_any_size(block_width, - block_height, - pic_data, - pic->stride, - block.buffer, - block.stride) >> (KVZ_BIT_DEPTH - 8); - - if (block.malloc_used) { - FREE_POINTER(block.buffer); - } + block_height, + pic_data, + pic->stride, + ext_origin, + ext_s) >> (KVZ_BIT_DEPTH - 8); return satd; }
View file
kvazaar-2.0.0.tar.gz/src/image.h -> kvazaar-2.1.0.tar.gz/src/image.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/imagelist.c -> kvazaar-2.1.0.tar.gz/src/imagelist.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "imagelist.h"
View file
kvazaar-2.0.0.tar.gz/src/imagelist.h -> kvazaar-2.1.0.tar.gz/src/imagelist.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/input_frame_buffer.c -> kvazaar-2.1.0.tar.gz/src/input_frame_buffer.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "input_frame_buffer.h" @@ -183,7 +195,7 @@ dts_out = buf->pts_buffer[dts_idx % gop_buf_size] + buf->delay; } else { int dts_idx = buf->num_out - (cfg->gop_len - 1); - dts_out = buf->pts_buffer[dts_idx % gop_buf_size]; + dts_out = buf->pts_buffer[dts_idx % gop_buf_size] - 1; } } else {
View file
kvazaar-2.0.0.tar.gz/src/input_frame_buffer.h -> kvazaar-2.1.0.tar.gz/src/input_frame_buffer.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/inter.c -> kvazaar-2.1.0.tar.gz/src/inter.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "inter.h" @@ -40,224 +52,258 @@ } merge_candidates_t; -static void inter_recon_frac_luma(const encoder_state_t * const state, - const kvz_picture * const ref, - int32_t xpos, - int32_t ypos, - int32_t block_width, - int32_t block_height, - const int16_t mv_param[2], - lcu_t *lcu) +static void inter_recon_frac_luma(const encoder_state_t *const state, + const kvz_picture *const ref, + int32_t xpos, + int32_t ypos, + int32_t block_width, + int32_t block_height, + const int16_t mv_param[2], + lcu_t *lcu) { int mv_frac_x = (mv_param[0] & 3); int mv_frac_y = (mv_param[1] & 3); - // Fractional luma 1/4-pel - kvz_extended_block src = {0, 0, 0, 0}; - - // Fractional luma - kvz_get_extended_block(xpos, - ypos, - mv_param[0] >> 2, - mv_param[1] >> 2, - state->tile->offset_x, - state->tile->offset_y, - ref->y, - ref->width, - ref->height, - KVZ_LUMA_FILTER_TAPS, - block_width, - block_height, - &src); + // Space for extrapolated pixels and the part from the picture. + // Some extra for AVX2. + // The extrapolation function will set the pointers and stride. + kvz_pixel ext_buffer[KVZ_IPOL_MAX_INPUT_SIZE_LUMA_SIMD]; + kvz_pixel *ext = NULL; + kvz_pixel *ext_origin = NULL; + int ext_s = 0; + kvz_epol_args epol_args = { + .src = ref->y, + .src_w = ref->width, + .src_h = ref->height, + .src_s = ref->stride, + .blk_x = state->tile->offset_x + xpos + (mv_param[0] >> 2), + .blk_y = state->tile->offset_y + ypos + (mv_param[1] >> 2), + .blk_w = block_width, + .blk_h = block_height, + .pad_l = KVZ_LUMA_FILTER_OFFSET, + .pad_r = KVZ_EXT_PADDING_LUMA - KVZ_LUMA_FILTER_OFFSET, + .pad_t = KVZ_LUMA_FILTER_OFFSET, + .pad_b = KVZ_EXT_PADDING_LUMA - KVZ_LUMA_FILTER_OFFSET, + .pad_b_simd = 1 // One row for AVX2 + }; + + // Initialize separately. Gets rid of warning + // about using nonstandard extension. + epol_args.buf = ext_buffer; + epol_args.ext = &ext; + epol_args.ext_origin = &ext_origin; + epol_args.ext_s = &ext_s; + + kvz_get_extended_block(&epol_args); kvz_sample_quarterpel_luma(state->encoder_control, - src.orig_topleft, - src.stride, - block_width, - block_height, - lcu->rec.y + (ypos % LCU_WIDTH) * LCU_WIDTH + (xpos % LCU_WIDTH), - LCU_WIDTH, - mv_frac_x, - mv_frac_y, - mv_param); - - if (src.malloc_used) free(src.buffer); + ext_origin, + ext_s, + block_width, + block_height, + lcu->rec.y + (ypos % LCU_WIDTH) * LCU_WIDTH + (xpos % LCU_WIDTH), + LCU_WIDTH, + mv_frac_x, + mv_frac_y, + mv_param); } -static void inter_recon_14bit_frac_luma(const encoder_state_t * const state, - const kvz_picture * const ref, - int32_t xpos, - int32_t ypos, - int32_t block_width, - int32_t block_height, - const int16_t mv_param[2], - hi_prec_buf_t *hi_prec_out) +static void inter_recon_frac_luma_hi(const encoder_state_t *const state, + const kvz_picture *const ref, + int32_t xpos, + int32_t ypos, + int32_t block_width, + int32_t block_height, + const int16_t mv_param[2], + hi_prec_buf_t *hi_prec_out) { int mv_frac_x = (mv_param[0] & 3); int mv_frac_y = (mv_param[1] & 3); - // Fractional luma 1/4-pel - kvz_extended_block src = { 0, 0, 0, 0 }; - - // Fractional luma - kvz_get_extended_block(xpos, - ypos, - mv_param[0] >> 2, - mv_param[1] >> 2, - state->tile->offset_x, - state->tile->offset_y, - ref->y, - ref->width, - ref->height, - KVZ_LUMA_FILTER_TAPS, - block_width, - block_height, - &src); - kvz_sample_14bit_quarterpel_luma(state->encoder_control, - src.orig_topleft, - src.stride, - block_width, - block_height, - hi_prec_out->y + (ypos % LCU_WIDTH) * LCU_WIDTH + (xpos % LCU_WIDTH), - LCU_WIDTH, - mv_frac_x, - mv_frac_y, - mv_param); - - if (src.malloc_used) free(src.buffer); + // Space for extrapolated pixels and the part from the picture. + // Some extra for AVX2. + // The extrapolation function will set the pointers and stride. + kvz_pixel ext_buffer[KVZ_IPOL_MAX_INPUT_SIZE_LUMA_SIMD]; + kvz_pixel *ext = NULL; + kvz_pixel *ext_origin = NULL; + int ext_s = 0;
View file
kvazaar-2.0.0.tar.gz/src/inter.h -> kvazaar-2.1.0.tar.gz/src/inter.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/intra.c -> kvazaar-2.1.0.tar.gz/src/intra.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "intra.h"
View file
kvazaar-2.0.0.tar.gz/src/intra.h -> kvazaar-2.1.0.tar.gz/src/intra.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/kvazaar.c -> kvazaar-2.1.0.tar.gz/src/kvazaar.c
Changed
@@ -1,22 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ #include "kvazaar.h"
View file
kvazaar-2.0.0.tar.gz/src/kvazaar.h -> kvazaar-2.1.0.tar.gz/src/kvazaar.h
Changed
@@ -1,24 +1,36 @@ #ifndef KVAZAAR_H_ #define KVAZAAR_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \ingroup Control @@ -27,6 +39,7 @@ */ #include <stdint.h> +#include <stdio.h> #ifdef __cplusplus @@ -74,7 +87,10 @@ */ #define KVZ_DATA_CHUNK_SIZE 4096 +#ifndef KVZ_BIT_DEPTH #define KVZ_BIT_DEPTH 8 +#endif + #if KVZ_BIT_DEPTH == 8 typedef uint8_t kvz_pixel; #else @@ -224,6 +240,15 @@ KVZ_LAMBDA = 1, KVZ_OBA = 2, }; + +enum kvz_file_format +{ + KVZ_FORMAT_AUTO = 0, + KVZ_FORMAT_Y4M = 1, + KVZ_FORMAT_YUV = 2 +}; + + // Map from input format to chroma format. #define KVZ_FORMAT2CSP(format) ((enum kvz_chroma_format)"\0\1\2\3"[format]) @@ -434,6 +459,24 @@ uint8_t intra_bit_allocation; uint8_t clip_neighbour; + + enum kvz_file_format file_format; + + char *stats_file_prefix; + char *fast_coeff_table_fn; /*!< \brief Pointer to fast coeff table filename */ + + /** \brief whether we're sampling TBs and their costs for fast cost + * estimation training */ + uint8_t rdo_cost_sampling_mode_on; + + /** \brief whether we're running in normal mode, sampling TBs and their cost + * for fast estimation training, or comparing estimator accuracy to + * CABAC */ + uint8_t fastrd_sampling_on; + uint8_t fastrd_accuracy_check_on; + + char *fastrd_learning_outdir_fn; + } kvz_config; /**
View file
kvazaar-2.0.0.tar.gz/src/kvazaar_internal.h -> kvazaar-2.1.0.tar.gz/src/kvazaar_internal.h
Changed
@@ -1,24 +1,36 @@ #ifndef KVAZAAR_INTERNAL_H_ #define KVAZAAR_INTERNAL_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \ingroup Control
View file
kvazaar-2.0.0.tar.gz/src/kvz_math.h -> kvazaar-2.1.0.tar.gz/src/kvz_math.h
Changed
@@ -1,24 +1,36 @@ #ifndef MATH_H_ #define MATH_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \file
View file
kvazaar-2.0.0.tar.gz/src/ml_classifier_intra_depth_pred.c -> kvazaar-2.1.0.tar.gz/src/ml_classifier_intra_depth_pred.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "ml_classifier_intra_depth_pred.h"
View file
kvazaar-2.0.0.tar.gz/src/ml_classifier_intra_depth_pred.h -> kvazaar-2.1.0.tar.gz/src/ml_classifier_intra_depth_pred.h
Changed
@@ -4,21 +4,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "ml_intra_cu_depth_pred.h"
View file
kvazaar-2.0.0.tar.gz/src/ml_intra_cu_depth_pred.c -> kvazaar-2.1.0.tar.gz/src/ml_intra_cu_depth_pred.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "ml_intra_cu_depth_pred.h" @@ -882,7 +894,7 @@ * \param _width Width of the matrix. * \return average value of the block, -1 if error. */ -static INLINE double vect_average_blck_int8(const uint8_t* _mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, size_t _width) +static INLINE double vect_average_blck_int8(const kvz_pixel* _mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, size_t _width) { if (_mat_src == NULL) { @@ -916,7 +928,7 @@ * \param _width Width of the matrix. * \return average value of the block, -1 if error. */ -static INLINE double vect_variance_blck_int8(const uint8_t* _mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, double _avg_blck, size_t _width) +static INLINE double vect_variance_blck_int8(const kvz_pixel* _mat_src, size_t _x, size_t _x_end, size_t _y, size_t _y_end, double _avg_blck, size_t _width) { if (_mat_src == NULL) { @@ -952,7 +964,7 @@ * \param p_variance Pointer to be filled with the variance; * \return None. */ -static INLINE void features_var_avg_blck(uint8_t* arr_luma_px, uint32_t i_xLcu, uint32_t i_yLcu, +static INLINE void features_var_avg_blck(kvz_pixel* arr_luma_px, uint32_t i_xLcu, uint32_t i_yLcu, uint32_t i_xBlck, uint32_t i_yBlck, uint8_t i_blockSize, int32_t i_width, int32_t i_height, double* p_average, double* p_variance) @@ -1222,7 +1234,7 @@ * \param p_features64 Pointer to the features of depth 0. * \return None. */ -static void features_compute_all(features_s* arr_features[5], uint8_t* luma_px) +static void features_compute_all(features_s* arr_features[5], kvz_pixel* luma_px) { uint32_t x_px = 0; /*!< Top left X of the lcu */ @@ -1475,7 +1487,7 @@ -static void os_luma_qt_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, uint8_t* luma_px, int8_t qp, uint8_t* arr_CDM) +static void os_luma_qt_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, kvz_pixel* luma_px, int8_t qp, uint8_t* arr_CDM) { // Features array per depth features_s arr_features_4[256]; @@ -1731,7 +1743,7 @@ /** * Generate the interval of depth predictions based on the luma samples */ -void kvz_lcu_luma_depth_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, uint8_t* luma_px, int8_t qp) { +void kvz_lcu_luma_depth_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, kvz_pixel* luma_px, int8_t qp) { // Compute the one-shot (OS) Quad-tree prediction (_mat_OS_pred) os_luma_qt_pred(ml_intra_depth_ctu, luma_px, qp, ml_intra_depth_ctu->_mat_upper_depth);
View file
kvazaar-2.0.0.tar.gz/src/ml_intra_cu_depth_pred.h -> kvazaar-2.1.0.tar.gz/src/ml_intra_cu_depth_pred.h
Changed
@@ -3,25 +3,38 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include <stdio.h> #include "global.h" // IWYU pragma: keep +#include "kvazaar.h" @@ -85,6 +98,6 @@ ml_intra_ctu_pred_t* kvz_init_ml_intra_depth_const(void); void kvz_end_ml_intra_depth_const(ml_intra_ctu_pred_t * ml_intra_depth_ctu); -void kvz_lcu_luma_depth_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, uint8_t* luma_px, int8_t qp); +void kvz_lcu_luma_depth_pred(ml_intra_ctu_pred_t* ml_intra_depth_ctu, kvz_pixel* luma_px, int8_t qp); -#endif \ No newline at end of file +#endif
View file
kvazaar-2.0.0.tar.gz/src/nal.c -> kvazaar-2.1.0.tar.gz/src/nal.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "nal.h"
View file
kvazaar-2.0.0.tar.gz/src/nal.h -> kvazaar-2.1.0.tar.gz/src/nal.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /*
View file
kvazaar-2.0.0.tar.gz/src/rate_control.c -> kvazaar-2.1.0.tar.gz/src/rate_control.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "rate_control.h" @@ -27,13 +39,19 @@ #include "pthread.h" -static const int SMOOTHING_WINDOW = 40; +static const int MIN_SMOOTHING_WINDOW = 40; +static int smoothing_window = 40; static const double MIN_LAMBDA = 0.1; static const double MAX_LAMBDA = 10000; #define BETA1 1.2517 static kvz_rc_data *data; +static FILE *dist_file; +static FILE *bits_file; +static FILE *qp_file; +static FILE *lambda_file; + /** * \brief Clip lambda value to a valid range. */ @@ -86,6 +104,17 @@ data->intra_alpha = 6.7542000000000000; data->intra_beta = 1.7860000000000000; + if(encoder->cfg.stats_file_prefix) { + char buff[128]; + sprintf(buff, "%sbits.txt", encoder->cfg.stats_file_prefix); + bits_file = fopen(buff, "w"); + sprintf(buff, "%sdist.txt", encoder->cfg.stats_file_prefix); + dist_file = fopen(buff, "w"); + sprintf(buff, "%sqp.txt", encoder->cfg.stats_file_prefix); + qp_file = fopen(buff, "w"); + sprintf(buff, "%slambda.txt", encoder->cfg.stats_file_prefix); + lambda_file = fopen(buff, "w"); + } return data; } @@ -147,21 +176,31 @@ // At this point, total_bits_coded of the current state contains the // number of bits written encoder->owf frames before the current frame. uint64_t bits_coded = state->frame->total_bits_coded; - int pictures_coded = MAX(0, state->frame->num - encoder->cfg.owf); - - int gop_offset = (state->frame->gop_offset - encoder->cfg.owf) % MAX(1, encoder->cfg.gop_len); - - if (encoder->cfg.gop_len > 0 && gop_offset != encoder->cfg.gop_len - 1 && encoder->cfg.gop_lp_definition.d == 0) { + int pictures_coded = 0; + if(encoder->cfg.gop_len) { + pictures_coded = MAX(0, state->frame->num - CEILDIV(encoder->cfg.owf, encoder->cfg.gop_len)*encoder->cfg.gop_len); + } + else { + pictures_coded = MAX(0, state->frame->num - encoder->cfg.owf); + } + + if (encoder->cfg.gop_len > 0 && encoder->cfg.owf > 0) { // Subtract number of bits in the partially coded GOP. bits_coded -= state->frame->cur_gop_bits_coded; - // Subtract number of pictures in the partially coded GOP. - pictures_coded -= gop_offset + 1; } - // Equation 12 from https://doi.org/10.1109/TIP.2014.2336550 - double gop_target_bits = - (encoder->target_avg_bppic * (pictures_coded + SMOOTHING_WINDOW) - bits_coded) - * MAX(1, encoder->cfg.gop_len) / SMOOTHING_WINDOW; + smoothing_window = MAX(MIN_SMOOTHING_WINDOW, smoothing_window - encoder->cfg.gop_len / 2); + double gop_target_bits = -1; + + while( gop_target_bits < 0 && smoothing_window < 150) { + // Equation 12 from https://doi.org/10.1109/TIP.2014.2336550 + gop_target_bits = + (encoder->target_avg_bppic * (pictures_coded + smoothing_window) - bits_coded) + * MAX(1, encoder->cfg.gop_len) / smoothing_window; + if(gop_target_bits < 0) { + smoothing_window += 10; + } + } // Allocate at least 200 bits for each GOP like HM does. return MAX(200, gop_target_bits); } @@ -773,13 +812,16 @@ int id = lcu.x + lcu.y * state->tile->frame->width_in_lcu; int aq_offset = round(state->frame->aq_offsets[id]); state->qp += aq_offset; - // Maximum delta QP is clipped between [-26, 25] according to ITU T-REC-H.265 specification chapter 7.4.9.10 Transform unit semantics + // Maximum delta QP is clipped according to ITU T-REC-H.265 specification chapter 7.4.9.10 Transform unit semantics + // Clipping range is a function of bit depth // Since this value will be later combined with qp_pred, clip to half of that instead to be safe - state->qp = CLIP(state->frame->QP - 13, state->frame->QP + 12, state->qp); + state->qp = CLIP(state->frame->QP + KVZ_QP_DELTA_MIN / 2, state->frame->QP + KVZ_QP_DELTA_MAX / 2, state->qp); state->qp = CLIP_TO_QP(state->qp); state->lambda = qp_to_lambda(state, state->qp); state->lambda_sqrt = sqrt(state->lambda); + ctu->adjust_lambda = state->lambda; + ctu->adjust_qp = state->qp; //ctu->qp = state->qp; //ctu->lambda = state->lambda; } @@ -843,6 +885,22 @@ } +static int calc_poc(encoder_state_t * const state) { + const encoder_control_t * const encoder = state->encoder_control; + if((encoder->cfg.open_gop && !encoder->cfg.gop_lowdelay) || !encoder->cfg.intra_period) { + return state->frame->poc; + } + if(!encoder->cfg.gop_len || encoder->cfg.open_gop || encoder->cfg.intra_period == 1 || encoder->cfg.gop_lowdelay) { + return state->frame->poc + state->frame->num / encoder->cfg.intra_period * encoder->cfg.intra_period; + } + if (!encoder->cfg.gop_lowdelay && !encoder->cfg.open_gop) { + return state->frame->poc + state->frame->num / (encoder->cfg.intra_period + 1) * (encoder->cfg.intra_period + 1); + } + assert(0); + return -1; +} + + void kvz_update_after_picture(encoder_state_t * const state) { double total_distortion = 0; double lambda = 0; @@ -864,6 +922,14 @@ pthread_mutex_unlock(&state->frame->new_ratecontrol->intra_lock); } + if (encoder->cfg.stats_file_prefix) { + int poc = calc_poc(state); + fprintf(dist_file, "%d %d %d\n", poc, encoder->in.width_in_lcu, encoder->in.height_in_lcu); + fprintf(bits_file, "%d %d %d\n", poc, encoder->in.width_in_lcu, encoder->in.height_in_lcu); + fprintf(qp_file, "%d %d %d\n", poc, encoder->in.width_in_lcu, encoder->in.height_in_lcu); + fprintf(lambda_file, "%d %d %d\n", poc, encoder->in.width_in_lcu, encoder->in.height_in_lcu); + } + for(int y_ctu = 0; y_ctu < state->encoder_control->in.height_in_lcu; y_ctu++) { for (int x_ctu = 0; x_ctu < state->encoder_control->in.width_in_lcu; x_ctu++) { int ctu_distortion = 0; @@ -878,9 +944,23 @@ ctu->distortion = (double)ctu_distortion / ctu->pixels; total_distortion += (double)ctu_distortion / ctu->pixels; lambda += ctu->lambda / (state->encoder_control->in.width_in_lcu * state->encoder_control->in.height_in_lcu); - } + if(encoder->cfg.stats_file_prefix) { + fprintf(dist_file, "%f ", ctu->distortion); + fprintf(bits_file, "%d ", ctu->bits); + fprintf(qp_file, "%d ", ctu->adjust_qp ? ctu->adjust_qp : ctu->qp); + fprintf(lambda_file, "%f ", ctu->adjust_lambda ? ctu->adjust_lambda : ctu->lambda); + } + }
View file
kvazaar-2.0.0.tar.gz/src/rate_control.h -> kvazaar-2.1.0.tar.gz/src/rate_control.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/rdo.c -> kvazaar-2.1.0.tar.gz/src/rdo.c
Changed
@@ -1,27 +1,41 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "rdo.h" +#include <errno.h> #include <stdlib.h> #include <string.h> +#include <pthread.h> #include "cabac.h" #include "context.h" @@ -42,6 +56,11 @@ #define LOG2_SCAN_SET_SIZE 4 #define SBH_THRESHOLD 4 +#define RD_SAMPLING_MAX_LAST_QP 50 + +static FILE *fastrd_learning_outfile[RD_SAMPLING_MAX_LAST_QP + 1] = {NULL}; +static pthread_mutex_t outfile_mutex[RD_SAMPLING_MAX_LAST_QP + 1]; + const uint32_t kvz_g_go_rice_range[5] = { 7, 14, 26, 46, 78 }; const uint32_t kvz_g_go_rice_prefix_len[5] = { 8, 7, 6, 5, 4 }; @@ -142,6 +161,67 @@ int32_t quant_delta[32 * 32]; }; +int kvz_init_rdcost_outfiles(const char *dir_path) +{ +#define RD_SAMPLING_MAX_FN_LENGTH 4095 + static const char *basename_tmpl = "/%02i.txt"; + char fn_template[RD_SAMPLING_MAX_FN_LENGTH + 1]; + char fn[RD_SAMPLING_MAX_FN_LENGTH + 1]; + int rv = 0, qp; + + // As long as QP is a two-digit number, template and produced string should + // be equal in length ("%i" -> "22") + assert(RD_SAMPLING_MAX_LAST_QP <= 99); + assert(strlen(fn_template) <= RD_SAMPLING_MAX_FN_LENGTH); + + strncpy(fn_template, dir_path, RD_SAMPLING_MAX_FN_LENGTH); + strncat(fn_template, basename_tmpl, RD_SAMPLING_MAX_FN_LENGTH - strlen(dir_path)); + + for (qp = 0; qp <= RD_SAMPLING_MAX_LAST_QP; qp++) { + pthread_mutex_t *curr = outfile_mutex + qp; + + if (pthread_mutex_init(curr, NULL) != 0) { + fprintf(stderr, "Failed to create mutex\n"); + rv = -1; + qp--; + goto out_destroy_mutexes; + } + } + + for (qp = 0; qp <= RD_SAMPLING_MAX_LAST_QP; qp++) { + FILE *curr; + + snprintf(fn, RD_SAMPLING_MAX_FN_LENGTH, fn_template, qp); + fn[RD_SAMPLING_MAX_FN_LENGTH] = 0; + curr = fopen(fn, "w"); + if (curr == NULL) { + fprintf(stderr, "Failed to open %s: %s\n", fn, strerror(errno)); + rv = -1; + qp--; + goto out_close_files; + } + fastrd_learning_outfile[qp] = curr; + } + goto out; + +out_close_files: + for (; qp >= 0; qp--) { + fclose(fastrd_learning_outfile[qp]); + fastrd_learning_outfile[qp] = NULL; + } + goto out; + +out_destroy_mutexes: + for (; qp >= 0; qp--) { + pthread_mutex_destroy(outfile_mutex + qp); + } + goto out; + +out: + return rv; +#undef RD_SAMPLING_MAX_FN_LENGTH +} + /** * \brief Calculate actual (or really close to actual) bitcost for coding @@ -194,6 +274,33 @@ return (23 - cabac_copy.bits_left) + (cabac_copy.num_buffered_bytes << 3); } +static INLINE void save_ccc(int qp, const coeff_t *coeff, int32_t size, uint32_t ccc) +{ + pthread_mutex_t *mtx = outfile_mutex + qp; + + assert(sizeof(coeff_t) == sizeof(int16_t)); + assert(qp <= RD_SAMPLING_MAX_LAST_QP); + + pthread_mutex_lock(mtx); + + fwrite(&size, sizeof(size), 1, fastrd_learning_outfile[qp]); + fwrite(&ccc, sizeof(ccc), 1, fastrd_learning_outfile[qp]); + fwrite( coeff, sizeof(coeff_t), size, fastrd_learning_outfile[qp]); + + pthread_mutex_unlock(mtx); +} + +static INLINE void save_accuracy(int qp, uint32_t ccc, uint32_t fast_cost) +{ + pthread_mutex_t *mtx = outfile_mutex + qp; + + assert(qp <= RD_SAMPLING_MAX_LAST_QP); + + pthread_mutex_lock(mtx); + fprintf(fastrd_learning_outfile[qp], "%u %u\n", fast_cost, ccc); + pthread_mutex_unlock(mtx); +} + /** * \brief Estimate bitcost for coding coefficients. * @@ -209,14 +316,32 @@ int32_t type, int8_t scan_mode) { - if (state->qp >= state->encoder_control->cfg.fast_residual_cost_limit) { - return get_coeff_cabac_cost(state, coeff, width, type, scan_mode); - + uint8_t save_cccs = state->encoder_control->cfg.fastrd_sampling_on; + uint8_t check_accuracy = state->encoder_control->cfg.fastrd_accuracy_check_on; + + if (state->qp < state->encoder_control->cfg.fast_residual_cost_limit && + state->qp < MAX_FAST_COEFF_COST_QP) { + // TODO: do we need to assert(0) out of the fast-estimation branch if we + // are to save block costs, or should we just warn about it somewhere + // earlier (configuration validation I guess)? + if (save_cccs) { + assert(0 && "Fast RD sampling does not work with fast-residual-cost"); + return UINT32_MAX; // Hush little compiler don't you cry, not really gonna return anything after assert(0) + } else { + uint64_t weights = kvz_fast_coeff_get_weights(state); + uint32_t fast_cost = kvz_fast_coeff_cost(coeff, width, weights); + if (check_accuracy) { + uint32_t ccc = get_coeff_cabac_cost(state, coeff, width, type, scan_mode); + save_accuracy(state->qp, ccc, fast_cost); + } + return fast_cost; + } } else { - // Estimate coeff coding cost based on QP and sum of absolute coeffs.
View file
kvazaar-2.0.0.tar.gz/src/rdo.h -> kvazaar-2.1.0.tar.gz/src/rdo.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -36,6 +48,9 @@ extern const uint32_t kvz_g_go_rice_range[5]; extern const uint32_t kvz_g_go_rice_prefix_len[5]; +int kvz_init_rdcost_outfiles(const char *fn_template); +void kvz_close_rdcost_outfiles(void); + void kvz_rdoq(encoder_state_t *state, coeff_t *coef, coeff_t *dest_coeff, int32_t width, int32_t height, int8_t type, int8_t scan_mode, int8_t block_type, int8_t tr_depth);
View file
kvazaar-2.0.0.tar.gz/src/sao.c -> kvazaar-2.1.0.tar.gz/src/sao.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "sao.h"
View file
kvazaar-2.0.0.tar.gz/src/sao.h -> kvazaar-2.1.0.tar.gz/src/sao.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/scalinglist.c -> kvazaar-2.1.0.tar.gz/src/scalinglist.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include <math.h>
View file
kvazaar-2.0.0.tar.gz/src/scalinglist.h -> kvazaar-2.1.0.tar.gz/src/scalinglist.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/search.c -> kvazaar-2.1.0.tar.gz/src/search.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "search.h"
View file
kvazaar-2.0.0.tar.gz/src/search.h -> kvazaar-2.1.0.tar.gz/src/search.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/search_inter.c -> kvazaar-2.1.0.tar.gz/src/search_inter.c
Changed
@@ -1,22 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ #include "search_inter.h" @@ -992,12 +1004,11 @@ unsigned costs[4] = { 0 }; - kvz_extended_block src = { 0, 0, 0, 0 }; - ALIGNED(64) kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH]; + ALIGNED(64) kvz_pixel filtered[4][LCU_LUMA_SIZE]; // Storage buffers for intermediate horizontally filtered results. // Have the first columns in contiguous memory for vectorization. - ALIGNED(64) int16_t intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH]; + ALIGNED(64) int16_t intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD]; int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1]; const kvz_picture *ref = info->ref; @@ -1013,20 +1024,45 @@ int8_t sample_off_x = 0; int8_t sample_off_y = 0; - kvz_get_extended_block(orig.x, orig.y, mv.x - 1, mv.y - 1, - state->tile->offset_x, - state->tile->offset_y, - ref->y, ref->width, ref->height, KVZ_LUMA_FILTER_TAPS, - internal_width+1, internal_height+1, - &src); + // Space for (possibly) extrapolated pixels and the part from the picture + // One extra row and column compared to normal interpolation and some extra for AVX2. + // The extrapolation function will set the pointers and stride. + kvz_pixel ext_buffer[KVZ_FME_MAX_INPUT_SIZE_SIMD]; + kvz_pixel *ext = NULL; + kvz_pixel *ext_origin = NULL; + int ext_s = 0; + kvz_epol_args epol_args = { + .src = ref->y, + .src_w = ref->width, + .src_h = ref->height, + .src_s = ref->stride, + .blk_x = state->tile->offset_x + orig.x + mv.x - 1, + .blk_y = state->tile->offset_y + orig.y + mv.y - 1, + .blk_w = internal_width + 1, // TODO: real width + .blk_h = internal_height + 1, // TODO: real height + .pad_l = KVZ_LUMA_FILTER_OFFSET, + .pad_r = KVZ_EXT_PADDING_LUMA - KVZ_LUMA_FILTER_OFFSET, + .pad_t = KVZ_LUMA_FILTER_OFFSET, + .pad_b = KVZ_EXT_PADDING_LUMA - KVZ_LUMA_FILTER_OFFSET, + .pad_b_simd = 0 // AVX2 padding unnecessary because of blk_h + }; + + // Initialize separately. Gets rid of warning + // about using nonstandard extension. + epol_args.buf = ext_buffer; + epol_args.ext = &ext; + epol_args.ext_origin = &ext_origin; + epol_args.ext_s = &ext_s; + + kvz_get_extended_block(&epol_args); kvz_pixel *tmp_pic = pic->y + orig.y * pic->stride + orig.x; int tmp_stride = pic->stride; // Search integer position costs[0] = kvz_satd_any_size(width, height, - tmp_pic, tmp_stride, - src.orig_topleft + src.stride + 1, src.stride); + tmp_pic, tmp_stride, + ext_origin + ext_s + 1, ext_s); costs[0] += info->mvd_cost_func(state, mv.x, mv.y, 2, @@ -1056,8 +1092,8 @@ const int mv_shift = (step < 2) ? 1 : 0; filter_steps[step](state->encoder_control, - src.orig_topleft, - src.stride, + ext_origin, + ext_s, internal_width, internal_height, filtered, @@ -1131,8 +1167,6 @@ info->best_mv = mv; info->best_cost = best_cost; info->best_bitcost = best_bitcost; - - if (src.malloc_used) free(src.buffer); } /** @@ -1244,13 +1278,14 @@ const cu_array_t* ref_array = info->state->frame->ref->cu_arrays[info->ref_idx]; const cu_info_t* ref_cu = kvz_cu_array_at_const(ref_array, mid_x, mid_y); if (ref_cu->type == CU_INTER) { + vector2d_t mv_previous = { 0, 0 }; if (ref_cu->inter.mv_dir & 1) { - mv.x = ref_cu->inter.mv[0][0]; - mv.y = ref_cu->inter.mv[0][1]; + mv_previous.x = ref_cu->inter.mv[0][0]; + mv_previous.y = ref_cu->inter.mv[0][1]; } else { - mv.x = ref_cu->inter.mv[1][0]; - mv.y = ref_cu->inter.mv[1][1]; + mv_previous.x = ref_cu->inter.mv[1][0]; + mv_previous.y = ref_cu->inter.mv[1][1]; } // Apply mv scaling if neighbor poc is available if (info->state->frame->ref_LX_size[ref_list] > 0) { @@ -1284,9 +1319,14 @@ [col_list] [ref_cu->inter.mv_ref[col_list]] ], - &mv + &mv_previous ); } + + // Check if the mv is valid after scaling + if (fracmv_within_tile(info, mv_previous.x, mv_previous.y)) { + mv = mv_previous; + } } int search_range = 32;
View file
kvazaar-2.0.0.tar.gz/src/search_inter.h -> kvazaar-2.1.0.tar.gz/src/search_inter.h
Changed
@@ -1,24 +1,36 @@ #ifndef SEARCH_INTER_H_ #define SEARCH_INTER_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \ingroup Compression
View file
kvazaar-2.0.0.tar.gz/src/search_intra.c -> kvazaar-2.1.0.tar.gz/src/search_intra.c
Changed
@@ -1,22 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ #include "search_intra.h"
View file
kvazaar-2.0.0.tar.gz/src/search_intra.h -> kvazaar-2.1.0.tar.gz/src/search_intra.h
Changed
@@ -1,24 +1,36 @@ #ifndef SEARCH_INTRA_H_ #define SEARCH_INTRA_H_ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /** * \ingroup Compression
View file
kvazaar-2.0.0.tar.gz/src/strategies/altivec/picture-altivec.c -> kvazaar-2.1.0.tar.gz/src/strategies/altivec/picture-altivec.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/altivec/picture-altivec.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/altivec/picture-altivec.h -> kvazaar-2.1.0.tar.gz/src/strategies/altivec/picture-altivec.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/avx2_common_functions.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/avx2_common_functions.h
Changed
@@ -1,3 +1,35 @@ +/***************************************************************************** + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ + #ifndef AVX2_COMMON_FUNCTIONS_H #define AVX2_COMMON_FUNCTIONS_H
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/dct-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/dct-avx2.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /* @@ -25,6 +37,8 @@ #include "strategies/avx2/dct-avx2.h" #if COMPILE_INTEL_AVX2 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include <immintrin.h> #include "strategyselector.h" @@ -52,7 +66,7 @@ return _mm256_permute4x64_epi64(v, _MM_SHUFFLE(1, 0, 3, 2)); } -static INLINE __m256i truncate(__m256i v, __m256i debias, int32_t shift) +static INLINE __m256i truncate_avx2(__m256i v, __m256i debias, int32_t shift) { __m256i truncable = _mm256_add_epi32 (v, debias); return _mm256_srai_epi32(truncable, shift); @@ -85,8 +99,8 @@ __m256i rows_up = _mm256_add_epi32(prod1, prod2); __m256i rows_dn = _mm256_add_epi32(prod3, prod4); - __m256i rows_up_tr = truncate(rows_up, debias, shift); - __m256i rows_dn_tr = truncate(rows_dn, debias, shift); + __m256i rows_up_tr = truncate_avx2(rows_up, debias, shift); + __m256i rows_dn_tr = truncate_avx2(rows_dn, debias, shift); __m256i result = _mm256_packs_epi32(rows_up_tr, rows_dn_tr); return result; @@ -223,8 +237,8 @@ __m256i lo = _mm256_add_epi32(lo_1, lo_2); __m256i hi = _mm256_add_epi32(hi_1, hi_2); - __m256i lo_tr = truncate(lo, debias, shift); - __m256i hi_tr = truncate(hi, debias, shift); + __m256i lo_tr = truncate_avx2(lo, debias, shift); + __m256i hi_tr = truncate_avx2(hi, debias, shift); __m256i final_dr = _mm256_packs_epi32(lo_tr, hi_tr); @@ -282,8 +296,8 @@ __m256i hsum2c_0 = _mm256_hadd_epi32(hsum0, hsum1); __m256i hsum2c_1 = _mm256_hadd_epi32(hsum2, hsum3); - __m256i hsum2c_0_tr = truncate(hsum2c_0, debias, shift); - __m256i hsum2c_1_tr = truncate(hsum2c_1, debias, shift); + __m256i hsum2c_0_tr = truncate_avx2(hsum2c_0, debias, shift); + __m256i hsum2c_1_tr = truncate_avx2(hsum2c_1, debias, shift); __m256i tmp_dc = _mm256_packs_epi32(hsum2c_0_tr, hsum2c_1_tr); @@ -337,8 +351,8 @@ __m256i hsum2c_0 = _mm256_hadd_epi32(hsum0, hsum1); __m256i hsum2c_1 = _mm256_hadd_epi32(hsum2, hsum3); - __m256i hsum2c_0_tr = truncate(hsum2c_0, debias, shift); - __m256i hsum2c_1_tr = truncate(hsum2c_1, debias, shift); + __m256i hsum2c_0_tr = truncate_avx2(hsum2c_0, debias, shift); + __m256i hsum2c_1_tr = truncate_avx2(hsum2c_1, debias, shift); __m256i tmp_dr = _mm256_packs_epi32(hsum2c_0_tr, hsum2c_1_tr); @@ -456,7 +470,7 @@ __m256i s9 = _mm256_add_epi32(s6, s7); __m256i res = _mm256_hadd_epi32(s8, s9); - results_32[fco] = truncate(res, debias, shift); + results_32[fco] = truncate_avx2(res, debias, shift); } output[y] = _mm256_packs_epi32(results_32[0], results_32[1]); } @@ -862,10 +876,10 @@ size_t acc_base = i << 2; size_t dst_base = i << 1; - __m256i q0 = truncate(accu[acc_base + 0], debias, shift); - __m256i q1 = truncate(accu[acc_base + 1], debias, shift); - __m256i q2 = truncate(accu[acc_base + 2], debias, shift); - __m256i q3 = truncate(accu[acc_base + 3], debias, shift); + __m256i q0 = truncate_avx2(accu[acc_base + 0], debias, shift); + __m256i q1 = truncate_avx2(accu[acc_base + 1], debias, shift); + __m256i q2 = truncate_avx2(accu[acc_base + 2], debias, shift); + __m256i q3 = truncate_avx2(accu[acc_base + 3], debias, shift); __m256i h01 = _mm256_packs_epi32(q0, q1); __m256i h23 = _mm256_packs_epi32(q2, q3); @@ -924,12 +938,14 @@ TRANSFORM(dct, 32); ITRANSFORM(dct, 32); +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_AVX2 int kvz_strategy_register_dct_avx2(void* opaque, uint8_t bitdepth) { bool success = true; #if COMPILE_INTEL_AVX2 +#if KVZ_BIT_DEPTH == 8 if (bitdepth == 8){ success &= kvz_strategyselector_register(opaque, "fast_forward_dst_4x4", "avx2", 40, &matrix_dst_4x4_avx2); @@ -945,6 +961,7 @@ success &= kvz_strategyselector_register(opaque, "idct_16x16", "avx2", 40, &matrix_idct_16x16_avx2); success &= kvz_strategyselector_register(opaque, "idct_32x32", "avx2", 40, &matrix_idct_32x32_avx2); } +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_AVX2 return success; }
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/dct-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/dct-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/encode_coding_tree-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/encode_coding_tree-avx2.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategyselector.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/encode_coding_tree-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/encode_coding_tree-avx2.h
Changed
@@ -4,21 +4,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/intra-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/intra-avx2.c
Changed
@@ -1,30 +1,44 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/avx2/intra-avx2.h" #if COMPILE_INTEL_AVX2 && defined X86_64 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 + #include <immintrin.h> #include <stdlib.h> -#include "kvazaar.h" #include "strategyselector.h" #include "strategies/missing-intel-intrinsics.h" @@ -35,7 +49,7 @@ * \param delta_pos Fractional pixel precise position of sample displacement * \param x Sample offset in direction x in ref_main array */ -static INLINE __m128i filter_4x1_avx2(const kvz_pixel *ref_main, int16_t delta_pos, int x){ +static INLINE __m128i filter_4x1_avx2(const uint8_t *ref_main, int16_t delta_pos, int x){ int8_t delta_int = delta_pos >> 5; int8_t delta_fract = delta_pos & (32-1); @@ -58,7 +72,7 @@ * \param sample_disp Sample displacement per row * \param vertical_mode Mode direction, true if vertical */ -static void filter_4x4_avx2(kvz_pixel *dst, const kvz_pixel *ref_main, int sample_disp, bool vertical_mode){ +static void filter_4x4_avx2(uint8_t *dst, const uint8_t *ref_main, int sample_disp, bool vertical_mode){ __m128i row0 = filter_4x1_avx2(ref_main, 1 * sample_disp, 0); __m128i row1 = filter_4x1_avx2(ref_main, 2 * sample_disp, 0); @@ -86,7 +100,7 @@ * \param delta_pos Fractional pixel precise position of sample displacement * \param x Sample offset in direction x in ref_main array */ -static INLINE __m128i filter_8x1_avx2(const kvz_pixel *ref_main, int16_t delta_pos, int x){ +static INLINE __m128i filter_8x1_avx2(const uint8_t *ref_main, int16_t delta_pos, int x){ int8_t delta_int = delta_pos >> 5; int8_t delta_fract = delta_pos & (32-1); @@ -110,7 +124,7 @@ * \param sample_disp Sample displacement per row * \param vertical_mode Mode direction, true if vertical */ -static void filter_8x8_avx2(kvz_pixel *dst, const kvz_pixel *ref_main, int sample_disp, bool vertical_mode){ +static void filter_8x8_avx2(uint8_t *dst, const uint8_t *ref_main, int sample_disp, bool vertical_mode){ __m128i row0 = filter_8x1_avx2(ref_main, 1 * sample_disp, 0); __m128i row1 = filter_8x1_avx2(ref_main, 2 * sample_disp, 0); __m128i row2 = filter_8x1_avx2(ref_main, 3 * sample_disp, 0); @@ -163,7 +177,7 @@ * \param delta_pos Fractional pixel precise position of sample displacement * \param x Sample offset in direction x in ref_main array */ -static INLINE __m256i filter_16x1_avx2(const kvz_pixel *ref_main, int16_t delta_pos, int x){ +static INLINE __m256i filter_16x1_avx2(const uint8_t *ref_main, int16_t delta_pos, int x){ int8_t delta_int = delta_pos >> 5; int8_t delta_fract = delta_pos & (32-1); @@ -189,7 +203,7 @@ * \param sample_disp Sample displacement per row * \param vertical_mode Mode direction, true if vertical */ -static void filter_16x16_avx2(kvz_pixel *dst, const kvz_pixel *ref_main, int sample_disp, bool vertical_mode){ +static void filter_16x16_avx2(uint8_t *dst, const uint8_t *ref_main, int sample_disp, bool vertical_mode){ for (int y = 0; y < 16; y += 8) { __m256i row0 = filter_16x1_avx2(ref_main, (y + 1) * sample_disp, 0); __m256i row1 = filter_16x1_avx2(ref_main, (y + 2) * sample_disp, 0); @@ -281,7 +295,7 @@ * \param vertical_mode Mode direction, true if vertical * \param width Block width */ -static void filter_NxN_avx2(kvz_pixel *dst, const kvz_pixel *ref_main, int sample_disp, bool vertical_mode, int width){ +static void filter_NxN_avx2(uint8_t *dst, const uint8_t *ref_main, int sample_disp, bool vertical_mode, int width){ for (int y = 0; y < width; y += 8) { for (int x = 0; x < width; x += 16) { __m256i row0 = filter_16x1_avx2(ref_main, (y + 1) * sample_disp, x); @@ -376,9 +390,9 @@ static void kvz_angular_pred_avx2( const int_fast8_t log2_width, const int_fast8_t intra_mode, - const kvz_pixel *const in_ref_above, - const kvz_pixel *const in_ref_left, - kvz_pixel *const dst) + const uint8_t *const in_ref_above, + const uint8_t *const in_ref_left, + uint8_t *const dst) { assert(log2_width >= 2 && log2_width <= 5); assert(intra_mode >= 2 && intra_mode <= 34); @@ -388,7 +402,7 @@ // Temporary buffer for modes 11-25. // It only needs to be big enough to hold indices from -width to width-1. - kvz_pixel tmp_ref[2 * 32]; + uint8_t tmp_ref[2 * 32]; const int_fast8_t width = 1 << log2_width; // Whether to swap references to always project on the left reference row. @@ -399,9 +413,9 @@ const int_fast8_t sample_disp = (mode_disp < 0 ? -1 : 1) * modedisp2sampledisp[abs(mode_disp)]; // Pointer for the reference we are interpolating from. - const kvz_pixel *ref_main; + const uint8_t *ref_main; // Pointer for the other reference. - const kvz_pixel *ref_side; + const uint8_t *ref_side; // Set ref_main and ref_side such that, when indexed with 0, they point to // index 0 in block coordinates. @@ -463,15 +477,15 @@ */ static void kvz_intra_pred_planar_avx2( const int_fast8_t log2_width, - const kvz_pixel *const ref_top, - const kvz_pixel *const ref_left, - kvz_pixel *const dst) + const uint8_t *const ref_top, + const uint8_t *const ref_left, + uint8_t *const dst) { assert(log2_width >= 2 && log2_width <= 5); const int_fast8_t width = 1 << log2_width; - const kvz_pixel top_right = ref_top[width + 1]; - const kvz_pixel bottom_left = ref_left[width + 1]; + const uint8_t top_right = ref_top[width + 1]; + const uint8_t bottom_left = ref_left[width + 1]; if (log2_width > 2) { @@ -888,12 +902,11 @@ */ static void kvz_intra_pred_filtered_dc_avx2( const int_fast8_t log2_width, - const kvz_pixel *ref_top, - const kvz_pixel *ref_left, - kvz_pixel *out_block) + const uint8_t *ref_top, + const uint8_t *ref_left, + uint8_t *out_block) { assert(log2_width >= 2 && log2_width <= 5); - assert(sizeof(kvz_pixel) == sizeof(uint8_t)); if (log2_width == 2) { pred_filtered_dc_4x4(ref_top, ref_left, out_block); @@ -906,17 +919,20 @@ } } +#endif //KVZ_BIT_DEPTH == 8
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/intra-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/intra-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/ipol-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/ipol-avx2.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /* @@ -24,7 +36,7 @@ #include "strategies/avx2/ipol-avx2.h" -#if COMPILE_INTEL_AVX2 +#if COMPILE_INTEL_AVX2 && defined X86_64 #include <immintrin.h> #include <stdio.h> #include <string.h> @@ -56,111 +68,6 @@ return filtered; } -static void kvz_init_shuffle_masks(__m256i *shuf_01_23, __m256i *shuf_45_67) { - // Shuffle pairs - *shuf_01_23 = _mm256_setr_epi8(0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, - 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10); - *shuf_45_67 = _mm256_setr_epi8(4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, - 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14); -} - -static void kvz_init_shuffle_masks_chroma(__m256i *shuf_01, __m256i *shuf_23) { - // Shuffle pairs - *shuf_01 = _mm256_setr_epi8(0, 1, 1, 2, 2, 3, 3, 4, 8, 9, 9, 10, 10, 11, 11, 12, - 0, 1, 1, 2, 2, 3, 3, 4, 8, 9, 9, 10, 10, 11, 11, 12); - *shuf_23 = _mm256_setr_epi8(2, 3, 3, 4, 4, 5, 5, 6, 10, 11, 11, 12, 12, 13, 13, 14, - 2, 3, 3, 4, 4, 5, 5, 6, 10, 11, 11, 12, 12, 13, 13, 14); -} - -static void kvz_init_filter_taps(int8_t *filter, - __m256i *taps_01_23, __m256i *taps_45_67) { - // Filter weights - __m256i all_taps = _mm256_castsi128_si256(_mm_loadl_epi64((__m128i*)filter)); - __m256i perm_01 = _mm256_setr_epi32(0, 0, 0, 0, 1, 1, 1, 1); - __m256i perm_23 = _mm256_setr_epi32(2, 2, 2, 2, 3, 3, 3, 3); - all_taps = _mm256_unpacklo_epi16(all_taps, all_taps); - *taps_01_23 = _mm256_permutevar8x32_epi32(all_taps, perm_01); - *taps_45_67 = _mm256_permutevar8x32_epi32(all_taps, perm_23); -} - -static void kvz_init_filter_taps_chroma(int8_t *filter, - __m256i *taps_01, __m256i *taps_23) { - // Filter weights - __m256i all_taps = _mm256_set1_epi32(*(int32_t*)filter); - all_taps = _mm256_unpacklo_epi16(all_taps, all_taps); - *taps_01 = _mm256_shuffle_epi32(all_taps, _MM_SHUFFLE(0, 0, 0, 0)); - *taps_23 = _mm256_shuffle_epi32(all_taps, _MM_SHUFFLE(1, 1, 1, 1)); -} - -static void kvz_init_ver_filter_taps(int8_t *filter, __m256i *filters) { - for (int i = 0; i < 4; ++i) filters[i] = _mm256_cvtepi8_epi16(_mm_set1_epi16(*(int16_t*)&filter[2 * i])); - filters[0] = _mm256_inserti128_si256(filters[0], _mm256_castsi256_si128(filters[3]), 1); // Pairs 01 67 - filters[1] = _mm256_inserti128_si256(filters[1], _mm256_castsi256_si128(filters[0]), 1); // Pairs 23 01 - filters[2] = _mm256_inserti128_si256(filters[2], _mm256_castsi256_si128(filters[1]), 1); // Pairs 45 23 - filters[3] = _mm256_inserti128_si256(filters[3], _mm256_castsi256_si128(filters[2]), 1); // Pairs 67 45 -} - -static void kvz_eight_tap_filter_hor_8x1_avx2(kvz_pixel *data, int16_t * out, - __m256i *shuf_01_23, __m256i *shuf_45_67, - __m256i *taps_01_23, __m256i *taps_45_67) { - - __m256i row = _mm256_broadcastsi128_si256(_mm_loadu_si128((__m128i*)data)); - - __m256i pairs_01_23 = _mm256_shuffle_epi8(row, *shuf_01_23); - __m256i pairs_45_67 = _mm256_shuffle_epi8(row, *shuf_45_67); - - __m256i temp0 = _mm256_maddubs_epi16(pairs_01_23, *taps_01_23); - __m256i temp1 = _mm256_maddubs_epi16(pairs_45_67, *taps_45_67); - - __m256i sum = _mm256_add_epi16(temp0, temp1); - __m128i filtered = _mm_add_epi16(_mm256_castsi256_si128(sum), _mm256_extracti128_si256(sum, 1)); - _mm_storeu_si128((__m128i*)out, filtered); -} - -static void kvz_four_tap_filter_hor_4x4_avx2(kvz_pixel *data, int stride, int16_t * out, int out_stride, - __m256i *shuf_01, __m256i *shuf_23, - __m256i *taps_01, __m256i *taps_23) { - - __m256i four_rows = _mm256_setr_epi64x( - *(int64_t*)&data[0 * stride], - *(int64_t*)&data[1 * stride], - *(int64_t*)&data[2 * stride], - *(int64_t*)&data[3 * stride]); - - __m256i pairs_l = _mm256_shuffle_epi8(four_rows, *shuf_01); - __m256i pairs_r = _mm256_shuffle_epi8(four_rows, *shuf_23); - - __m256i temp_l = _mm256_maddubs_epi16(pairs_l, *taps_01); - __m256i temp_r = _mm256_maddubs_epi16(pairs_r, *taps_23); - - __m256i sum = _mm256_add_epi16(temp_l, temp_r); - - __m128i lower = _mm256_castsi256_si128(sum); - __m128i upper = _mm256_extracti128_si256(sum, 1); - _mm_storel_epi64((__m128i*)(out + 0 * out_stride), lower); - _mm_storeh_pd((double*)(out + 1 * out_stride), _mm_castsi128_pd(lower)); - _mm_storel_epi64((__m128i*)(out + 2 * out_stride), upper); - _mm_storeh_pd((double*)(out + 3 * out_stride), _mm_castsi128_pd(upper)); -} - -static void kvz_four_tap_filter_hor_4xN_avx2(kvz_pixel *data, int stride, int16_t * out, int out_stride, - __m256i *shuf_01_23, __m256i *taps_01_23, - int rows) { - - for (int i = 0; i < rows; ++i) { - __m256i row = _mm256_set1_epi64x(*(int64_t*)&data[i * stride]); - - __m256i pairs_l_r = _mm256_shuffle_epi8(row, *shuf_01_23); - __m256i temp_l_r = _mm256_maddubs_epi16(pairs_l_r, *taps_01_23); - - __m128i temp_l = _mm256_castsi256_si128(temp_l_r); - __m128i temp_r = _mm256_extracti128_si256(temp_l_r, 1); - __m128i sum = _mm_add_epi16(temp_l, temp_r); - - _mm_storel_epi64((__m128i*)(out + i * out_stride), sum); - } -} - static int32_t kvz_eight_tap_filter_hor_16bit_avx2(int8_t *filter, int16_t *data) { __m128i fir = _mm_loadl_epi64((__m128i*)filter); @@ -243,7 +150,108 @@ _mm_storel_epi64((__m128i*)out, filtered); } -static void kvz_four_tap_filter_ver_16bit_4x4_avx2(int8_t *filter, int16_t *data, int16_t stride, kvz_pixel *out, int16_t out_stride) +static void kvz_ipol_8tap_hor_px_im_avx2(int8_t *filter, + int width, + int height, + kvz_pixel *src, + int16_t src_stride, + int16_t *dst, + int16_t dst_stride) { + __m256i shuf01 = _mm256_setr_epi8(0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, + 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8); + __m256i shuf23 = _mm256_setr_epi8(2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, + 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10); + __m256i shuf45 = _mm256_setr_epi8(4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, + 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12); + __m256i shuf67 = _mm256_setr_epi8(6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, + 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14); + + __m256i all_w01 = _mm256_set1_epi16(*(uint16_t *)(filter + 0)); + __m256i all_w23 = _mm256_set1_epi16(*(uint16_t *)(filter + 2)); + __m256i all_w45 = _mm256_set1_epi16(*(uint16_t *)(filter + 4)); + __m256i all_w67 = _mm256_set1_epi16(*(uint16_t *)(filter + 6)); + + int y_offset = -KVZ_LUMA_FILTER_OFFSET; + int x_offset = -KVZ_LUMA_FILTER_OFFSET; + + kvz_pixel *top_left = src + src_stride * y_offset + x_offset;
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/ipol-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/ipol-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/picture-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/picture-avx2.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /* @@ -25,6 +37,8 @@ #include "global.h" #if COMPILE_INTEL_AVX2 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include "strategies/avx2/picture-avx2.h" #include "strategies/avx2/reg_sad_pow2_widths-avx2.h" @@ -33,7 +47,6 @@ #include <mmintrin.h> #include <xmmintrin.h> #include <string.h> -#include "kvazaar.h" #include "strategies/strategies-picture.h" #include "strategyselector.h" #include "strategies/generic/picture-generic.h" @@ -52,7 +65,7 @@ * * \returns Sum of Absolute Differences */ -uint32_t kvz_reg_sad_avx2(const kvz_pixel * const data1, const kvz_pixel * const data2, +uint32_t kvz_reg_sad_avx2(const uint8_t * const data1, const uint8_t * const data2, const int width, const int height, const unsigned stride1, const unsigned stride2) { if (width == 0) @@ -123,7 +136,7 @@ } -static unsigned sad_8bit_8x8_avx2(const kvz_pixel *buf1, const kvz_pixel *buf2) +static unsigned sad_8bit_8x8_avx2(const uint8_t *buf1, const uint8_t *buf2) { const __m256i *const a = (const __m256i *)buf1; const __m256i *const b = (const __m256i *)buf2; @@ -133,7 +146,7 @@ } -static unsigned sad_8bit_16x16_avx2(const kvz_pixel *buf1, const kvz_pixel *buf2) +static unsigned sad_8bit_16x16_avx2(const uint8_t *buf1, const uint8_t *buf2) { const __m256i *const a = (const __m256i *)buf1; const __m256i *const b = (const __m256i *)buf2; @@ -143,7 +156,7 @@ } -static unsigned sad_8bit_32x32_avx2(const kvz_pixel *buf1, const kvz_pixel *buf2) +static unsigned sad_8bit_32x32_avx2(const uint8_t *buf1, const uint8_t *buf2) { const __m256i *const a = (const __m256i *)buf1; const __m256i *const b = (const __m256i *)buf2; @@ -163,7 +176,7 @@ } -static unsigned sad_8bit_64x64_avx2(const kvz_pixel * buf1, const kvz_pixel * buf2) +static unsigned sad_8bit_64x64_avx2(const uint8_t * buf1, const uint8_t * buf2) { const __m256i *const a = (const __m256i *)buf1; const __m256i *const b = (const __m256i *)buf2; @@ -182,7 +195,7 @@ return m256i_horizontal_sum(sum0); } -static unsigned satd_4x4_8bit_avx2(const kvz_pixel *org, const kvz_pixel *cur) +static unsigned satd_4x4_8bit_avx2(const uint8_t *org, const uint8_t *cur) { __m128i original = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i*)org)); @@ -228,7 +241,7 @@ static void satd_8bit_4x4_dual_avx2( - const pred_buffer preds, const kvz_pixel * const orig, unsigned num_modes, unsigned *satds_out) + const pred_buffer preds, const uint8_t * const orig, unsigned num_modes, unsigned *satds_out) { __m256i original = _mm256_broadcastsi128_si256(_mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i*)orig))); @@ -423,14 +436,14 @@ *sum1 = _mm_cvtsi128_si32(_mm256_extracti128_si256(sad, 1)); } -INLINE static __m128i diff_row_avx2(const kvz_pixel *buf1, const kvz_pixel *buf2) +INLINE static __m128i diff_row_avx2(const uint8_t *buf1, const uint8_t *buf2) { __m128i buf1_row = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i*)buf1)); __m128i buf2_row = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i*)buf2)); return _mm_sub_epi16(buf1_row, buf2_row); } -INLINE static __m256i diff_row_dual_avx2(const kvz_pixel *buf1, const kvz_pixel *buf2, const kvz_pixel *orig) +INLINE static __m256i diff_row_dual_avx2(const uint8_t *buf1, const uint8_t *buf2, const uint8_t *orig) { __m128i temp1 = _mm_loadl_epi64((__m128i*)buf1); __m128i temp2 = _mm_loadl_epi64((__m128i*)buf2); @@ -442,8 +455,8 @@ } INLINE static void diff_blocks_avx2(__m128i (*row_diff)[8], - const kvz_pixel * buf1, unsigned stride1, - const kvz_pixel * orig, unsigned stride_orig) + const uint8_t * buf1, unsigned stride1, + const uint8_t * orig, unsigned stride_orig) { (*row_diff)[0] = diff_row_avx2(buf1 + 0 * stride1, orig + 0 * stride_orig); (*row_diff)[1] = diff_row_avx2(buf1 + 1 * stride1, orig + 1 * stride_orig); @@ -457,9 +470,9 @@ } INLINE static void diff_blocks_dual_avx2(__m256i (*row_diff)[8], - const kvz_pixel * buf1, unsigned stride1, - const kvz_pixel * buf2, unsigned stride2, - const kvz_pixel * orig, unsigned stride_orig) + const uint8_t * buf1, unsigned stride1, + const uint8_t * buf2, unsigned stride2, + const uint8_t * orig, unsigned stride_orig) { (*row_diff)[0] = diff_row_dual_avx2(buf1 + 0 * stride1, buf2 + 0 * stride2, orig + 0 * stride_orig); (*row_diff)[1] = diff_row_dual_avx2(buf1 + 1 * stride1, buf2 + 1 * stride2, orig + 1 * stride_orig); @@ -496,9 +509,9 @@ hor_transform_row_dual_avx2((*row_diff) + 7); } -static void kvz_satd_8bit_8x8_general_dual_avx2(const kvz_pixel * buf1, unsigned stride1, - const kvz_pixel * buf2, unsigned stride2, - const kvz_pixel * orig, unsigned stride_orig, +static void kvz_satd_8bit_8x8_general_dual_avx2(const uint8_t * buf1, unsigned stride1, + const uint8_t * buf2, unsigned stride2, + const uint8_t * orig, unsigned stride_orig, unsigned *sum0, unsigned *sum1) { __m256i temp[8]; @@ -516,18 +529,18 @@ /** * \brief Calculate SATD between two 4x4 blocks inside bigger arrays. */ -static unsigned kvz_satd_4x4_subblock_8bit_avx2(const kvz_pixel * buf1, +static unsigned kvz_satd_4x4_subblock_8bit_avx2(const uint8_t * buf1, const int32_t stride1, - const kvz_pixel * buf2, + const uint8_t * buf2, const int32_t stride2) { // TODO: AVX2 implementation return kvz_satd_4x4_subblock_generic(buf1, stride1, buf2, stride2); } -static void kvz_satd_4x4_subblock_quad_avx2(const kvz_pixel *preds[4], +static void kvz_satd_4x4_subblock_quad_avx2(const uint8_t *preds[4],
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/picture-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/picture-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/quant-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/quant-avx2.c
Changed
@@ -1,22 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2013-2015 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify it under -* the terms of the GNU Lesser General Public License as published by the -* Free Software Foundation; either version 2.1 of the License, or (at your -* option) any later version. -* -* Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -* more details. -* -* You should have received a copy of the GNU General Public License along -* with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ /* * \file @@ -40,6 +52,7 @@ #include "strategyselector.h" #include "tables.h" #include "transform.h" +#include "fast_coeff_cost.h" static INLINE int32_t hsum32_8x32i(__m256i src) { @@ -506,35 +519,37 @@ #undef LOG2_SCAN_SET_SIZE } -static INLINE __m128i get_residual_4x1_avx2(const kvz_pixel *a_in, const kvz_pixel *b_in){ +#if KVZ_BIT_DEPTH == 8 + +static INLINE __m128i get_residual_4x1_avx2(const uint8_t *a_in, const uint8_t *b_in){ __m128i a = _mm_cvtsi32_si128(*(int32_t*)a_in); __m128i b = _mm_cvtsi32_si128(*(int32_t*)b_in); __m128i diff = _mm_sub_epi16(_mm_cvtepu8_epi16(a), _mm_cvtepu8_epi16(b) ); return diff; } -static INLINE __m128i get_residual_8x1_avx2(const kvz_pixel *a_in, const kvz_pixel *b_in){ +static INLINE __m128i get_residual_8x1_avx2(const uint8_t *a_in, const uint8_t *b_in){ __m128i a = _mm_cvtsi64_si128(*(int64_t*)a_in); __m128i b = _mm_cvtsi64_si128(*(int64_t*)b_in); __m128i diff = _mm_sub_epi16(_mm_cvtepu8_epi16(a), _mm_cvtepu8_epi16(b) ); return diff; } -static INLINE int32_t get_quantized_recon_4x1_avx2(int16_t *residual, const kvz_pixel *pred_in){ +static INLINE int32_t get_quantized_recon_4x1_avx2(int16_t *residual, const uint8_t *pred_in){ __m128i res = _mm_loadl_epi64((__m128i*)residual); __m128i pred = _mm_cvtsi32_si128(*(int32_t*)pred_in); __m128i rec = _mm_add_epi16(res, _mm_cvtepu8_epi16(pred)); return _mm_cvtsi128_si32(_mm_packus_epi16(rec, rec)); } -static INLINE int64_t get_quantized_recon_8x1_avx2(int16_t *residual, const kvz_pixel *pred_in){ +static INLINE int64_t get_quantized_recon_8x1_avx2(int16_t *residual, const uint8_t *pred_in){ __m128i res = _mm_loadu_si128((__m128i*)residual); __m128i pred = _mm_cvtsi64_si128(*(int64_t*)pred_in); __m128i rec = _mm_add_epi16(res, _mm_cvtepu8_epi16(pred)); return _mm_cvtsi128_si64(_mm_packus_epi16(rec, rec)); } -static void get_residual_avx2(const kvz_pixel *ref_in, const kvz_pixel *pred_in, int16_t *residual, int width, int in_stride){ +static void get_residual_avx2(const uint8_t *ref_in, const uint8_t *pred_in, int16_t *residual, int width, int in_stride){ __m128i diff = _mm_setzero_si128(); switch (width) { @@ -579,7 +594,7 @@ } } -static void get_quantized_recon_avx2(int16_t *residual, const kvz_pixel *pred_in, int in_stride, kvz_pixel *rec_out, int out_stride, int width){ +static void get_quantized_recon_avx2(int16_t *residual, const uint8_t *pred_in, int in_stride, uint8_t *rec_out, int out_stride, int width){ switch (width) { case 4: @@ -629,8 +644,8 @@ const cu_info_t *const cur_cu, const int width, const color_t color, const coeff_scan_order_t scan_order, const int use_trskip, const int in_stride, const int out_stride, - const kvz_pixel *const ref_in, const kvz_pixel *const pred_in, - kvz_pixel *rec_out, coeff_t *coeff_out, + const uint8_t *const ref_in, const uint8_t *const pred_in, + uint8_t *rec_out, coeff_t *coeff_out, bool early_skip) { // Temporary arrays to pass data to and from kvz_quant and transform functions. @@ -766,6 +781,8 @@ } } +#endif // KVZ_BIT_DEPTH == 8 + static uint32_t coeff_abs_sum_avx2(const coeff_t *coeffs, const size_t length) { assert(length % 8 == 0); @@ -788,80 +805,62 @@ return parts[0] + parts[1] + parts[2] + parts[3]; } -#define TO_Q88(f) ((int16_t)((f) * 256.0f)) - -static uint32_t fast_coeff_cost_avx2(const coeff_t *coeff, int32_t width, int32_t qp) +static uint32_t fast_coeff_cost_avx2(const coeff_t *coeff, int32_t width, uint64_t weights) { -#define NUM_BUCKETS 5 - static const int16_t wt_m[NUM_BUCKETS] = { - TO_Q88(-0.004916), - TO_Q88( 0.010806), - TO_Q88( 0.055562), - TO_Q88( 0.033436), - TO_Q88(-0.007690), - }; - static const int16_t wt_c[NUM_BUCKETS] = { - TO_Q88( 0.172024), - TO_Q88( 3.421462), - TO_Q88( 2.879506), - TO_Q88( 5.585471), - TO_Q88( 0.256772), - }; + const __m256i zero = _mm256_setzero_si256(); + const __m256i threes = _mm256_set1_epi16(3); + const __m256i negate_hibytes = _mm256_set1_epi16(0xff00); + const __m128i wt_extract_los = _mm_cvtsi32_si128(0x06040200); + const __m128i wt_extract_his = _mm_cvtsi32_si128(0x07050301); + + __m256i lo_sum = _mm256_setzero_si256(); + __m256i hi_sum = _mm256_setzero_si256(); + + __m128i wts_128 = _mm_loadl_epi64 ((const __m128i *)&weights); + __m128i wts_lo_128 = _mm_shuffle_epi8(wts_128, wt_extract_los); + __m128i wts_hi_128 = _mm_shuffle_epi8(wts_128, wt_extract_his); + + __m256i wts_lo = _mm256_broadcastsi128_si256(wts_lo_128); + __m256i wts_hi = _mm256_broadcastsi128_si256(wts_hi_128); + + for (int i = 0; i < width * width; i += 32) { + __m256i curr_lo = _mm256_loadu_si256 ((const __m256i *)(coeff + i)); + __m256i curr_abs_lo = _mm256_abs_epi16 (curr_lo); + __m256i curr_max3_lo = _mm256_min_epu16 (curr_abs_lo, threes); + + // 4x4 blocks only have 16 coeffs, so handle them separately + __m256i curr_max3_hi; + if (width >= 8) { + __m256i curr_hi = _mm256_loadu_si256 ((const __m256i *)(coeff + i + 16)); + __m256i curr_abs_hi = _mm256_abs_epi16 (curr_hi); + curr_max3_hi = _mm256_min_epu16 (curr_abs_hi, threes); + curr_max3_hi = _mm256_slli_epi16 (curr_max3_hi, 8); + } else { + // Set MSBs for high bytes if they're meaningless, so shuffles will + // return zeros for them + curr_max3_hi = negate_hibytes; + } + __m256i curr_max3 = _mm256_or_si256 (curr_max3_lo, curr_max3_hi); + __m256i curr_wts_lo = _mm256_shuffle_epi8(wts_lo, curr_max3); + __m256i curr_wts_hi = _mm256_shuffle_epi8(wts_hi, curr_max3); - const __m256i zero = _mm256_setzero_si256(); - const __m256i threes = _mm256_set1_epi16(3); - const __m256i ones = _mm256_srli_epi16(threes, 1); - const __m256i twos = _mm256_slli_epi16(ones, 1); - - __m256i wt[NUM_BUCKETS - 1];
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/quant-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/quant-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/reg_sad_pow2_widths-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/reg_sad_pow2_widths-avx2.h
Changed
@@ -1,30 +1,45 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #ifndef REG_SAD_POW2_WIDTHS_AVX2_H_ #define REG_SAD_POW2_WIDTHS_AVX2_H_ -#include "strategies/sse41/reg_sad_pow2_widths-sse41.h" #include "kvazaar.h" -static INLINE uint32_t reg_sad_w32(const kvz_pixel * const data1, const kvz_pixel * const data2, +#if KVZ_BIT_DEPTH == 8 + +#include "strategies/sse41/reg_sad_pow2_widths-sse41.h" + +static INLINE uint32_t reg_sad_w32(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -74,7 +89,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_w64(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w64(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -129,7 +144,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t hor_sad_avx2_w32(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_avx2_w32(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t pic_stride, uint32_t ref_stride, const uint32_t left, const uint32_t right) { @@ -206,4 +221,6 @@ return _mm_cvtsi128_si32(sad); } +#endif // KVZ_BIT_DEPTH == 8 + #endif
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/sao-avx2.c -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/sao-avx2.c
Changed
@@ -1,26 +1,40 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/avx2/sao-avx2.h" #if COMPILE_INTEL_AVX2 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include <immintrin.h> #include <nmmintrin.h> @@ -31,7 +45,6 @@ #include "cu.h" #include "encoder.h" #include "encoderstate.h" -#include "kvazaar.h" #include "sao.h" #include "strategyselector.h" @@ -271,12 +284,12 @@ return calc_diff_off_delta(diff_lo, diff_hi, offset, orig); } -static int32_t sao_edge_ddistortion_avx2(const kvz_pixel *orig_data, - const kvz_pixel *rec_data, - int32_t block_width, - int32_t block_height, - int32_t eo_class, - const int32_t offsets[NUM_SAO_EDGE_CATEGORIES]) +static int32_t sao_edge_ddistortion_avx2(const uint8_t *orig_data, + const uint8_t *rec_data, + int32_t block_width, + int32_t block_height, + int32_t eo_class, + const int32_t offsets[NUM_SAO_EDGE_CATEGORIES]) { int32_t y, x; vector2d_t a_ofs = g_sao_edge_offsets[eo_class][0]; @@ -407,12 +420,12 @@ } } -static void calc_sao_edge_dir_avx2(const kvz_pixel *orig_data, - const kvz_pixel *rec_data, - int32_t eo_class, - int32_t block_width, - int32_t block_height, - int32_t cat_sum_cnt[2][NUM_SAO_EDGE_CATEGORIES]) +static void calc_sao_edge_dir_avx2(const uint8_t *orig_data, + const uint8_t *rec_data, + int32_t eo_class, + int32_t block_width, + int32_t block_height, + int32_t cat_sum_cnt[2][NUM_SAO_EDGE_CATEGORIES]) { vector2d_t a_ofs = g_sao_edge_offsets[eo_class][0]; vector2d_t b_ofs = g_sao_edge_offsets[eo_class][1]; @@ -608,8 +621,8 @@ } static INLINE void reconstruct_color_band(const encoder_control_t *encoder, - const kvz_pixel *rec_data, - kvz_pixel *new_rec_data, + const uint8_t *rec_data, + uint8_t *new_rec_data, const sao_info_t *sao, int32_t stride, int32_t new_stride, @@ -695,8 +708,8 @@ } static INLINE void reconstruct_color_other(const encoder_control_t *encoder, - const kvz_pixel *rec_data, - kvz_pixel *new_rec_data, + const uint8_t *rec_data, + uint8_t *new_rec_data, const sao_info_t *sao, int32_t stride, int32_t new_stride, @@ -784,8 +797,8 @@ } static void sao_reconstruct_color_avx2(const encoder_control_t *encoder, - const kvz_pixel *rec_data, - kvz_pixel *new_rec_data, + const uint8_t *rec_data, + uint8_t *new_rec_data, const sao_info_t *sao, int32_t stride, int32_t new_stride, @@ -884,18 +897,21 @@ block_height, band_pos, sao_bands); } +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_AVX2 int kvz_strategy_register_sao_avx2(void* opaque, uint8_t bitdepth) { bool success = true; #if COMPILE_INTEL_AVX2 +#if KVZ_BIT_DEPTH == 8 if (bitdepth == 8) { success &= kvz_strategyselector_register(opaque, "sao_edge_ddistortion", "avx2", 40, &sao_edge_ddistortion_avx2); success &= kvz_strategyselector_register(opaque, "calc_sao_edge_dir", "avx2", 40, &calc_sao_edge_dir_avx2); success &= kvz_strategyselector_register(opaque, "sao_reconstruct_color", "avx2", 40, &sao_reconstruct_color_avx2); success &= kvz_strategyselector_register(opaque, "sao_band_ddistortion", "avx2", 40, &sao_band_ddistortion_avx2); } +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_AVX2 return success; }
View file
kvazaar-2.0.0.tar.gz/src/strategies/avx2/sao-avx2.h -> kvazaar-2.1.0.tar.gz/src/strategies/avx2/sao-avx2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/dct-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/dct-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/dct-generic.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/dct-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/dct-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/encode_coding_tree-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/encode_coding_tree-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategyselector.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/encode_coding_tree-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/encode_coding_tree-generic.h
Changed
@@ -4,21 +4,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/intra-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/intra-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/intra-generic.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/intra-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/intra-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/ipol-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/ipol-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/ipol-generic.h" @@ -156,7 +168,7 @@ } } -void kvz_sample_14bit_quarterpel_luma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]) +void kvz_sample_quarterpel_luma_hi_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]) { //TODO: horizontal and vertical only filtering int32_t x, y; @@ -194,8 +206,8 @@ int16_t src_stride, int width, int height, - kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH], - int16_t hor_intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH], + kvz_pixel filtered[4][LCU_LUMA_SIZE], + int16_t hor_intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], int8_t hpel_off_x, int8_t hpel_off_y) @@ -309,8 +321,8 @@ int16_t src_stride, int width, int height, - kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH], - int16_t hor_intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH], + kvz_pixel filtered[4][LCU_LUMA_SIZE], + int16_t hor_intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], int8_t hpel_off_x, int8_t hpel_off_y) @@ -390,8 +402,8 @@ int16_t src_stride, int width, int height, - kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH], - int16_t hor_intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH], + kvz_pixel filtered[4][LCU_LUMA_SIZE], + int16_t hor_intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], int8_t hpel_off_x, int8_t hpel_off_y) @@ -550,8 +562,8 @@ int16_t src_stride, int width, int height, - kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH], - int16_t hor_intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH], + kvz_pixel filtered[4][LCU_LUMA_SIZE], + int16_t hor_intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], int8_t hpel_off_x, int8_t hpel_off_y) @@ -694,7 +706,7 @@ } } -void kvz_sample_14bit_octpel_chroma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]) +void kvz_sample_octpel_chroma_hi_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]) { //TODO: horizontal and vertical only filtering int32_t x, y; @@ -728,59 +740,55 @@ } -void kvz_get_extended_block_generic(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, - int filter_size, int width, int height, kvz_extended_block *out) { - - int half_filter_size = filter_size >> 1; - - out->buffer = ref + (ypos - half_filter_size + off_y + mv_y) * ref_width + (xpos - half_filter_size + off_x + mv_x); - out->stride = ref_width; - out->orig_topleft = out->buffer + out->stride * half_filter_size + half_filter_size; - out->malloc_used = 0; +void kvz_get_extended_block_generic(kvz_epol_args *args) { - int min_y = ypos - half_filter_size + off_y + mv_y; - int max_y = min_y + height + filter_size; - int out_of_bounds_y = (min_y < 0) || (max_y >= ref_height); + int min_y = args->blk_y - args->pad_t; + int max_y = args->blk_y + args->blk_h + args->pad_b + args->pad_b_simd - 1; + bool out_of_bounds_y = (min_y < 0) || (max_y >= args->src_h); - int min_x = xpos - half_filter_size + off_x + mv_x; - int max_x = min_x + width + filter_size; - int out_of_bounds_x = (min_x < 0) || (max_x >= ref_width); + int min_x = args->blk_x - args->pad_l; + int max_x = args->blk_x + args->blk_w + args->pad_r - 1; + bool out_of_bounds_x = (min_x < 0) || (max_x >= args->src_w); - int sample_out_of_bounds = out_of_bounds_y || out_of_bounds_x; + if (out_of_bounds_y || out_of_bounds_x) { - if (sample_out_of_bounds){ - out->buffer = MALLOC(kvz_pixel, (width + filter_size) * (height + filter_size)); - if (!out->buffer){ - fprintf(stderr, "Memory allocation failed!\n"); - assert(0); - } - out->stride = width + filter_size; - out->orig_topleft = out->buffer + out->stride * half_filter_size + half_filter_size; - out->malloc_used = 1; + *args->ext = args->buf; + *args->ext_s = args->pad_l + args->blk_w + args->pad_r; + *args->ext_origin = args->buf + args->pad_t * (*args->ext_s) + args->pad_l; - int dst_y; int y; int dst_x; int x; int coord_x; int coord_y; + // Note that stride equals width here. + int cnt_l = CLIP(0, *args->ext_s, -min_x); + int cnt_r = CLIP(0, *args->ext_s, max_x - (args->src_w - 1)); + int cnt_m = CLIP(0, *args->ext_s, *args->ext_s - cnt_l - cnt_r); - for (dst_y = 0, y = ypos - half_filter_size; y < ((ypos + height)) + half_filter_size; dst_y++, y++) { + // For each row including real padding. + // Don't read "don't care" values (SIMD padding). Zero them out. + int y; + for (y = -args->pad_t; y < args->blk_h + args->pad_b; ++y) { - // calculate y-pixel offset - coord_y = y + off_y + mv_y; - coord_y = CLIP(0, (ref_height)-1, coord_y); - coord_y *= ref_width; + int clipped_y = CLIP(0, args->src_h - 1, args->blk_y + y); + kvz_pixel *sample_l = args->src + clipped_y * args->src_s; + kvz_pixel *sample_r = args->src + clipped_y * args->src_s + args->src_w - 1; + kvz_pixel *src_m = args->src + clipped_y * args->src_s + MAX(min_x, 0); + kvz_pixel *dst_l = args->buf + (y + args->pad_t) * (*args->ext_s); + kvz_pixel *dst_m = dst_l + cnt_l; + kvz_pixel *dst_r = dst_m + cnt_m; + for (int i = 0; i < cnt_l; ++i) *(dst_l + i) = *sample_l; + for (int i = 0; i < cnt_m; ++i) *(dst_m + i) = *(src_m + i); + for (int i = 0; i < cnt_r; ++i) *(dst_r + i) = *sample_r; + } - if (!out_of_bounds_x){ - memcpy(&out->buffer[dst_y * out->stride + 0], &ref[coord_y + min_x], out->stride * sizeof(kvz_pixel)); - } else { - for (dst_x = 0, x = (xpos)-half_filter_size; x < ((xpos + width)) + half_filter_size; dst_x++, x++) { + for (int y_simd = 0; y_simd < args->pad_b_simd; ++y_simd) { + kvz_pixel *dst = args->buf + (y + args->pad_t + y_simd) * (*args->ext_s); + FILL_ARRAY(dst, 0, *args->ext_s); + } - coord_x = x + off_x + mv_x; - coord_x = CLIP(0, (ref_width)-1, coord_x); + } else { - // Store source block data (with extended borders) - out->buffer[dst_y * out->stride + dst_x] = ref[coord_y + coord_x]; - }
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/ipol-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/ipol-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -32,9 +44,9 @@ int kvz_strategy_register_ipol_generic(void* opaque, uint8_t bitdepth); void kvz_sample_quarterpel_luma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, kvz_pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); -void kvz_sample_14bit_quarterpel_luma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); +void kvz_sample_quarterpel_luma_hi_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); void kvz_sample_octpel_chroma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, kvz_pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); -void kvz_sample_14bit_octpel_chroma_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); +void kvz_sample_octpel_chroma_hi_generic(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); #endif //STRATEGIES_IPOL_GENERIC_H_
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/nal-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/nal-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/nal-generic.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/nal-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/nal-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/picture-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/picture-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/picture-generic.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/picture-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/picture-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/quant-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/quant-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/quant-generic.h" @@ -28,6 +40,7 @@ #include "strategies/strategies-quant.h" #include "strategyselector.h" #include "transform.h" +#include "fast_coeff_cost.h" #define QUANT_SHIFT 14 /** @@ -335,46 +348,30 @@ return sum; } -static INLINE int16_t to_q88(float f) +static INLINE void get_coeff_weights(uint64_t wts_packed, uint16_t *weights) { - return (int16_t)(f * 256.0f); + weights[0] = (wts_packed >> 0) & 0xffff; + weights[1] = (wts_packed >> 16) & 0xffff; + weights[2] = (wts_packed >> 32) & 0xffff; + weights[3] = (wts_packed >> 48) & 0xffff; } -static uint32_t fast_coeff_cost_generic(const coeff_t *coeff, int32_t width, int32_t qp) +static uint32_t fast_coeff_cost_generic(const coeff_t *coeff, int32_t width, uint64_t weights) { uint32_t sum = 0; -#define NUM_BUCKETS 5 - const int16_t wt_m[NUM_BUCKETS] = { - to_q88(-0.004916), - to_q88(0.010806), - to_q88(0.055562), - to_q88(0.033436), - to_q88(-0.007690), - }; - const int16_t wt_c[NUM_BUCKETS] = { - to_q88(0.172024), - to_q88(3.421462), - to_q88(2.879506), - to_q88(5.585471), - to_q88(0.256772), - }; - - int16_t wt[NUM_BUCKETS]; - for (int32_t i = 0; i < NUM_BUCKETS; i++) - wt[i] = wt_m[i] * qp + wt_c[i]; + uint16_t weights_unpacked[4]; + + get_coeff_weights(weights, weights_unpacked); for (int32_t i = 0; i < width * width; i++) { - int16_t curr = coeff[i]; - int16_t signmask = curr >> 15; - int16_t curr_abs = (curr ^ signmask) - signmask; - if (curr_abs > 3) + int16_t curr = coeff[i]; + uint32_t curr_abs = abs(curr); + if (curr_abs > 3) { curr_abs = 3; - - sum += wt[curr_abs]; + } + sum += weights_unpacked[curr_abs]; } - sum += wt[NUM_BUCKETS - 1] * width; - return sum >> 8; -#undef NUM_BUCKETS + return (sum + (1 << 7)) >> 8; } int kvz_strategy_register_quant_generic(void* opaque, uint8_t bitdepth)
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/quant-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/quant-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/sao-generic.c -> kvazaar-2.1.0.tar.gz/src/strategies/generic/sao-generic.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/generic/sao-generic.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/sao-generic.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/sao-generic.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/generic/sao_shared_generics.h -> kvazaar-2.1.0.tar.gz/src/strategies/generic/sao_shared_generics.h
Changed
@@ -1,3 +1,35 @@ +/***************************************************************************** + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ + #ifndef SAO_BAND_DDISTORTION_H_ #define SAO_BAND_DDISTORTION_H_
View file
kvazaar-2.0.0.tar.gz/src/strategies/sse2/picture-sse2.c -> kvazaar-2.1.0.tar.gz/src/strategies/sse2/picture-sse2.c
Changed
@@ -1,34 +1,47 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/sse2/picture-sse2.h" #if COMPILE_INTEL_SSE2 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include <immintrin.h> #include <stdlib.h> -#include "kvazaar.h" #include "strategyselector.h" -static unsigned reg_sad_sse2(const kvz_pixel * const data1, const kvz_pixel * const data2, +static unsigned reg_sad_sse2(const uint8_t * const data1, const uint8_t * const data2, const int width, const int height, const unsigned stride1, const unsigned stride2) { int y, x; @@ -53,7 +66,7 @@ return sad; } -static unsigned sad_8bit_4x4_sse2(const kvz_pixel *buf1, const kvz_pixel *buf2) +static unsigned sad_8bit_4x4_sse2(const uint8_t *buf1, const uint8_t *buf2) { const __m128i *const mbuf1 = (const __m128i *)buf1; const __m128i *const mbuf2 = (const __m128i *)buf2; @@ -65,15 +78,18 @@ return result[0] + result[2]; } +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_SSE2 int kvz_strategy_register_picture_sse2(void* opaque, uint8_t bitdepth) { bool success = true; #if COMPILE_INTEL_SSE2 +#if KVZ_BIT_DEPTH == 8 if (bitdepth == 8){ success &= kvz_strategyselector_register(opaque, "reg_sad", "sse2", 10, ®_sad_sse2); success &= kvz_strategyselector_register(opaque, "sad_4x4", "sse2", 10, &sad_8bit_4x4_sse2); } +#endif // KVZ_BIT_DEPTH == 8 #endif return success; }
View file
kvazaar-2.0.0.tar.gz/src/strategies/sse2/picture-sse2.h -> kvazaar-2.1.0.tar.gz/src/strategies/sse2/picture-sse2.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/sse41/picture-sse41.c -> kvazaar-2.1.0.tar.gz/src/strategies/sse41/picture-sse41.c
Changed
@@ -1,36 +1,49 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "global.h" #if COMPILE_INTEL_SSE41 +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include "strategies/sse41/picture-sse41.h" #include "strategies/sse41/reg_sad_pow2_widths-sse41.h" #include <immintrin.h> #include <stdlib.h> -#include "kvazaar.h" #include "strategyselector.h" -uint32_t kvz_reg_sad_sse41(const kvz_pixel * const data1, const kvz_pixel * const data2, +uint32_t kvz_reg_sad_sse41(const uint8_t * const data1, const uint8_t * const data2, const int32_t width, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -68,7 +81,7 @@ return NULL; } -static uint32_t ver_sad_sse41(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_sse41(const uint8_t *pic_data, const uint8_t *ref_data, int32_t width, int32_t height, uint32_t stride) { if (width == 0) @@ -85,7 +98,7 @@ return ver_sad_arbitrary(pic_data, ref_data, width, height, stride); } -static uint32_t hor_sad_sse41_w32(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_sse41_w32(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right) { @@ -194,7 +207,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t hor_sad_sse41(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_sse41(const uint8_t *pic_data, const uint8_t *ref_data, int32_t width, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right) { @@ -215,18 +228,21 @@ pic_stride, ref_stride, left, right); } +#endif // KVZ_BIT_DEPTH == 8 #endif //COMPILE_INTEL_SSE41 int kvz_strategy_register_picture_sse41(void* opaque, uint8_t bitdepth) { bool success = true; #if COMPILE_INTEL_SSE41 +#if KVZ_BIT_DEPTH == 8 if (bitdepth == 8){ success &= kvz_strategyselector_register(opaque, "reg_sad", "sse41", 20, &kvz_reg_sad_sse41); success &= kvz_strategyselector_register(opaque, "get_optimized_sad", "sse41", 20, &get_optimized_sad_sse41); success &= kvz_strategyselector_register(opaque, "ver_sad", "sse41", 20, &ver_sad_sse41); success &= kvz_strategyselector_register(opaque, "hor_sad", "sse41", 20, &hor_sad_sse41); } +#endif // KVZ_BIT_DEPTH == 8 #endif return success; }
View file
kvazaar-2.0.0.tar.gz/src/strategies/sse41/picture-sse41.h -> kvazaar-2.1.0.tar.gz/src/strategies/sse41/picture-sse41.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/sse41/reg_sad_pow2_widths-sse41.h -> kvazaar-2.1.0.tar.gz/src/strategies/sse41/reg_sad_pow2_widths-sse41.h
Changed
@@ -1,38 +1,53 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #ifndef REG_SAD_POW2_WIDTHS_SSE41_H_ #define REG_SAD_POW2_WIDTHS_SSE41_H_ #include "kvazaar.h" + +#if KVZ_BIT_DEPTH == 8 + #include "strategies/missing-intel-intrinsics.h" #include <immintrin.h> -static INLINE uint32_t reg_sad_w0(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w0(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { return 0; } -static INLINE uint32_t reg_sad_w4(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w4(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -71,7 +86,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_w8(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w8(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -122,7 +137,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_w12(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w12(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -141,7 +156,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_w16(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w16(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -186,7 +201,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_w24(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_w24(const uint8_t * const data1, const uint8_t * const data2, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -238,7 +253,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t reg_sad_arbitrary(const kvz_pixel * const data1, const kvz_pixel * const data2, +static INLINE uint32_t reg_sad_arbitrary(const uint8_t * const data1, const uint8_t * const data2, const int32_t width, const int32_t height, const uint32_t stride1, const uint32_t stride2) { @@ -334,7 +349,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t ver_sad_w4(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_w4(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t stride) { __m128i ref_row = _mm_set1_epi32(*(const uint32_t *)ref_data); @@ -371,7 +386,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t ver_sad_w8(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_w8(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t stride) { const __m128i ref_row = _mm_set1_epi64x(*(const uint64_t *)ref_data); @@ -415,7 +430,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t ver_sad_w12(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_w12(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t stride) { const __m128i ref_row = _mm_loadu_si128((__m128i *)ref_data); @@ -434,7 +449,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t ver_sad_w16(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_w16(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t stride) { const __m128i ref_row = _mm_loadu_si128((__m128i *)ref_data); @@ -474,7 +489,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t ver_sad_arbitrary(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t ver_sad_arbitrary(const uint8_t *pic_data, const uint8_t *ref_data, int32_t width, int32_t height, uint32_t stride) { int32_t y, x; @@ -561,7 +576,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t hor_sad_sse41_w4(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_sse41_w4(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right) { @@ -625,7 +640,7 @@ return _mm_cvtsi128_si32(sad); } -static uint32_t hor_sad_sse41_w8(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_sse41_w8(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right) { @@ -738,7 +753,7 @@ * border pixel, and use a suitable mask to fill all the other pixels with * that value. */ -static uint32_t hor_sad_sse41_w16(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static uint32_t hor_sad_sse41_w16(const uint8_t *pic_data, const uint8_t *ref_data, int32_t height, uint32_t pic_stride, uint32_t ref_stride, const uint32_t left, const uint32_t right) { @@ -821,7 +836,7 @@ return _mm_cvtsi128_si32(sad); } -static INLINE uint32_t hor_sad_sse41_arbitrary(const kvz_pixel *pic_data, const kvz_pixel *ref_data, +static INLINE uint32_t hor_sad_sse41_arbitrary(const uint8_t *pic_data, const uint8_t *ref_data, int32_t width, int32_t height, uint32_t pic_stride, uint32_t ref_stride, uint32_t left, uint32_t right) { @@ -1024,4 +1039,6 @@ return _mm_cvtsi128_si32(sad); }
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-dct.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-dct.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-dct.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-dct.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-dct.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-encode.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-encode.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-encode.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-encode.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-encode.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-intra.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-intra.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-intra.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-intra.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-intra.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-ipol.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-ipol.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-ipol.h" @@ -33,8 +45,8 @@ epol_func *kvz_get_extended_block; kvz_sample_quarterpel_luma_func * kvz_sample_quarterpel_luma; kvz_sample_octpel_chroma_func * kvz_sample_octpel_chroma; -kvz_sample_14bit_quarterpel_luma_func * kvz_sample_14bit_quarterpel_luma; -kvz_sample_14bit_octpel_chroma_func * kvz_sample_14bit_octpel_chroma; +kvz_sample_quarterpel_luma_hi_func * kvz_sample_quarterpel_luma_hi; +kvz_sample_octpel_chroma_hi_func * kvz_sample_octpel_chroma_hi; int kvz_strategy_register_ipol(void* opaque, uint8_t bitdepth) {
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-ipol.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-ipol.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -31,21 +43,63 @@ #include "kvazaar.h" #include "search_inter.h" +// AVX2 implementation of horizontal filter reads and +// writes two rows for luma and four for chroma at a time. +// Extra vertical padding is added to prevent segfaults. +// Horizontal padding is not needed even if one extra byte +// is read because kvz_image_alloc adds enough padding. +#define KVZ_IPOL_MAX_INPUT_SIZE_LUMA_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * KVZ_EXT_BLOCK_W_LUMA) +#define KVZ_IPOL_MAX_INPUT_SIZE_CHROMA_SIMD ((KVZ_EXT_BLOCK_W_CHROMA + 3) * KVZ_EXT_BLOCK_W_CHROMA) +#define KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH) +#define KVZ_IPOL_MAX_IM_SIZE_CHROMA_SIMD ((KVZ_EXT_BLOCK_W_CHROMA + 3) * LCU_WIDTH_C) + +// On top of basic interpolation, FME needs one extra +// column and row for ME (left and up). Adding the +// extra row happens to satisfy AVX2 requirements for +// row count. No other extra rows are needed. +#define KVZ_FME_MAX_INPUT_SIZE_SIMD ((KVZ_EXT_BLOCK_W_LUMA + 1) * (KVZ_EXT_BLOCK_W_LUMA + 1)) typedef struct { kvz_pixel *buffer; kvz_pixel *orig_topleft; unsigned stride; unsigned malloc_used; } kvz_extended_block; typedef void(ipol_blocks_func)(const encoder_control_t * encoder, kvz_pixel *src, int16_t src_stride, int width, int height, - kvz_pixel filtered[4][LCU_WIDTH * LCU_WIDTH], int16_t hor_intermediate[5][(KVZ_EXT_BLOCK_W_LUMA + 1) * LCU_WIDTH], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], + kvz_pixel filtered[4][LCU_LUMA_SIZE], int16_t hor_intermediate[5][KVZ_IPOL_MAX_IM_SIZE_LUMA_SIMD], int8_t fme_level, int16_t hor_first_cols[5][KVZ_EXT_BLOCK_W_LUMA + 1], int8_t sample_off_x, int8_t sample_off_y); -typedef unsigned(epol_func)(int xpos, int ypos, int mv_x, int mv_y, int off_x, int off_y, kvz_pixel *ref, int ref_width, int ref_height, - int filter_size, int width, int height, kvz_extended_block *out); +typedef struct { + // Source samples + kvz_pixel *src; // Top-left sample + int src_w; // Width + int src_h; // Height + int src_s; // Stride + + // Requested sampling position, base dimensions, and padding + int blk_x; + int blk_y; + int blk_w; // Width + int blk_h; // Height + int pad_l; // Left + int pad_r; // Right + int pad_t; // Top + int pad_b; // Bottom + int pad_b_simd; // "Don't care" rows in the end. Zeroed out. + + // Buffer for possible extrapolation. Free memory provided by the caller. + kvz_pixel *buf; + + // Extended block data. These are set by the function. + kvz_pixel **ext; // Top-left sample with padding + kvz_pixel **ext_origin; // Top-left sample without padding + int *ext_s; // Stride +} kvz_epol_args; + +typedef void(epol_func)(kvz_epol_args *args); + typedef void(kvz_sample_quarterpel_luma_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, kvz_pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); typedef void(kvz_sample_octpel_chroma_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, kvz_pixel *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); -typedef void(kvz_sample_14bit_quarterpel_luma_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); -typedef void(kvz_sample_14bit_octpel_chroma_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); +typedef void(kvz_sample_quarterpel_luma_hi_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); +typedef void(kvz_sample_octpel_chroma_hi_func)(const encoder_control_t * const encoder, kvz_pixel *src, int16_t src_stride, int width, int height, int16_t *dst, int16_t dst_stride, int8_t hor_flag, int8_t ver_flag, const int16_t mv[2]); // Declare function pointers. extern ipol_blocks_func * kvz_filter_hpel_blocks_hor_ver_luma; @@ -55,8 +109,8 @@ extern epol_func * kvz_get_extended_block; extern kvz_sample_quarterpel_luma_func * kvz_sample_quarterpel_luma; extern kvz_sample_octpel_chroma_func * kvz_sample_octpel_chroma; -extern kvz_sample_14bit_quarterpel_luma_func * kvz_sample_14bit_quarterpel_luma; -extern kvz_sample_14bit_octpel_chroma_func * kvz_sample_14bit_octpel_chroma; +extern kvz_sample_quarterpel_luma_hi_func * kvz_sample_quarterpel_luma_hi; +extern kvz_sample_octpel_chroma_hi_func * kvz_sample_octpel_chroma_hi; int kvz_strategy_register_ipol(void* opaque, uint8_t bitdepth); @@ -69,8 +123,8 @@ {"filter_qpel_blocks_diag_luma", (void**) &kvz_filter_qpel_blocks_diag_luma}, \ {"sample_quarterpel_luma", (void**) &kvz_sample_quarterpel_luma}, \ {"sample_octpel_chroma", (void**) &kvz_sample_octpel_chroma}, \ - {"sample_14bit_quarterpel_luma", (void**) &kvz_sample_14bit_quarterpel_luma}, \ - {"sample_14bit_octpel_chroma", (void**) &kvz_sample_14bit_octpel_chroma}, \ + {"sample_quarterpel_luma_hi", (void**) &kvz_sample_quarterpel_luma_hi}, \ + {"sample_octpel_chroma_hi", (void**) &kvz_sample_octpel_chroma_hi}, \ {"get_extended_block", (void**) &kvz_get_extended_block}, \
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-nal.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-nal.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-nal.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-nal.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-nal.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-picture.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-picture.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-picture.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-picture.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-picture.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-quant.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-quant.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-quant.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-quant.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-quant.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -32,7 +44,6 @@ #include "kvazaar.h" #include "tables.h" - // Declare function pointers. typedef unsigned (quant_func)(const encoder_state_t * const state, coeff_t *coef, coeff_t *q_coef, int32_t width, int32_t height, int8_t type, int8_t scan_idx, int8_t block_type); @@ -45,7 +56,7 @@ bool early_skip); typedef unsigned (dequant_func)(const encoder_state_t * const state, coeff_t *q_coef, coeff_t *coef, int32_t width, int32_t height, int8_t type, int8_t block_type); -typedef uint32_t (fast_coeff_cost_func)(const coeff_t *coeff, int32_t width, int32_t qp); +typedef uint32_t (fast_coeff_cost_func)(const coeff_t *coeff, int32_t width, uint64_t weights); typedef uint32_t (coeff_abs_sum_func)(const coeff_t *coeffs, size_t length);
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-sao.c -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-sao.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/strategies-sao.h"
View file
kvazaar-2.0.0.tar.gz/src/strategies/strategies-sao.h -> kvazaar-2.1.0.tar.gz/src/strategies/strategies-sao.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-sad.asm -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-sad.asm
Changed
@@ -1,22 +1,34 @@ -;/**************************************************************************** +;/***************************************************************************** ; * This file is part of Kvazaar HEVC encoder. ; * -; * Copyright (C) 2013-2015 Tampere University of Technology and others (see -; * COPYING file). -; * -; * Kvazaar is free software: you can redistribute it and/or modify it under -; * the terms of the GNU Lesser General Public License as published by the -; * Free Software Foundation; either version 2.1 of the License, or (at your -; * option) any later version. -; * -; * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -; * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -; * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -; * more details. -; * -; * You should have received a copy of the GNU General Public License along -; * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -; ***************************************************************************/ +; * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors +; * All rights reserved. +; * +; * Redistribution and use in source and binary forms, with or without modification, +; * are permitted provided that the following conditions are met: +; * +; * * Redistributions of source code must retain the above copyright notice, this +; * list of conditions and the following disclaimer. +; * +; * * Redistributions in binary form must reproduce the above copyright notice, this +; * list of conditions and the following disclaimer in the documentation and/or +; * other materials provided with the distribution. +; * +; * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its +; * contributors may be used to endorse or promote products derived from +; * this software without specific prior written permission. +; * +; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +; * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +; * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +; * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; ****************************************************************************/ %include "x86inc.asm"
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-sad.h -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-sad.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -27,17 +39,18 @@ */ #include "global.h" // IWYU pragma: keep +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 +unsigned kvz_sad_4x4_avx(const uint8_t*, const uint8_t*); +unsigned kvz_sad_8x8_avx(const uint8_t*, const uint8_t*); +unsigned kvz_sad_16x16_avx(const uint8_t*, const uint8_t*); -unsigned kvz_sad_4x4_avx(const kvz_pixel*, const kvz_pixel*); -unsigned kvz_sad_8x8_avx(const kvz_pixel*, const kvz_pixel*); -unsigned kvz_sad_16x16_avx(const kvz_pixel*, const kvz_pixel*); - -unsigned kvz_sad_4x4_stride_avx(const kvz_pixel *data1, const kvz_pixel *data2, unsigned stride); -unsigned kvz_sad_8x8_stride_avx(const kvz_pixel *data1, const kvz_pixel *data2, unsigned stride); -unsigned kvz_sad_16x16_stride_avx(const kvz_pixel *data1, const kvz_pixel *data2, unsigned stride); -unsigned kvz_sad_32x32_stride_avx(const kvz_pixel *data1, const kvz_pixel *data2, unsigned stride); -unsigned kvz_sad_64x64_stride_avx(const kvz_pixel *data1, const kvz_pixel *data2, unsigned stride); - +unsigned kvz_sad_4x4_stride_avx(const uint8_t *data1, const uint8_t *data2, unsigned stride); +unsigned kvz_sad_8x8_stride_avx(const uint8_t *data1, const uint8_t *data2, unsigned stride); +unsigned kvz_sad_16x16_stride_avx(const uint8_t *data1, const uint8_t *data2, unsigned stride); +unsigned kvz_sad_32x32_stride_avx(const uint8_t *data1, const uint8_t *data2, unsigned stride); +unsigned kvz_sad_64x64_stride_avx(const uint8_t *data1, const uint8_t *data2, unsigned stride); +#endif // KVZ_BIT_DEPTH == 8 #endif
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-satd.asm -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-satd.asm
Changed
@@ -1,22 +1,34 @@ -;/**************************************************************************** +;/***************************************************************************** ; * This file is part of Kvazaar HEVC encoder. ; * -; * Copyright (C) 2013-2015 Tampere University of Technology and others (see -; * COPYING file). -; * -; * Kvazaar is free software: you can redistribute it and/or modify it under -; * the terms of the GNU Lesser General Public License as published by the -; * Free Software Foundation; either version 2.1 of the License, or (at your -; * option) any later version. -; * -; * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY -; * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -; * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for -; * more details. -; * -; * You should have received a copy of the GNU General Public License along -; * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -; ***************************************************************************/ +; * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors +; * All rights reserved. +; * +; * Redistribution and use in source and binary forms, with or without modification, +; * are permitted provided that the following conditions are met: +; * +; * * Redistributions of source code must retain the above copyright notice, this +; * list of conditions and the following disclaimer. +; * +; * * Redistributions in binary form must reproduce the above copyright notice, this +; * list of conditions and the following disclaimer in the documentation and/or +; * other materials provided with the distribution. +; * +; * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its +; * contributors may be used to endorse or promote products derived from +; * this software without specific prior written permission. +; * +; * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +; * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +; * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +; * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +; * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +; * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +; * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +; * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +; * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +; ****************************************************************************/ %include "x86inc.asm"
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-satd.h -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm-satd.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm.c -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm.c
Changed
@@ -1,36 +1,49 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategies/x86_asm/picture-x86-asm.h" #if defined(KVZ_COMPILE_ASM) +#include "kvazaar.h" +#if KVZ_BIT_DEPTH == 8 #include <stdlib.h> -#include "kvazaar.h" #include "strategies/x86_asm/picture-x86-asm-sad.h" #include "strategies/x86_asm/picture-x86-asm-satd.h" #include "strategies/sse41/picture-sse41.h" #include "strategyselector.h" -static unsigned kvz_sad_32x32_avx(const kvz_pixel *data1, const kvz_pixel *data2) +static unsigned kvz_sad_32x32_avx(const uint8_t *data1, const uint8_t *data2) { unsigned sad = 0; sad += kvz_sad_16x16_avx(data1, data2); @@ -40,7 +53,7 @@ return sad; } -static unsigned kvz_sad_64x64_avx(const kvz_pixel *data1, const kvz_pixel *data2) +static unsigned kvz_sad_64x64_avx(const uint8_t *data1, const uint8_t *data2) { unsigned sad = 0; sad += kvz_sad_32x32_avx(data1, data2); @@ -50,7 +63,7 @@ return sad; } -static unsigned kvz_sad_other_avx(const kvz_pixel *data1, const kvz_pixel *data2, +static unsigned kvz_sad_other_avx(const uint8_t *data1, const uint8_t *data2, int width, int height, unsigned stride) { @@ -65,7 +78,7 @@ return sad; } -static unsigned reg_sad_x86_asm(const kvz_pixel *data1, const kvz_pixel * data2, +static unsigned reg_sad_x86_asm(const uint8_t *data1, const uint8_t * data2, const int width, const int height, const unsigned stride1, const unsigned stride2) { @@ -90,12 +103,14 @@ } } +#endif // KVZ_BIT_DEPTH == 8 #endif //defined(KVZ_COMPILE_ASM) int kvz_strategy_register_picture_x86_asm_avx(void* opaque, uint8_t bitdepth) { bool success = true; #if defined(KVZ_COMPILE_ASM) +#if KVZ_BIT_DEPTH == 8 if (bitdepth == 8){ success &= kvz_strategyselector_register(opaque, "reg_sad", "x86_asm_avx", 30, ®_sad_x86_asm); @@ -111,6 +126,7 @@ success &= kvz_strategyselector_register(opaque, "satd_32x32", "x86_asm_avx", 30, &kvz_satd_32x32_avx); success &= kvz_strategyselector_register(opaque, "satd_64x64", "x86_asm_avx", 30, &kvz_satd_64x64_avx); } +#endif // KVZ_BIT_DEPTH == 8 #endif //!defined(KVZ_COMPILE_ASM) return success; }
View file
kvazaar-2.0.0.tar.gz/src/strategies/x86_asm/picture-x86-asm.h -> kvazaar-2.1.0.tar.gz/src/strategies/x86_asm/picture-x86-asm.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/strategyselector.c -> kvazaar-2.1.0.tar.gz/src/strategyselector.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "strategyselector.h"
View file
kvazaar-2.0.0.tar.gz/src/strategyselector.h -> kvazaar-2.1.0.tar.gz/src/strategyselector.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/tables.h -> kvazaar-2.1.0.tar.gz/src/tables.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/threadqueue.c -> kvazaar-2.1.0.tar.gz/src/threadqueue.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "global.h"
View file
kvazaar-2.0.0.tar.gz/src/threadqueue.h -> kvazaar-2.1.0.tar.gz/src/threadqueue.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/threads.h -> kvazaar-2.1.0.tar.gz/src/threads.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/transform.c -> kvazaar-2.1.0.tar.gz/src/transform.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "transform.h"
View file
kvazaar-2.0.0.tar.gz/src/transform.h -> kvazaar-2.1.0.tar.gz/src/transform.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /** @@ -31,7 +43,6 @@ #include "encoderstate.h" #include "global.h" // IWYU pragma: keep - extern const uint8_t kvz_g_chroma_scale[58]; extern const int16_t kvz_g_inv_quant_scales[6];
View file
kvazaar-2.0.0.tar.gz/src/videoframe.c -> kvazaar-2.1.0.tar.gz/src/videoframe.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "videoframe.h"
View file
kvazaar-2.0.0.tar.gz/src/videoframe.h -> kvazaar-2.1.0.tar.gz/src/videoframe.h
Changed
@@ -3,21 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /**
View file
kvazaar-2.0.0.tar.gz/src/yuv_io.c -> kvazaar-2.1.0.tar.gz/src/yuv_io.c
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ /* @@ -188,6 +200,25 @@ } +static int read_frame_header(FILE* input) { + char buffer[256]; + bool frame_start = false; + + while (!frame_start) { + for (int i = 0; i < 256; i++) { + buffer[i] = getc(input); + if (buffer[i] == EOF) return 0; + // ToDo: frame headers can have some information structured same as start headers + // This info is just skipped for now, since it's not clear what it could be. + if (buffer[i] == 0x0A) { + frame_start = true; + break; + } + } + } + return 1; +} + /** * \brief Read a single frame from a file. * @@ -204,13 +235,20 @@ int yuv_io_read(FILE* file, unsigned in_width, unsigned out_width, unsigned in_bitdepth, unsigned out_bitdepth, - kvz_picture *img_out) + kvz_picture *img_out, unsigned file_format) { assert(in_width % 2 == 0); assert(out_width % 2 == 0); int ok; + if (file_format == KVZ_FORMAT_Y4M) { + ok = read_frame_header(file); + if (!ok) return 0; + } + + + ok = yuv_io_read_plane( file, in_width, out_width, in_bitdepth, @@ -254,9 +292,19 @@ * \return 1 on success, 0 on failure */ int yuv_io_seek(FILE* file, unsigned frames, - unsigned input_width, unsigned input_height) + unsigned input_width, unsigned input_height, + unsigned file_format) { const size_t frame_bytes = input_width * input_height * 3 / 2; + + if (file_format == KVZ_FORMAT_Y4M) { + for (unsigned i = 0; i < frames; i++) { + if (!read_frame_header(file)) return 0; + if (fseek(file, frame_bytes, SEEK_CUR)) return 0; + } + return 1; + } + const int64_t skip_bytes = (int64_t)(frames * frame_bytes); // Attempt to seek normally.
View file
kvazaar-2.0.0.tar.gz/src/yuv_io.h -> kvazaar-2.1.0.tar.gz/src/yuv_io.h
Changed
@@ -1,21 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify it under - * the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation; either version 2.1 of the License, or (at your - * option) any later version. - * - * Kvazaar is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #ifndef YUV_IO_H_ @@ -34,10 +46,11 @@ int yuv_io_read(FILE* file, unsigned input_width, unsigned input_height, unsigned from_bitdepth, unsigned to_bitdepth, - kvz_picture *img_out); + kvz_picture *img_out, unsigned file_format); int yuv_io_seek(FILE* file, unsigned frames, - unsigned input_width, unsigned input_height); + unsigned input_width, unsigned input_height, + unsigned file_format); int yuv_io_write(FILE* file, const kvz_picture *img,
View file
kvazaar-2.0.0.tar.gz/tests/coeff_sum_tests.c -> kvazaar-2.1.0.tar.gz/tests/coeff_sum_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2017 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/dct_tests.c -> kvazaar-2.1.0.tar.gz/tests/dct_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/inter_recon_bipred_tests.c -> kvazaar-2.1.0.tar.gz/tests/inter_recon_bipred_tests.c
Changed
@@ -1,21 +1,34 @@ /***************************************************************************** -* This file is part of Kvazaar HEVC encoder. -* -* Copyright (C) 2017 Tampere University of Technology and others (see -* COPYING file). -* -* Kvazaar is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 2.1 as -* published by the Free Software Foundation. -* -* Kvazaar is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. -****************************************************************************/ + * This file is part of Kvazaar HEVC encoder. + * + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS + ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/intra_sad_tests.c -> kvazaar-2.1.0.tar.gz/tests/intra_sad_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/mv_cand_tests.c -> kvazaar-2.1.0.tar.gz/tests/mv_cand_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "src/inter.c"
View file
kvazaar-2.0.0.tar.gz/tests/sad_tests.c -> kvazaar-2.1.0.tar.gz/tests/sad_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/sad_tests.h -> kvazaar-2.1.0.tar.gz/tests/sad_tests.h
Changed
@@ -3,20 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ void sad_tests(void);
View file
kvazaar-2.0.0.tar.gz/tests/satd_tests.c -> kvazaar-2.1.0.tar.gz/tests/satd_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/satd_tests.h -> kvazaar-2.1.0.tar.gz/tests/satd_tests.h
Changed
@@ -3,20 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ void satd_tests(void);
View file
kvazaar-2.0.0.tar.gz/tests/speed_tests.c -> kvazaar-2.1.0.tar.gz/tests/speed_tests.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/test_strategies.c -> kvazaar-2.1.0.tar.gz/tests/test_strategies.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "test_strategies.h"
View file
kvazaar-2.0.0.tar.gz/tests/test_strategies.h -> kvazaar-2.1.0.tar.gz/tests/test_strategies.h
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #ifndef TEST_STRATEGIES_H_
View file
kvazaar-2.0.0.tar.gz/tests/tests_main.c -> kvazaar-2.1.0.tar.gz/tests/tests_main.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ #include "greatest/greatest.h"
View file
kvazaar-2.0.0.tar.gz/tests/tsan_suppressions.txt -> kvazaar-2.1.0.tar.gz/tests/tsan_suppressions.txt
Changed
@@ -1,3 +1,4 @@ -race:kvz_eight_tap_filter_hor_8x1_avx2 +# AVX2 interpolation reads some extra pixels +race:kvz_ipol_8tap_hor_px_im_avx2 race:kvz_filter_hpel_blocks_hor_ver_luma_avx2 -race:kvz_eight_tap_filter_hor_avx2 \ No newline at end of file +race:kvz_eight_tap_filter_hor_avx2
View file
kvazaar-2.0.0.tar.gz/tools/generate_ref_pixel_tables.py -> kvazaar-2.1.0.tar.gz/tools/generate_ref_pixel_tables.py
Changed
@@ -3,20 +3,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ This script is provided as reference, in case we ever need to change the tables
View file
kvazaar-2.0.0.tar.gz/tools/generate_tables.c -> kvazaar-2.1.0.tar.gz/tools/generate_tables.c
Changed
@@ -1,20 +1,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ //Compile with gcc -o generate_tables generate_tables.c
View file
kvazaar-2.0.0.tar.gz/tools/plot-threadqueue-log.py -> kvazaar-2.1.0.tar.gz/tools/plot-threadqueue-log.py
Changed
@@ -2,20 +2,33 @@ /***************************************************************************** * This file is part of Kvazaar HEVC encoder. * - * Copyright (C) 2013-2015 Tampere University of Technology and others (see - * COPYING file). - * - * Kvazaar is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 2.1 as - * published by the Free Software Foundation. - * - * Kvazaar is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. + * Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, this + * list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + * + * * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ****************************************************************************/ """
View file
kvazaar-2.0.0.tar.gz/tools/update_readme.sh -> kvazaar-2.1.0.tar.gz/tools/update_readme.sh
Changed
@@ -1,20 +1,33 @@ #!/bin/sh # This file is part of Kvazaar HEVC encoder. # -# Copyright (C) 2013-2016 Tampere University of Technology and others (see -# COPYING file). -# -# Kvazaar is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License version 2.1 as -# published by the Free Software Foundation. -# -# Kvazaar is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with Kvazaar. If not, see <http://www.gnu.org/licenses/>. +# Copyright (c) 2021, Tampere University, ITU/ISO/IEC, project contributors +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, this +# list of conditions and the following disclaimer in the documentation and/or +# other materials provided with the distribution. +# +# * Neither the name of the Tampere University or ITU/ISO/IEC nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # This script updates parameter documentation in ../README.md file.
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.