Commit 77bba8d3 authored by Yushin Cho's avatar Yushin Cho Committed by Yaowu Xu

New experiment: Perceptual Vector Quantization from Daala

PVQ replaces the scalar quantizer and coefficient coding with a new
design originally developed in Daala. It currently depends on the
Daala entropy coder although it could be adapted to work with another
entropy coder if needed:
./configure --enable-experimental --enable-daala_ec --enable-pvq

The version of PVQ in this commit is adapted from the following
revision of Daala:
https://github.com/xiph/daala/commit/fb51c1ade6a31b668a0157d89de8f0a4493162a8

More information about PVQ:
- https://people.xiph.org/~jm/daala/pvq_demo/
- https://jmvalin.ca/papers/spie_pvq.pdf

The following files are copied as-is from Daala with minimal
adaptations, therefore we disable clang-format on those files
to make it easier to synchronize the AV1 and Daala codebases in the future:
 av1/common/generic_code.c
 av1/common/generic_code.h
 av1/common/laplace_tables.c
 av1/common/partition.c
 av1/common/partition.h
 av1/common/pvq.c
 av1/common/pvq.h
 av1/common/state.c
 av1/common/state.h
 av1/common/zigzag.h
 av1/common/zigzag16.c
 av1/common/zigzag32.c
 av1/common/zigzag4.c
 av1/common/zigzag64.c
 av1/common/zigzag8.c
 av1/decoder/decint.h
 av1/decoder/generic_decoder.c
 av1/decoder/laplace_decoder.c
 av1/decoder/pvq_decoder.c
 av1/decoder/pvq_decoder.h
 av1/encoder/daala_compat_enc.c
 av1/encoder/encint.h
 av1/encoder/generic_encoder.c
 av1/encoder/laplace_encoder.c
 av1/encoder/pvq_encoder.c
 av1/encoder/pvq_encoder.h

Known issues:
- Lossless mode is not supported, '--lossless=1' will give the same result as
'--end-usage=q --cq-level=1'.
- High bit depth is not supported by PVQ.

Change-Id: I1ae0d6517b87f4c1ccea944b2e12dc906979f25e
parent ec994d8b
...@@ -216,6 +216,24 @@ DSP_SRCS-$(HAVE_MSA) += mips/fwd_txfm_msa.c ...@@ -216,6 +216,24 @@ DSP_SRCS-$(HAVE_MSA) += mips/fwd_txfm_msa.c
DSP_SRCS-$(HAVE_MSA) += mips/fwd_dct32x32_msa.c DSP_SRCS-$(HAVE_MSA) += mips/fwd_dct32x32_msa.c
endif # CONFIG_AV1_ENCODER endif # CONFIG_AV1_ENCODER
ifeq ($(CONFIG_PVQ),yes)
DSP_SRCS-yes += fwd_txfm.c
DSP_SRCS-yes += fwd_txfm.h
DSP_SRCS-$(HAVE_SSE2) += x86/fwd_txfm_sse2.h
DSP_SRCS-$(HAVE_SSE2) += x86/fwd_txfm_sse2.c
DSP_SRCS-$(HAVE_SSE2) += x86/fwd_txfm_impl_sse2.h
DSP_SRCS-$(HAVE_SSE2) += x86/fwd_dct32x32_impl_sse2.h
ifeq ($(ARCH_X86_64),yes)
DSP_SRCS-$(HAVE_SSSE3) += x86/fwd_txfm_ssse3_x86_64.asm
endif
DSP_SRCS-$(HAVE_AVX2) += x86/fwd_txfm_avx2.c
DSP_SRCS-$(HAVE_AVX2) += x86/fwd_dct32x32_impl_avx2.h
DSP_SRCS-$(HAVE_NEON) += arm/fwd_txfm_neon.c
DSP_SRCS-$(HAVE_MSA) += mips/fwd_txfm_msa.h
DSP_SRCS-$(HAVE_MSA) += mips/fwd_txfm_msa.c
DSP_SRCS-$(HAVE_MSA) += mips/fwd_dct32x32_msa.c
endif # CONFIG_PVQ
# inverse transform # inverse transform
ifeq ($(CONFIG_AV1), yes) ifeq ($(CONFIG_AV1), yes)
DSP_SRCS-yes += inv_txfm.h DSP_SRCS-yes += inv_txfm.h
......
...@@ -699,7 +699,7 @@ if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") { ...@@ -699,7 +699,7 @@ if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") {
# #
# Forward transform # Forward transform
# #
if (aom_config("CONFIG_AV1_ENCODER") eq "yes") { if ((aom_config("CONFIG_AV1_ENCODER") eq "yes") || (aom_config("CONFIG_PVQ") eq "yes")){
if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") { if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") {
add_proto qw/void aom_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride"; add_proto qw/void aom_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/aom_fdct4x4 sse2/; specialize qw/aom_fdct4x4 sse2/;
......
...@@ -41,7 +41,7 @@ uint32_t aom_daala_reader_tell_frac(const daala_reader *r); ...@@ -41,7 +41,7 @@ uint32_t aom_daala_reader_tell_frac(const daala_reader *r);
static INLINE int aom_daala_read(daala_reader *r, int prob) { static INLINE int aom_daala_read(daala_reader *r, int prob) {
if (prob == 128) { if (prob == 128) {
return od_ec_dec_bits(&r->ec, 1); return od_ec_dec_bits(&r->ec, 1, "aom_bits");
} else { } else {
int p = ((prob << 15) + (256 - prob)) >> 8; int p = ((prob << 15) + (256 - prob)) >> 8;
return od_ec_decode_bool_q15(&r->ec, p); return od_ec_decode_bool_q15(&r->ec, p);
......
/*Daala video codec /*
Copyright (c) 2001-2012 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "./config.h" #include "./config.h"
......
/*Daala video codec /*
Copyright (c) 2001-2013 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.*/
#if !defined(_entcode_H) #if !defined(_entcode_H)
#define _entcode_H (1) #define _entcode_H (1)
......
/*Daala video codec /*
Copyright (c) 2001-2013 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "./config.h" #include "./config.h"
...@@ -440,7 +427,7 @@ uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft) { ...@@ -440,7 +427,7 @@ uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft) {
ftb = OD_ILOG_NZ(ft) - OD_EC_UINT_BITS; ftb = OD_ILOG_NZ(ft) - OD_EC_UINT_BITS;
ft1 = (int)(ft >> ftb) + 1; ft1 = (int)(ft >> ftb) + 1;
t = od_ec_decode_cdf_q15(dec, OD_UNIFORM_CDF_Q15(ft1), ft1); t = od_ec_decode_cdf_q15(dec, OD_UNIFORM_CDF_Q15(ft1), ft1);
t = t << ftb | od_ec_dec_bits(dec, ftb); t = t << ftb | od_ec_dec_bits(dec, ftb, "");
if (t <= ft) return t; if (t <= ft) return t;
dec->error = 1; dec->error = 1;
return ft; return ft;
...@@ -453,7 +440,7 @@ uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft) { ...@@ -453,7 +440,7 @@ uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft) {
ftb: The number of bits to extract. ftb: The number of bits to extract.
This must be between 0 and 25, inclusive. This must be between 0 and 25, inclusive.
Return: The decoded bits.*/ Return: The decoded bits.*/
uint32_t od_ec_dec_bits(od_ec_dec *dec, unsigned ftb) { uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb) {
od_ec_window window; od_ec_window window;
int available; int available;
uint32_t ret; uint32_t ret;
......
/*Daala video codec /*
Copyright (c) 2001-2013 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.*/
#if !defined(_entdec_H) #if !defined(_entdec_H)
#define _entdec_H (1) #define _entdec_H (1)
...@@ -33,6 +20,14 @@ extern "C" { ...@@ -33,6 +20,14 @@ extern "C" {
typedef struct od_ec_dec od_ec_dec; typedef struct od_ec_dec od_ec_dec;
#if OD_ACCOUNTING
#define OD_ACC_STR , char *acc_str
#define od_ec_dec_bits(dec, ftb, str) od_ec_dec_bits_(dec, ftb, str)
#else
#define OD_ACC_STR
#define od_ec_dec_bits(dec, ftb, str) od_ec_dec_bits_(dec, ftb)
#endif
/*The entropy decoder context.*/ /*The entropy decoder context.*/
struct od_ec_dec { struct od_ec_dec {
/*The start of the current input buffer.*/ /*The start of the current input buffer.*/
...@@ -91,7 +86,7 @@ OD_WARN_UNUSED_RESULT int od_ec_decode_cdf_unscaled_dyadic(od_ec_dec *dec, ...@@ -91,7 +86,7 @@ OD_WARN_UNUSED_RESULT int od_ec_decode_cdf_unscaled_dyadic(od_ec_dec *dec,
OD_WARN_UNUSED_RESULT uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft) OD_WARN_UNUSED_RESULT uint32_t od_ec_dec_uint(od_ec_dec *dec, uint32_t ft)
OD_ARG_NONNULL(1); OD_ARG_NONNULL(1);
OD_WARN_UNUSED_RESULT uint32_t od_ec_dec_bits(od_ec_dec *dec, unsigned ftb) OD_WARN_UNUSED_RESULT uint32_t od_ec_dec_bits_(od_ec_dec *dec, unsigned ftb)
OD_ARG_NONNULL(1); OD_ARG_NONNULL(1);
OD_WARN_UNUSED_RESULT int od_ec_dec_tell(const od_ec_dec *dec) OD_WARN_UNUSED_RESULT int od_ec_dec_tell(const od_ec_dec *dec)
......
/*Daala video codec /*
Copyright (c) 2001-2013 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "./config.h" #include "./config.h"
......
/*Daala video codec /*
Copyright (c) 2001-2013 Daala project contributors. All rights reserved. * Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
Redistribution and use in source and binary forms, with or without * This source code is subject to the terms of the BSD 2 Clause License and
modification, are permitted provided that the following conditions are met: * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
- Redistributions of source code must retain the above copyright notice, this * obtain it at www.aomedia.org/license/software. If the Alliance for Open
list of conditions and the following disclaimer. * Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
- Redistributions in binary form must reproduce the above copyright notice, */
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER 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.*/
#if !defined(_entenc_H) #if !defined(_entenc_H)
#define _entenc_H (1) #define _entenc_H (1)
......
...@@ -106,6 +106,24 @@ endif ...@@ -106,6 +106,24 @@ endif
AV1_COMMON_SRCS-yes += common/odintrin.c AV1_COMMON_SRCS-yes += common/odintrin.c
AV1_COMMON_SRCS-yes += common/odintrin.h AV1_COMMON_SRCS-yes += common/odintrin.h
ifeq ($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_COMMON_SRCS-yes += common/pvq.c
AV1_COMMON_SRCS-yes += common/pvq.h
AV1_COMMON_SRCS-yes += common/partition.c
AV1_COMMON_SRCS-yes += common/partition.h
AV1_COMMON_SRCS-yes += common/zigzag4.c
AV1_COMMON_SRCS-yes += common/zigzag8.c
AV1_COMMON_SRCS-yes += common/zigzag16.c
AV1_COMMON_SRCS-yes += common/zigzag32.c
AV1_COMMON_SRCS-yes += common/zigzag.h
AV1_COMMON_SRCS-yes += common/generic_code.c
AV1_COMMON_SRCS-yes += common/generic_code.h
AV1_COMMON_SRCS-yes += common/pvq_state.c
AV1_COMMON_SRCS-yes += common/pvq_state.h
AV1_COMMON_SRCS-yes += common/laplace_tables.c
endif
ifneq ($(CONFIG_AOM_HIGHBITDEPTH),yes) ifneq ($(CONFIG_AOM_HIGHBITDEPTH),yes)
AV1_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans4_dspr2.c AV1_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans4_dspr2.c
AV1_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans8_dspr2.c AV1_COMMON_SRCS-$(HAVE_DSPR2) += common/mips/dspr2/itrans8_dspr2.c
......
...@@ -112,6 +112,16 @@ AV1_CX_SRCS-$(HAVE_SSSE3) += encoder/clpf_rdo_ssse3.c ...@@ -112,6 +112,16 @@ AV1_CX_SRCS-$(HAVE_SSSE3) += encoder/clpf_rdo_ssse3.c
AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/clpf_rdo_sse4_1.c AV1_CX_SRCS-$(HAVE_SSE4_1) += encoder/clpf_rdo_sse4_1.c
AV1_CX_SRCS-$(HAVE_NEON) += encoder/clpf_rdo_neon.c AV1_CX_SRCS-$(HAVE_NEON) += encoder/clpf_rdo_neon.c
endif endif
ifeq ($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_CX_SRCS-yes += encoder/daala_compat_enc.c
AV1_CX_SRCS-yes += encoder/pvq_encoder.c
AV1_CX_SRCS-yes += encoder/pvq_encoder.h
AV1_CX_SRCS-yes += encoder/encint.h
AV1_CX_SRCS-yes += encoder/generic_encoder.c
AV1_CX_SRCS-yes += encoder/laplace_encoder.c
endif
AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/temporal_filter_apply_sse2.asm
AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/quantize_sse2.c AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/quantize_sse2.c
ifeq ($(CONFIG_AOM_HIGHBITDEPTH),yes) ifeq ($(CONFIG_AOM_HIGHBITDEPTH),yes)
......
...@@ -31,4 +31,29 @@ AV1_DX_SRCS-yes += decoder/decoder.h ...@@ -31,4 +31,29 @@ AV1_DX_SRCS-yes += decoder/decoder.h
AV1_DX_SRCS-yes += decoder/dsubexp.c AV1_DX_SRCS-yes += decoder/dsubexp.c
AV1_DX_SRCS-yes += decoder/dsubexp.h AV1_DX_SRCS-yes += decoder/dsubexp.h
ifeq ($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_DX_SRCS-yes += decoder/pvq_decoder.c
AV1_DX_SRCS-yes += decoder/pvq_decoder.h
AV1_DX_SRCS-yes += decoder/decint.h
AV1_DX_SRCS-yes += decoder/generic_decoder.c
AV1_DX_SRCS-yes += decoder/laplace_decoder.c
AV1_DX_SRCS-yes += encoder/hybrid_fwd_txfm.c
AV1_DX_SRCS-yes += encoder/hybrid_fwd_txfm.h
AV1_DX_SRCS-yes += encoder/dct.c
AV1_DX_SRCS-$(HAVE_SSE2) += encoder/x86/dct_sse2.asm
AV1_DX_SRCS-$(HAVE_SSE2) += encoder/x86/dct_intrin_sse2.c
AV1_DX_SRCS-$(HAVE_SSSE3) += encoder/x86/dct_ssse3.c
ifneq ($(CONFIG_AOM_HIGHBITDEPTH),yes)
AV1_DX_SRCS-$(HAVE_NEON) += encoder/arm/neon/dct_neon.c
endif
AV1_DX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct4x4_msa.c
AV1_DX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct8x8_msa.c
AV1_DX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct16x16_msa.c
AV1_DX_SRCS-$(HAVE_MSA) += encoder/mips/msa/fdct_msa.h
endif
AV1_DX_SRCS-yes := $(filter-out $(AV1_DX_SRCS_REMOVE-yes),$(AV1_DX_SRCS-yes)) AV1_DX_SRCS-yes := $(filter-out $(AV1_DX_SRCS_REMOVE-yes),$(AV1_DX_SRCS-yes))
...@@ -572,6 +572,196 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") { ...@@ -572,6 +572,196 @@ if (aom_config("CONFIG_EXT_INTER") eq "yes") {
} }
# end encoder functions # end encoder functions
# If PVQ is enabled, fwd transforms are required by decoder
if (aom_config("CONFIG_PVQ") eq "yes") {
# fdct functions
if (aom_config("CONFIG_AOM_HIGHBITDEPTH") eq "yes") {
add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht4x4 sse2/;
add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht8x8 sse2/;
add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht16x16 sse2/;
add_proto qw/void av1_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fwht4x4 sse2/;
if (aom_config("CONFIG_EMULATE_HARDWARE") eq "yes") {
add_proto qw/void av1_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4/;
add_proto qw/void av1_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4_1/;
add_proto qw/void av1_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8/;
add_proto qw/void av1_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8_1/;
add_proto qw/void av1_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16/;
add_proto qw/void av1_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16_1/;
add_proto qw/void av1_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32/;
add_proto qw/void av1_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_rd/;
add_proto qw/void av1_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_1/;
add_proto qw/void av1_highbd_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct4x4/;
add_proto qw/void av1_highbd_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct8x8/;
add_proto qw/void av1_highbd_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct8x8_1/;
add_proto qw/void av1_highbd_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct16x16/;
add_proto qw/void av1_highbd_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct16x16_1/;
add_proto qw/void av1_highbd_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32/;
add_proto qw/void av1_highbd_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32_rd/;
add_proto qw/void av1_highbd_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32_1/;
} else {
add_proto qw/void av1_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4 sse2/;
add_proto qw/void av1_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4_1 sse2/;
add_proto qw/void av1_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8 sse2/;
add_proto qw/void av1_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8_1 sse2/;
add_proto qw/void av1_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16 sse2/;
add_proto qw/void av1_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16_1 sse2/;
add_proto qw/void av1_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32 sse2/;
add_proto qw/void av1_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_rd sse2/;
add_proto qw/void av1_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_1 sse2/;
add_proto qw/void av1_highbd_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct4x4 sse2/;
add_proto qw/void av1_highbd_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct8x8 sse2/;
add_proto qw/void av1_highbd_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct8x8_1/;
add_proto qw/void av1_highbd_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct16x16 sse2/;
add_proto qw/void av1_highbd_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct16x16_1/;
add_proto qw/void av1_highbd_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32 sse2/;
add_proto qw/void av1_highbd_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32_rd sse2/;
add_proto qw/void av1_highbd_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_highbd_fdct32x32_1/;
}
} else {
add_proto qw/void av1_fht4x4/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht4x4 sse2 msa/;
add_proto qw/void av1_fht8x8/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht8x8 sse2 msa/;
add_proto qw/void av1_fht16x16/, "const int16_t *input, tran_low_t *output, int stride, int tx_type";
specialize qw/av1_fht16x16 sse2 msa/;
add_proto qw/void av1_fwht4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fwht4x4 msa sse2/;
if (aom_config("CONFIG_EMULATE_HARDWARE") eq "yes") {
add_proto qw/void av1_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4/;
add_proto qw/void av1_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4_1/;
add_proto qw/void av1_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8/;
add_proto qw/void av1_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8_1/;
add_proto qw/void av1_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16/;
add_proto qw/void av1_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16_1/;
add_proto qw/void av1_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32/;
add_proto qw/void av1_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_rd/;
add_proto qw/void av1_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_1/;
} else {
add_proto qw/void av1_fdct4x4/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4 sse2/;
add_proto qw/void av1_fdct4x4_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct4x4_1 sse2/;
add_proto qw/void av1_fdct8x8/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8 sse2/;
add_proto qw/void av1_fdct8x8_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct8x8_1 sse2/;
add_proto qw/void av1_fdct16x16/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16 sse2/;
add_proto qw/void av1_fdct16x16_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct16x16_1 sse2/;
add_proto qw/void av1_fdct32x32/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32 sse2/;
add_proto qw/void av1_fdct32x32_rd/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_rd sse2/;
add_proto qw/void av1_fdct32x32_1/, "const int16_t *input, tran_low_t *output, int stride";
specialize qw/av1_fdct32x32_1 sse2/;
}
}
}
# Deringing Functions # Deringing Functions
if (aom_config("CONFIG_DERING") eq "yes") { if (aom_config("CONFIG_DERING") eq "yes") {
......
...@@ -94,6 +94,7 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd, ...@@ -94,6 +94,7 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd,