Bug 918550 - Update libvpx to 1.3.0 r=glandium,cpearce

This updates our in-tree copy of libvpx to the
v1.3.0 git tag (2e88f2f2ec777259bda1714e72f1ecd2519bceb5)
libvpx 1.3.0 adds support for VP9. VP9 support is built
but not yet exposed with this commit.

Our update.sh script is replaced with update.py that can
update the build system to a given git commit.
 - checkout out upstream git
 - create platform dependend config files
 - add/remove changed libvpx files
 - update moz.build
 - warn about new build categories in libvpx
This commit is contained in:
Jan Gerber 2013-12-06 03:19:00 -08:00
parent 92c6207aa7
commit 8d3525293e
402 changed files with 101144 additions and 8871 deletions

View File

@ -5474,7 +5474,7 @@ if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
;;
*:x86)
if $CC -E -dM -</dev/null | grep -q __ELF__; then
VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
VPX_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC"
VPX_X86_ASM=1
fi
;;

View File

@ -22,9 +22,9 @@ CSRCS += cpu-features.c
endif
endif
ASM_OFFSETS = asm_com_offsets.asm
ASM_OFFSETS = vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
ASM_OFFSETS += asm_enc_offsets.asm
ASM_OFFSETS += vp8_asm_enc_offsets.asm
endif
@ -53,11 +53,11 @@ else
VPX_OIE_FORMAT := gas
endif
GARBAGE += asm_com_offsets.$(OBJ_SUFFIX) asm_com_offsets.asm
GARBAGE += vpx_scale_asm_offsets.$(OBJ_SUFFIX) vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
GARBAGE += asm_enc_offsets.$(OBJ_SUFFIX) asm_enc_offsets.asm
GARBAGE += vp8_asm_enc_offsets.$(OBJ_SUFFIX) vp8_asm_enc_offsets.asm
endif
else
@ -65,85 +65,87 @@ else
# We can extract the asm offsets directly from generated assembly using inline
# asm. This is the preferred method.
asm_com_offsets.s: CFLAGS += -DINLINE_ASM
vpx_scale_asm_offsets.s: CFLAGS += -DINLINE_ASM
OFFSET_PATTERN := '^[a-zA-Z0-9_]* EQU'
# This rule, as well as the rule for asm_enc_offsets.s further below are here
# This rule, as well as the rule for vp8_asm_enc_offsets.s further below are here
# because the generic rule in rules.mk was made to not be implicit, and we
# can't put the C files in CSRCS.
asm_com_offsets.s: $(srcdir)/vp8/common/asm_com_offsets.c
vpx_scale_asm_offsets.s: $(srcdir)/vpx_scale/vpx_scale_asm_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
asm_com_offsets.asm: asm_com_offsets.s
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.s
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
GARBAGE += asm_com_offsets.s asm_com_offsets.asm
GARBAGE += vpx_scale_asm_offsets.s vpx_scale_asm_offsets.asm
ifdef MOZ_VP8_ENCODER
asm_enc_offsets.s: CFLAGS += -DINLINE_ASM
vp8_asm_enc_offsets.s: CFLAGS += -DINLINE_ASM
asm_enc_offsets.s: $(srcdir)/vp8/encoder/asm_enc_offsets.c
vp8_asm_enc_offsets.s: $(srcdir)/vp8/encoder/vp8_asm_enc_offsets.c
$(REPORT_BUILD)
$(CC) -S $(COMPILE_CFLAGS) $(TARGET_LOCAL_INCLUDES) $(_VPATH_SRCS)
asm_enc_offsets.asm: asm_enc_offsets.s
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.s
grep $(OFFSET_PATTERN) $< | sed -e 's/[$$\#]//g' \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
GARBAGE += asm_enc_offsets.s asm_enc_offsets.asm
GARBAGE += vp8_asm_enc_offsets.s vp8_asm_enc_offsets.asm
endif
endif
EXTRA_MDDEPEND_FILES = asm_enc_offsets.s.pp asm_enc_offsets.$(OBJ_SUFFIX).pp asm_com_offsets.s.pp asm_com_offsets.$(OBJ_SUFFIX).pp
EXTRA_MDDEPEND_FILES = vp8_asm_enc_offsets.s.pp vp8_asm_enc_offsets.$(OBJ_SUFFIX).pp vpx_scale_asm_offsets.s.pp vpx_scale_asm_offsets.$(OBJ_SUFFIX).pp
include $(topsrcdir)/config/rules.mk
# This must be after rules.mk in order to use $(OBJ_SUFFIX) outside a
# recursively-expanded variable.
# dont add for MSVC
ifndef _MSC_VER
%_sse2.$(OBJ_SUFFIX): CFLAGS += -msse2
%_ssse3.$(OBJ_SUFFIX): CFLAGS += -mssse3
%_avx2.$(OBJ_SUFFIX): CFLAGS += -mavx2
endif
quantize_sse2.$(OBJ_SUFFIX): asm_enc_offsets.asm
quantize_sse4.$(OBJ_SUFFIX): asm_enc_offsets.asm
quantize_ssse3.$(OBJ_SUFFIX): asm_enc_offsets.asm
quantize_sse4.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
quantize_ssse3.$(OBJ_SUFFIX): vp8_asm_enc_offsets.asm
ifdef VPX_NEED_OBJ_INT_EXTRACT
# only for MSVC
ifdef _MSC_VER
NO_PROFILE_GUIDED_OPTIMIZE := asm_com_offsets.c
NO_PROFILE_GUIDED_OPTIMIZE := vpx_scale_asm_offsets.c
endif
asm_com_offsets.asm: asm_com_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
vpx_scale_asm_offsets.asm: vpx_scale_asm_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
# Filter out this object, because we don't want to link against it.
# It was generated solely so it could be parsed by obj_int_extract.
OBJS := $(filter-out asm_com_offsets.$(OBJ_SUFFIX),$(OBJS))
OBJS := $(filter-out vpx_scale_asm_offsets.$(OBJ_SUFFIX),$(OBJS))
ifdef MOZ_VP8_ENCODER
ifdef _MSC_VER
NO_PROFILE_GUIDED_OPTIMIZE += asm_enc_offsets.c
NO_PROFILE_GUIDED_OPTIMIZE += vp8_asm_enc_offsets.c
endif
asm_enc_offsets.asm: asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
vp8_asm_enc_offsets.asm: vp8_asm_enc_offsets.$(OBJ_SUFFIX) $(HOST_PROGRAM)
./$(HOST_PROGRAM) $(VPX_OIE_FORMAT) $< \
$(if $(VPX_AS_CONVERSION),| $(VPX_AS_CONVERSION)) > $@
# Filter out this object, because we don't want to link against it.
# It was generated solely so it could be parsed by obj_int_extract.
OBJS := $(filter-out asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
OBJS := $(filter-out vp8_asm_enc_offsets.$(OBJ_SUFFIX),$(OBJS))
endif
endif

View File

@ -1,2 +1,11 @@
Using the v1.2.0 release pulled from
http://webm.googlecode.com/files/libvpx-v1.2.0.zip
The source from this directory was copied from the libvpx
git repository using the update.py script. The only changes
made were those applied by update.py and the addition of
moz.build and Makefile.in build files for the
Mozilla build system.
The libvpx git repository is:
https://gerrit.chromium.org/gerrit/webm/libvpx
The git commit ID used was 2e88f2f2ec777259bda1714e72f1ecd2519bceb5

View File

@ -17,9 +17,24 @@
#
# Usage: cat inputfile | perl ads2gas.pl > outputfile
#
use FindBin;
use lib $FindBin::Bin;
use thumb;
my $thumb = 0;
foreach my $arg (@ARGV) {
$thumb = 1 if ($arg eq "-thumb");
}
print "@ This file was created from a .asm file\n";
print "@ using the ads2gas.pl script.\n";
print "\t.equ DO1STROUNDING, 0\n";
if ($thumb) {
print "\t.syntax unified\n";
print "\t.thumb\n";
}
# Stack of procedure names.
@proc_stack = ();
@ -151,8 +166,13 @@ while (<STDIN>)
# ALIGN directive
s/\bALIGN\b/.balign/g;
# ARM code
s/\sARM/.arm/g;
if ($thumb) {
# ARM code - we force everything to thumb with the declaration in the header
s/\sARM//g;
} else {
# ARM code
s/\sARM/.arm/g;
}
# push/pop
s/(push\s+)(r\d+)/stmdb sp\!, \{$2\}/g;
@ -162,6 +182,10 @@ while (<STDIN>)
s/(vld1.\d+\s+)(q\d+)/$1\{$2\}/g;
s/(vtbl.\d+\s+[^,]+),([^,]+)/$1,\{$2\}/g;
if ($thumb) {
thumb::FixThumbInstructions($_, 0);
}
# eabi_attributes numerical equivalents can be found in the
# "ARM IHI 0045C" document.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,70 @@
#!/usr/bin/perl
##
## Copyright (c) 2013 The WebM project authors. All Rights Reserved.
##
## Use of this source code is governed by a BSD-style license
## that can be found in the LICENSE file in the root of the source
## tree. An additional intellectual property rights grant can be found
## in the file PATENTS. All contributing project authors may
## be found in the AUTHORS file in the root of the source tree.
##
package thumb;
sub FixThumbInstructions($$)
{
my $short_branches = $_[1];
my $branch_shift_offset = $short_branches ? 1 : 0;
# Write additions with shifts, such as "add r10, r11, lsl #8",
# in three operand form, "add r10, r10, r11, lsl #8".
s/(add\s+)(r\d+),\s*(r\d+),\s*(lsl #\d+)/$1$2, $2, $3, $4/g;
# Convert additions with a non-constant shift into a sequence
# with left shift, addition and a right shift (to restore the
# register to the original value). Currently the right shift
# isn't necessary in the code base since the values in these
# registers aren't used, but doing the shift for consitency.
# This converts instructions such as "add r12, r12, r5, lsl r4"
# into the sequence "lsl r5, r4", "add r12, r12, r5", "lsr r5, r4".
s/^(\s*)(add)(\s+)(r\d+),\s*(r\d+),\s*(r\d+),\s*lsl (r\d+)/$1lsl$3$6, $7\n$1$2$3$4, $5, $6\n$1lsr$3$6, $7/g;
# Convert loads with right shifts in the indexing into a
# sequence of an add, load and sub. This converts
# "ldrb r4, [r9, lr, asr #1]" into "add r9, r9, lr, asr #1",
# "ldrb r9, [r9]", "sub r9, r9, lr, asr #1".
s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+),\s*(asr #\d+)\]/$1add $3$5, $5, $6, $7\n$1$2$3$4, [$5]\n$1sub $3$5, $5, $6, $7/g;
# Convert register indexing with writeback into a separate add
# instruction. This converts "ldrb r12, [r1, r2]!" into
# "ldrb r12, [r1, r2]", "add r1, r1, r2".
s/^(\s*)(ldrb)(\s+)(r\d+),\s*\[(\w+),\s*(\w+)\]!/$1$2$3$4, [$5, $6]\n$1add $3$5, $6/g;
# Convert negative register indexing into separate sub/add instructions.
# This converts "ldrne r4, [src, -pstep, lsl #1]" into
# "subne src, src, pstep, lsl #1", "ldrne r4, [src]",
# "addne src, src, pstep, lsl #1". In a couple of cases where
# this is used, it's used for two subsequent load instructions,
# where a hand-written version of it could merge two subsequent
# add and sub instructions.
s/^(\s*)((ldr|str|pld)(ne)?)(\s+)(r\d+,\s*)?\[(\w+), -([^\]]+)\]/$1sub$4$5$7, $7, $8\n$1$2$5$6\[$7\]\n$1add$4$5$7, $7, $8/g;
# Convert register post indexing to a separate add instruction.
# This converts "ldrneb r9, [r0], r2" into "ldrneb r9, [r0]",
# "add r0, r2".
s/^(\s*)((ldr|str)(ne)?[bhd]?)(\s+)(\w+),(\s*\w+,)?\s*\[(\w+)\],\s*(\w+)/$1$2$5$6,$7 [$8]\n$1add$4$5$8, $8, $9/g;
# Convert a conditional addition to the pc register into a series of
# instructions. This converts "addlt pc, pc, r3, lsl #2" into
# "itttt lt", "movlt.n r12, pc", "addlt.w r12, #12",
# "addlt.w r12, r12, r3, lsl #2", "movlt.n pc, r12".
# This assumes that r12 is free at this point.
s/^(\s*)addlt(\s+)pc,\s*pc,\s*(\w+),\s*lsl\s*#(\d+)/$1itttt$2lt\n$1movlt.n$2r12, pc\n$1addlt.w$2r12, #12\n$1addlt.w$2r12, r12, $3, lsl #($4-$branch_shift_offset)\n$1movlt.n$2pc, r12/g;
# Convert "mov pc, lr" into "bx lr", since the former only works
# for switching from arm to thumb (and only in armv7), but not
# from thumb to arm.
s/mov(\s*)pc\s*,\s*lr/bx$1lr/g;
}
1;

View File

@ -4,27 +4,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
EXPORTS.vpx += [
'vpx/vp8.h',
'vpx/vp8cx.h',
'vpx/vp8dx.h',
'vpx/vpx_codec.h',
'vpx/vpx_codec_impl_bottom.h',
'vpx/vpx_codec_impl_top.h',
'vpx/vpx_decoder.h',
'vpx/vpx_encoder.h',
'vpx/vpx_image.h',
'vpx/vpx_integer.h',
'vpx_mem/include/vpx_mem_intrnl.h',
'vpx_mem/vpx_mem.h',
'vpx_ports/arm.h',
'vpx_ports/mem.h',
'vpx_ports/vpx_timer.h',
'vpx_ports/x86.h',
'vpx_scale/scale_mode.h',
'vpx_scale/vpxscale.h',
'vpx_scale/yv12config.h',
]
include('sources.mozbuild')
EXPORTS.vpx += files['EXPORTS']
if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
HOST_SOURCES += [
@ -33,278 +15,56 @@ if CONFIG['VPX_NEED_OBJ_INT_EXTRACT']:
HOST_PROGRAM = 'host_obj_int_extract'
SOURCES += [
'vp8/common/alloccommon.c',
'vp8/common/blockd.c',
'vp8/common/debugmodes.c',
'vp8/common/dequantize.c',
'vp8/common/entropy.c',
'vp8/common/entropymode.c',
'vp8/common/entropymv.c',
'vp8/common/extend.c',
'vp8/common/filter.c',
'vp8/common/findnearmv.c',
'vp8/common/generic/systemdependent.c',
'vp8/common/idct_blk.c',
'vp8/common/idctllm.c',
'vp8/common/loopfilter.c',
'vp8/common/loopfilter_filters.c',
'vp8/common/mbpitch.c',
'vp8/common/modecont.c',
'vp8/common/quant_common.c',
'vp8/common/reconinter.c',
'vp8/common/reconintra.c',
'vp8/common/reconintra4x4.c',
'vp8/common/rtcd.c',
'vp8/common/sad_c.c',
'vp8/common/setupintrarecon.c',
'vp8/common/swapyv12buffer.c',
'vp8/common/treecoder.c',
'vp8/common/variance_c.c',
'vp8/decoder/asm_dec_offsets.c',
'vp8/decoder/dboolhuff.c',
'vp8/decoder/decodemv.c',
'vp8/decoder/decodframe.c',
'vp8/decoder/detokenize.c',
'vp8/decoder/onyxd_if.c',
'vp8/decoder/threading.c',
'vp8/vp8_dx_iface.c',
'vpx/src/vpx_codec.c',
'vpx/src/vpx_decoder.c',
'vpx/src/vpx_encoder.c',
'vpx/src/vpx_image.c',
'vpx_mem/vpx_mem.c',
'vpx_scale/generic/gen_scalers.c',
'vpx_scale/generic/vpxscale.c',
'vpx_scale/generic/yv12config.c',
'vpx_scale/generic/yv12extend.c',
]
SOURCES += files['COMMON']
if CONFIG['MOZ_VP8_ERROR_CONCEALMENT']:
SOURCES += [
'vp8/decoder/error_concealment.c'
]
SOURCES += files['ERROR_CONCEALMENT']
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/bitstream.c',
'vp8/encoder/dct.c',
'vp8/encoder/encodeframe.c',
'vp8/encoder/encodeintra.c',
'vp8/encoder/encodemb.c',
'vp8/encoder/encodemv.c',
'vp8/encoder/ethreading.c',
'vp8/encoder/firstpass.c',
'vp8/encoder/lookahead.c',
'vp8/encoder/mcomp.c',
'vp8/encoder/modecosts.c',
'vp8/encoder/mr_dissim.c',
'vp8/encoder/onyx_if.c',
'vp8/encoder/pickinter.c',
'vp8/encoder/picklpf.c',
'vp8/encoder/psnr.c',
'vp8/encoder/quantize.c',
'vp8/encoder/ratectrl.c',
'vp8/encoder/rdopt.c',
'vp8/encoder/segmentation.c',
'vp8/encoder/tokenize.c',
'vp8/encoder/treewriter.c',
'vp8/vp8_cx_iface.c',
]
SOURCES += files['ENCODER']
#postproc is only enabled on x86 with asm
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/common/mfqe.c',
'vp8/common/postproc.c',
'vp8/encoder/temporal_filter.c',
]
SOURCES += files['VP8_POSTPROC']
if CONFIG['VPX_X86_ASM'] and CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [
'vp8/common/asm_com_offsets.c',
'vpx_scale/vpx_scale_asm_offsets.c',
]
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/asm_enc_offsets.c',
'vp8/encoder/vp8_asm_enc_offsets.c',
]
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/common/x86/filter_x86.c',
'vp8/common/x86/idct_blk_mmx.c',
'vp8/common/x86/idct_blk_sse2.c',
'vp8/common/x86/loopfilter_x86.c',
'vp8/common/x86/postproc_x86.c',
'vp8/common/x86/recon_wrapper_sse2.c',
'vp8/common/x86/variance_mmx.c',
'vp8/common/x86/variance_sse2.c',
'vp8/common/x86/variance_ssse3.c',
'vp8/common/x86/vp8_asm_stubs.c',
'vpx_ports/x86_cpuid.c',
]
SOURCES += [
'vp8/common/x86/dequantize_mmx.asm',
'vp8/common/x86/idctllm_mmx.asm',
'vp8/common/x86/idctllm_sse2.asm',
'vp8/common/x86/iwalsh_mmx.asm',
'vp8/common/x86/iwalsh_sse2.asm',
'vp8/common/x86/loopfilter_mmx.asm',
'vp8/common/x86/loopfilter_sse2.asm',
'vp8/common/x86/mfqe_sse2.asm',
'vp8/common/x86/postproc_mmx.asm',
'vp8/common/x86/postproc_sse2.asm',
'vp8/common/x86/recon_mmx.asm',
'vp8/common/x86/recon_sse2.asm',
'vp8/common/x86/sad_mmx.asm',
'vp8/common/x86/sad_sse2.asm',
'vp8/common/x86/sad_sse3.asm',
'vp8/common/x86/sad_sse4.asm',
'vp8/common/x86/sad_ssse3.asm',
'vp8/common/x86/subpixel_mmx.asm',
'vp8/common/x86/subpixel_sse2.asm',
'vp8/common/x86/subpixel_ssse3.asm',
'vp8/common/x86/variance_impl_mmx.asm',
'vp8/common/x86/variance_impl_sse2.asm',
'vp8/common/x86/variance_impl_ssse3.asm',
'vpx_ports/emms.asm',
]
SOURCES += files['X86_ASM']
if '64' in CONFIG['OS_TEST']:
SOURCES += [
'vp8/common/x86/loopfilter_block_sse2.asm',
]
SOURCES += files['X86-64_ASM']
# AVX2 only supported on
# Darwin toolchain right now
if CONFIG['OS_TARGET'] == 'Darwin':
SOURCES += files['AVX2']
if CONFIG['VPX_X86_ASM'] and CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/x86/vp8_enc_stubs_mmx.c',
'vp8/encoder/x86/vp8_enc_stubs_sse2.c',
]
SOURCES += [
'vp8/encoder/x86/dct_mmx.asm',
'vp8/encoder/x86/dct_sse2.asm',
'vp8/encoder/x86/encodeopt.asm',
'vp8/encoder/x86/fwalsh_sse2.asm',
'vp8/encoder/x86/quantize_mmx.asm',
'vp8/encoder/x86/quantize_sse2.asm',
'vp8/encoder/x86/quantize_sse4.asm',
'vp8/encoder/x86/quantize_ssse3.asm',
'vp8/encoder/x86/subtract_mmx.asm',
'vp8/encoder/x86/subtract_sse2.asm',
'vp8/encoder/x86/temporal_filter_apply_sse2.asm',
]
if CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/denoising.c',
]
if CONFIG['VPX_X86_ASM']:
SOURCES += [
'vp8/encoder/x86/denoising_sse2.c',
]
SOURCES += files['X86_ASM_ENCODER']
if '64' in CONFIG['OS_TEST']:
SOURCES += files['X86-64_ASM_ENCODER']
arm_asm_files = []
if CONFIG['VPX_ARM_ASM']:
SOURCES += [
'vp8/common/arm/armv6/idct_blk_v6.c',
'vp8/common/arm/bilinearfilter_arm.c',
'vp8/common/arm/dequantize_arm.c',
'vp8/common/arm/filter_arm.c',
'vp8/common/arm/loopfilter_arm.c',
'vp8/common/arm/neon/idct_blk_neon.c',
'vp8/common/arm/reconintra_arm.c',
'vp8/common/arm/variance_arm.c',
'vpx_ports/arm_cpudetect.c',
'vpx_scale/arm/neon/yv12extend_arm.c',
]
arm_asm_files += [
'vp8/common/arm/armv6/bilinearfilter_v6.asm',
'vp8/common/arm/armv6/copymem16x16_v6.asm',
'vp8/common/arm/armv6/copymem8x4_v6.asm',
'vp8/common/arm/armv6/copymem8x8_v6.asm',
'vp8/common/arm/armv6/dc_only_idct_add_v6.asm',
'vp8/common/arm/armv6/dequant_idct_v6.asm',
'vp8/common/arm/armv6/dequantize_v6.asm',
'vp8/common/arm/armv6/filter_v6.asm',
'vp8/common/arm/armv6/idct_v6.asm',
'vp8/common/arm/armv6/intra4x4_predict_v6.asm',
'vp8/common/arm/armv6/iwalsh_v6.asm',
'vp8/common/arm/armv6/loopfilter_v6.asm',
'vp8/common/arm/armv6/simpleloopfilter_v6.asm',
'vp8/common/arm/armv6/sixtappredict8x4_v6.asm',
'vp8/common/arm/armv6/vp8_sad16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance8x8_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm',
'vp8/common/arm/neon/bilinearpredict16x16_neon.asm',
'vp8/common/arm/neon/bilinearpredict4x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x8_neon.asm',
'vp8/common/arm/neon/buildintrapredictorsmby_neon.asm',
'vp8/common/arm/neon/copymem16x16_neon.asm',
'vp8/common/arm/neon/copymem8x4_neon.asm',
'vp8/common/arm/neon/copymem8x8_neon.asm',
'vp8/common/arm/neon/dc_only_idct_add_neon.asm',
'vp8/common/arm/neon/dequant_idct_neon.asm',
'vp8/common/arm/neon/dequantizeb_neon.asm',
'vp8/common/arm/neon/idct_dequant_0_2x_neon.asm',
'vp8/common/arm/neon/idct_dequant_full_2x_neon.asm',
'vp8/common/arm/neon/iwalsh_neon.asm',
'vp8/common/arm/neon/loopfilter_neon.asm',
'vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm',
'vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm',
'vp8/common/arm/neon/mbloopfilter_neon.asm',
'vp8/common/arm/neon/sad16_neon.asm',
'vp8/common/arm/neon/sad8_neon.asm',
'vp8/common/arm/neon/save_reg_neon.asm',
'vp8/common/arm/neon/shortidct4x4llm_neon.asm',
'vp8/common/arm/neon/sixtappredict16x16_neon.asm',
'vp8/common/arm/neon/sixtappredict4x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x8_neon.asm',
'vp8/common/arm/neon/variance_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm',
'vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm',
'vp8/encoder/arm/neon/vp8_mse16x16_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.asm',
]
arm_asm_files += files['ARM_ASM']
if CONFIG['MOZ_VP8_ENCODER']:
arm_asm_files += files['ARM_ASM_ENCODER']
if CONFIG['VPX_ARM_ASM'] and CONFIG['MOZ_VP8_ENCODER']:
SOURCES += [
'vp8/encoder/arm/boolhuff_arm.c',
'vp8/encoder/arm/dct_arm.c',
'vp8/encoder/arm/neon/picklpf_arm.c',
'vp8/encoder/arm/quantize_arm.c',
]
arm_asm_files += [
'vp8/encoder/arm/armv5te/boolhuff_armv5te.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm',
'vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm',
'vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm',
'vp8/encoder/arm/armv6/vp8_subtract_armv6.asm',
'vp8/encoder/arm/armv6/walsh_v6.asm',
'vp8/encoder/arm/neon/fastquantizeb_neon.asm',
'vp8/encoder/arm/neon/shortfdct_neon.asm',
'vp8/encoder/arm/neon/subtract_neon.asm',
'vp8/encoder/arm/neon/vp8_memcpy_neon.asm',
'vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm',
]
if arm_asm_files:
if CONFIG['VPX_AS_CONVERSION']:
GENERATED_SOURCES += [ "%s.%s" % (f, CONFIG['VPX_ASM_SUFFIX'])
for f in sorted(arm_asm_files)]
for f in sorted(arm_asm_files) if f.endswith('.asm')
]
SOURCES += [
f for f in sorted(arm_asm_files) if not f.endswith('.asm')
]
else:
SOURCES += sorted(arm_asm_files)

View File

@ -0,0 +1,333 @@
files = {
'ARM_ASM': ['vp8/common/arm/armv6/bilinearfilter_v6.asm',
'vp8/common/arm/armv6/copymem16x16_v6.asm',
'vp8/common/arm/armv6/copymem8x4_v6.asm',
'vp8/common/arm/armv6/copymem8x8_v6.asm',
'vp8/common/arm/armv6/dc_only_idct_add_v6.asm',
'vp8/common/arm/armv6/dequant_idct_v6.asm',
'vp8/common/arm/armv6/dequantize_v6.asm',
'vp8/common/arm/armv6/filter_v6.asm',
'vp8/common/arm/armv6/idct_blk_v6.c',
'vp8/common/arm/armv6/idct_v6.asm',
'vp8/common/arm/armv6/intra4x4_predict_v6.asm',
'vp8/common/arm/armv6/iwalsh_v6.asm',
'vp8/common/arm/armv6/loopfilter_v6.asm',
'vp8/common/arm/armv6/simpleloopfilter_v6.asm',
'vp8/common/arm/armv6/sixtappredict8x4_v6.asm',
'vp8/common/arm/armv6/vp8_sad16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance16x16_armv6.asm',
'vp8/common/arm/armv6/vp8_variance8x8_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm',
'vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm',
'vp8/common/arm/bilinearfilter_arm.c',
'vp8/common/arm/dequantize_arm.c',
'vp8/common/arm/filter_arm.c',
'vp8/common/arm/loopfilter_arm.c',
'vp8/common/arm/neon/bilinearpredict16x16_neon.asm',
'vp8/common/arm/neon/bilinearpredict4x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x4_neon.asm',
'vp8/common/arm/neon/bilinearpredict8x8_neon.asm',
'vp8/common/arm/neon/buildintrapredictorsmby_neon.asm',
'vp8/common/arm/neon/copymem16x16_neon.asm',
'vp8/common/arm/neon/copymem8x4_neon.asm',
'vp8/common/arm/neon/copymem8x8_neon.asm',
'vp8/common/arm/neon/dc_only_idct_add_neon.asm',
'vp8/common/arm/neon/dequant_idct_neon.asm',
'vp8/common/arm/neon/dequantizeb_neon.asm',
'vp8/common/arm/neon/idct_blk_neon.c',
'vp8/common/arm/neon/idct_dequant_0_2x_neon.asm',
'vp8/common/arm/neon/idct_dequant_full_2x_neon.asm',
'vp8/common/arm/neon/iwalsh_neon.asm',
'vp8/common/arm/neon/loopfilter_neon.asm',
'vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm',
'vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm',
'vp8/common/arm/neon/mbloopfilter_neon.asm',
'vp8/common/arm/neon/sad16_neon.asm',
'vp8/common/arm/neon/sad8_neon.asm',
'vp8/common/arm/neon/save_reg_neon.asm',
'vp8/common/arm/neon/shortidct4x4llm_neon.asm',
'vp8/common/arm/neon/sixtappredict16x16_neon.asm',
'vp8/common/arm/neon/sixtappredict4x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x4_neon.asm',
'vp8/common/arm/neon/sixtappredict8x8_neon.asm',
'vp8/common/arm/neon/variance_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon.asm',
'vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm',
'vp8/common/arm/reconintra_arm.c',
'vp8/common/arm/variance_arm.c',
'vp9/common/arm/neon/vp9_avg_neon.asm',
'vp9/common/arm/neon/vp9_convolve8_avg_neon.asm',
'vp9/common/arm/neon/vp9_convolve8_neon.asm',
'vp9/common/arm/neon/vp9_convolve_neon.c',
'vp9/common/arm/neon/vp9_copy_neon.asm',
'vp9/common/arm/neon/vp9_dc_only_idct_add_neon.asm',
'vp9/common/arm/neon/vp9_idct16x16_neon.c',
'vp9/common/arm/neon/vp9_loopfilter_neon.asm',
'vp9/common/arm/neon/vp9_mb_lpf_neon.asm',
'vp9/common/arm/neon/vp9_save_reg_neon.asm',
'vp9/common/arm/neon/vp9_short_idct16x16_1_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct16x16_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct32x32_1_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct32x32_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct4x4_1_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct4x4_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct8x8_1_add_neon.asm',
'vp9/common/arm/neon/vp9_short_idct8x8_add_neon.asm',
'vp9/common/arm/neon/vp9_short_iht4x4_add_neon.asm',
'vp9/common/arm/neon/vp9_short_iht8x8_add_neon.asm',
'vpx_ports/arm_cpudetect.c',
'vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm',
'vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.asm',
'vpx_scale/arm/neon/yv12extend_arm.c'],
'ARM_ASM_ENCODER': ['vp8/encoder/arm/armv5te/boolhuff_armv5te.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm',
'vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm',
'vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm',
'vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm',
'vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm',
'vp8/encoder/arm/armv6/vp8_subtract_armv6.asm',
'vp8/encoder/arm/armv6/walsh_v6.asm',
'vp8/encoder/arm/boolhuff_arm.c',
'vp8/encoder/arm/dct_arm.c',
'vp8/encoder/arm/neon/fastquantizeb_neon.asm',
'vp8/encoder/arm/neon/picklpf_arm.c',
'vp8/encoder/arm/neon/shortfdct_neon.asm',
'vp8/encoder/arm/neon/subtract_neon.asm',
'vp8/encoder/arm/neon/vp8_memcpy_neon.asm',
'vp8/encoder/arm/neon/vp8_mse16x16_neon.asm',
'vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm',
'vp8/encoder/arm/quantize_arm.c'],
'AVX2': ['vp9/common/x86/vp9_loopfilter_intrin_avx2.c'],
'COMMON': ['vp8/common/alloccommon.c',
'vp8/common/blockd.c',
'vp8/common/debugmodes.c',
'vp8/common/dequantize.c',
'vp8/common/entropy.c',
'vp8/common/entropymode.c',
'vp8/common/entropymv.c',
'vp8/common/extend.c',
'vp8/common/filter.c',
'vp8/common/findnearmv.c',
'vp8/common/generic/systemdependent.c',
'vp8/common/idct_blk.c',
'vp8/common/idctllm.c',
'vp8/common/loopfilter.c',
'vp8/common/loopfilter_filters.c',
'vp8/common/mbpitch.c',
'vp8/common/modecont.c',
'vp8/common/quant_common.c',
'vp8/common/reconinter.c',
'vp8/common/reconintra.c',
'vp8/common/reconintra4x4.c',
'vp8/common/rtcd.c',
'vp8/common/sad_c.c',
'vp8/common/setupintrarecon.c',
'vp8/common/swapyv12buffer.c',
'vp8/common/treecoder.c',
'vp8/common/variance_c.c',
'vp8/decoder/dboolhuff.c',
'vp8/decoder/decodemv.c',
'vp8/decoder/decodframe.c',
'vp8/decoder/detokenize.c',
'vp8/decoder/onyxd_if.c',
'vp8/decoder/threading.c',
'vp8/vp8_dx_iface.c',
'vp9/common/generic/vp9_systemdependent.c',
'vp9/common/vp9_alloccommon.c',
'vp9/common/vp9_common_data.c',
'vp9/common/vp9_convolve.c',
'vp9/common/vp9_debugmodes.c',
'vp9/common/vp9_entropy.c',
'vp9/common/vp9_entropymode.c',
'vp9/common/vp9_entropymv.c',
'vp9/common/vp9_extend.c',
'vp9/common/vp9_filter.c',
'vp9/common/vp9_findnearmv.c',
'vp9/common/vp9_idct.c',
'vp9/common/vp9_loopfilter.c',
'vp9/common/vp9_loopfilter_filters.c',
'vp9/common/vp9_mvref_common.c',
'vp9/common/vp9_pred_common.c',
'vp9/common/vp9_quant_common.c',
'vp9/common/vp9_reconinter.c',
'vp9/common/vp9_reconintra.c',
'vp9/common/vp9_rtcd.c',
'vp9/common/vp9_scale.c',
'vp9/common/vp9_scan.c',
'vp9/common/vp9_seg_common.c',
'vp9/common/vp9_tile_common.c',
'vp9/common/vp9_treecoder.c',
'vp9/decoder/vp9_dboolhuff.c',
'vp9/decoder/vp9_decodemv.c',
'vp9/decoder/vp9_decodframe.c',
'vp9/decoder/vp9_detokenize.c',
'vp9/decoder/vp9_dsubexp.c',
'vp9/decoder/vp9_onyxd_if.c',
'vp9/decoder/vp9_thread.c',
'vp9/vp9_dx_iface.c',
'vpx/src/vpx_codec.c',
'vpx/src/vpx_decoder.c',
'vpx/src/vpx_encoder.c',
'vpx/src/vpx_image.c',
'vpx_mem/vpx_mem.c',
'vpx_scale/generic/gen_scalers.c',
'vpx_scale/generic/vpx_scale.c',
'vpx_scale/generic/yv12config.c',
'vpx_scale/generic/yv12extend.c',
'vpx_scale/vpx_scale_rtcd.c'],
'ENCODER': ['vp8/encoder/bitstream.c',
'vp8/encoder/dct.c',
'vp8/encoder/denoising.c',
'vp8/encoder/encodeframe.c',
'vp8/encoder/encodeintra.c',
'vp8/encoder/encodemb.c',
'vp8/encoder/encodemv.c',
'vp8/encoder/ethreading.c',
'vp8/encoder/firstpass.c',
'vp8/encoder/lookahead.c',
'vp8/encoder/mcomp.c',
'vp8/encoder/modecosts.c',
'vp8/encoder/mr_dissim.c',
'vp8/encoder/onyx_if.c',
'vp8/encoder/pickinter.c',
'vp8/encoder/picklpf.c',
'vp8/encoder/psnr.c',
'vp8/encoder/quantize.c',
'vp8/encoder/ratectrl.c',
'vp8/encoder/rdopt.c',
'vp8/encoder/segmentation.c',
'vp8/encoder/temporal_filter.c',
'vp8/encoder/tokenize.c',
'vp8/encoder/treewriter.c',
'vp8/vp8_cx_iface.c',
'vp9/encoder/vp9_bitstream.c',
'vp9/encoder/vp9_boolhuff.c',
'vp9/encoder/vp9_dct.c',
'vp9/encoder/vp9_encodeframe.c',
'vp9/encoder/vp9_encodeintra.c',
'vp9/encoder/vp9_encodemb.c',
'vp9/encoder/vp9_encodemv.c',
'vp9/encoder/vp9_firstpass.c',
'vp9/encoder/vp9_lookahead.c',
'vp9/encoder/vp9_mbgraph.c',
'vp9/encoder/vp9_mcomp.c',
'vp9/encoder/vp9_modecosts.c',
'vp9/encoder/vp9_onyx_if.c',
'vp9/encoder/vp9_picklpf.c',
'vp9/encoder/vp9_psnr.c',
'vp9/encoder/vp9_quantize.c',
'vp9/encoder/vp9_ratectrl.c',
'vp9/encoder/vp9_rdopt.c',
'vp9/encoder/vp9_sad_c.c',
'vp9/encoder/vp9_segmentation.c',
'vp9/encoder/vp9_subexp.c',
'vp9/encoder/vp9_temporal_filter.c',
'vp9/encoder/vp9_tokenize.c',
'vp9/encoder/vp9_treewriter.c',
'vp9/encoder/vp9_vaq.c',
'vp9/encoder/vp9_variance_c.c',
'vp9/vp9_cx_iface.c',
'vpx/src/svc_encodeframe.c'],
'ERROR_CONCEALMENT': ['vp8/decoder/error_concealment.c'],
'EXPORTS': ['vpx/vp8.h',
'vpx/vp8cx.h',
'vpx/vp8dx.h',
'vpx/vpx_codec.h',
'vpx/vpx_decoder.h',
'vpx/vpx_encoder.h',
'vpx/vpx_image.h',
'vpx/vpx_integer.h',
'vpx_mem/include/vpx_mem_intrnl.h',
'vpx_mem/vpx_mem.h',
'vpx_ports/arm.h',
'vpx_ports/mem.h',
'vpx_ports/vpx_timer.h',
'vpx_ports/x86.h',
'vpx_scale/vpx_scale.h',
'vpx_scale/yv12config.h'],
'VP8_POSTPROC': ['vp8/common/mfqe.c', 'vp8/common/postproc.c'],
'VP9_POSTPROC': ['vp9/common/vp9_postproc.c'],
'X86-64_ASM': ['third_party/x86inc/x86inc.asm',
'vp8/common/x86/loopfilter_block_sse2.asm'],
'X86-64_ASM_ENCODER': ['vp9/encoder/x86/vp9_quantize_ssse3.asm'],
'X86_ASM': ['vp8/common/x86/dequantize_mmx.asm',
'vp8/common/x86/filter_x86.c',
'vp8/common/x86/idct_blk_mmx.c',
'vp8/common/x86/idct_blk_sse2.c',
'vp8/common/x86/idctllm_mmx.asm',
'vp8/common/x86/idctllm_sse2.asm',
'vp8/common/x86/iwalsh_mmx.asm',
'vp8/common/x86/iwalsh_sse2.asm',
'vp8/common/x86/loopfilter_mmx.asm',
'vp8/common/x86/loopfilter_sse2.asm',
'vp8/common/x86/loopfilter_x86.c',
'vp8/common/x86/mfqe_sse2.asm',
'vp8/common/x86/postproc_mmx.asm',
'vp8/common/x86/postproc_sse2.asm',
'vp8/common/x86/postproc_x86.c',
'vp8/common/x86/recon_mmx.asm',
'vp8/common/x86/recon_sse2.asm',
'vp8/common/x86/recon_wrapper_sse2.c',
'vp8/common/x86/sad_mmx.asm',
'vp8/common/x86/sad_sse2.asm',
'vp8/common/x86/sad_sse3.asm',
'vp8/common/x86/sad_sse4.asm',
'vp8/common/x86/sad_ssse3.asm',
'vp8/common/x86/subpixel_mmx.asm',
'vp8/common/x86/subpixel_sse2.asm',
'vp8/common/x86/subpixel_ssse3.asm',
'vp8/common/x86/variance_impl_mmx.asm',
'vp8/common/x86/variance_impl_sse2.asm',
'vp8/common/x86/variance_impl_ssse3.asm',
'vp8/common/x86/variance_mmx.c',
'vp8/common/x86/variance_sse2.c',
'vp8/common/x86/variance_ssse3.c',
'vp8/common/x86/vp8_asm_stubs.c',
'vp9/common/x86/vp9_asm_stubs.c',
'vp9/common/x86/vp9_copy_sse2.asm',
'vp9/common/x86/vp9_idct_intrin_sse2.c',
'vp9/common/x86/vp9_intrapred_sse2.asm',
'vp9/common/x86/vp9_intrapred_ssse3.asm',
'vp9/common/x86/vp9_loopfilter_intrin_sse2.c',
'vp9/common/x86/vp9_loopfilter_mmx.asm',
'vp9/common/x86/vp9_subpixel_8t_sse2.asm',
'vp9/common/x86/vp9_subpixel_8t_ssse3.asm',
'vpx_ports/emms.asm',
'vpx_ports/x86_cpuid.c'],
'X86_ASM_ENCODER': ['vp8/encoder/x86/dct_mmx.asm',
'vp8/encoder/x86/dct_sse2.asm',
'vp8/encoder/x86/denoising_sse2.c',
'vp8/encoder/x86/encodeopt.asm',
'vp8/encoder/x86/fwalsh_sse2.asm',
'vp8/encoder/x86/quantize_mmx.asm',
'vp8/encoder/x86/quantize_sse2.c',
'vp8/encoder/x86/quantize_sse4.asm',
'vp8/encoder/x86/quantize_ssse3.asm',
'vp8/encoder/x86/subtract_mmx.asm',
'vp8/encoder/x86/subtract_sse2.asm',
'vp8/encoder/x86/temporal_filter_apply_sse2.asm',
'vp8/encoder/x86/vp8_enc_stubs_mmx.c',
'vp8/encoder/x86/vp8_enc_stubs_sse2.c',
'vp9/encoder/x86/vp9_dct32x32_sse2.c',
'vp9/encoder/x86/vp9_dct_sse2.c',
'vp9/encoder/x86/vp9_error_sse2.asm',
'vp9/encoder/x86/vp9_sad4d_sse2.asm',
'vp9/encoder/x86/vp9_sad_mmx.asm',
'vp9/encoder/x86/vp9_sad_sse2.asm',
'vp9/encoder/x86/vp9_sad_sse3.asm',
'vp9/encoder/x86/vp9_sad_sse4.asm',
'vp9/encoder/x86/vp9_sad_ssse3.asm',
'vp9/encoder/x86/vp9_subpel_variance.asm',
'vp9/encoder/x86/vp9_subpel_variance_impl_sse2.asm',
'vp9/encoder/x86/vp9_subtract_sse2.asm',
'vp9/encoder/x86/vp9_temporal_filter_apply_sse2.asm',
'vp9/encoder/x86/vp9_variance_impl_mmx.asm',
'vp9/encoder/x86/vp9_variance_impl_sse2.asm',
'vp9/encoder/x86/vp9_variance_mmx.c',
'vp9/encoder/x86/vp9_variance_sse2.c']
}

1199
media/libvpx/third_party/x86inc/x86inc.asm vendored Normal file

File diff suppressed because it is too large Load Diff

531
media/libvpx/update.py Executable file
View File

@ -0,0 +1,531 @@
#!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import os
import re
import shutil
import sys
import subprocess
from pprint import pprint
from StringIO import StringIO
PLATFORMS= [
'x86-win32-vs8',
'x86_64-win64-vs8',
'x86-linux-gcc',
'x86_64-linux-gcc',
'generic-gnu',
'x86-darwin9-gcc',
'x86_64-darwin9-gcc',
'armv7-android-gcc',
]
mk_files = [
'vp8/vp8_common.mk',
'vp8/vp8cx_arm.mk',
'vp8/vp8cx.mk',
'vp8/vp8dx.mk',
'vp9/vp9_common.mk',
'vp9/vp9cx.mk',
'vp9/vp9dx.mk',
'vpx_mem/vpx_mem.mk',
'vpx_ports/vpx_ports.mk',
'vpx_scale/vpx_scale.mk',
'vpx/vpx_codec.mk',
]
extensions = ['.asm', '.c', '.h']
MODULES = {
'ENCODER': [
'API_DOC_SRCS-$(CONFIG_VP8_ENCODER)',
'API_SRCS-$(BUILD_LIBVPX)',
'API_SRCS-$(CONFIG_VP8_ENCODER)',
'API_SRCS-$(CONFIG_VP9_ENCODER)',
'VP8_CX_EXPORTS',
'VP8_CX_SRCS-$(CONFIG_MULTI_RES_ENCODING)',
'VP8_CX_SRCS-$(CONFIG_MULTITHREAD)',
'VP8_CX_SRCS-$(CONFIG_TEMPORAL_DENOISING)',
'VP8_CX_SRCS-no',
'VP8_CX_SRCS_REMOVE-no',
'VP8_CX_SRCS_REMOVE-yes',
'VP8_CX_SRCS-yes',
'VP9_CX_EXPORTS',
'VP9_CX_SRCS-no',
'VP9_CX_SRCS_REMOVE-no',
'VP9_CX_SRCS_REMOVE-yes',
'VP9_CX_SRCS-yes',
],
'X86_ASM_ENCODER': [
'VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
'VP8_CX_SRCS-$(HAVE_MMX)',
'VP8_CX_SRCS-$(HAVE_SSE2)',
'VP8_CX_SRCS-$(HAVE_SSE4_1)',
'VP8_CX_SRCS-$(HAVE_SSSE3)',
'VP8_CX_SRCS_REMOVE-$(HAVE_SSE2)',
'VP9_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
'VP9_CX_SRCS-$(HAVE_MMX)',
'VP9_CX_SRCS-$(HAVE_SSE2)',
'VP9_CX_SRCS-$(HAVE_SSE3)',
'VP9_CX_SRCS-$(HAVE_SSE4_1)',
'VP9_CX_SRCS-$(HAVE_SSSE3)',
],
'X86-64_ASM_ENCODER': [
'VP8_CX_SRCS-$(ARCH_X86_64)',
'VP9_CX_SRCS-$(ARCH_X86_64)',
],
'ARM_ASM_ENCODER': [
'VP8_CX_SRCS-$(ARCH_ARM)',
'VP8_CX_SRCS-$(HAVE_EDSP)',
'VP8_CX_SRCS-$(HAVE_MEDIA)',
'VP8_CX_SRCS-$(HAVE_NEON)',
],
'COMMON': [
'API_DOC_SRCS-$(CONFIG_VP8_DECODER)',
'API_DOC_SRCS-yes',
'API_EXPORTS',
'API_SRCS-$(CONFIG_VP8_DECODER)',
'API_SRCS-yes',
'MEM_SRCS-yes',
'PORTS_SRCS-yes',
'SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING)',
'SCALE_SRCS-no',
'SCALE_SRCS-yes',
'VP8_COMMON_SRCS-yes',
'VP8_DX_EXPORTS',
'VP8_DX_SRCS-$(CONFIG_MULTITHREAD)',
'VP8_DX_SRCS-no',
'VP8_DX_SRCS_REMOVE-no',
'VP8_DX_SRCS_REMOVE-yes',
'VP8_DX_SRCS-yes',
'VP9_COMMON_SRCS-yes',
'VP9_DX_EXPORTS',
'VP9_DX_SRCS-no',
'VP9_DX_SRCS_REMOVE-no',
'VP9_DX_SRCS_REMOVE-yes',
'VP9_DX_SRCS-yes',
],
'ERROR_CONCEALMENT': [
'VP8_DX_SRCS-$(CONFIG_ERROR_CONCEALMENT)',
],
'AVX2': [
'VP9_COMMON_SRCS-$(HAVE_AVX2)',
],
'X86_ASM': [
'PORTS_SRCS-$(BUILD_LIBVPX)',
'VP8_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
'VP8_COMMON_SRCS-$(HAVE_MMX)',
'VP8_COMMON_SRCS-$(HAVE_SSE2)',
'VP8_COMMON_SRCS-$(HAVE_SSE3)',
'VP8_COMMON_SRCS-$(HAVE_SSE4_1)',
'VP8_COMMON_SRCS-$(HAVE_SSSE3)',
'VP9_COMMON_SRCS-$(ARCH_X86)$(ARCH_X86_64)',
'VP9_COMMON_SRCS-$(HAVE_MMX)',
'VP9_COMMON_SRCS-$(HAVE_SSE2)',
'VP9_COMMON_SRCS-$(HAVE_SSSE3)',
],
'X86-64_ASM': [
],
'ARM_ASM': [
'PORTS_SRCS-$(ARCH_ARM)',
'SCALE_SRCS-$(HAVE_NEON)',
'VP8_COMMON_SRCS-$(ARCH_ARM)',
'VP8_COMMON_SRCS-$(HAVE_MEDIA)',
'VP8_COMMON_SRCS-$(HAVE_NEON)',
'VP9_COMMON_SRCS-$(HAVE_NEON)',
],
'VP8_POSTPROC': [
'VP8_COMMON_SRCS-$(CONFIG_POSTPROC)',
],
'VP9_POSTPROC': [
'VP9_COMMON_SRCS-$(CONFIG_VP9_POSTPROC)',
]
}
DISABLED_MODULES = [
'MEM_SRCS-$(CONFIG_MEM_MANAGER)',
'MEM_SRCS-$(CONFIG_MEM_TRACKER)',
'VP8_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
'VP9_COMMON_SRCS-$(CONFIG_POSTPROC_VISUALIZER)',
'VP8_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
'VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS)',
# mips files are also ignored via ignored_folders
'SCALE_SRCS-$(HAVE_DSPR2)',
'VP8_COMMON_SRCS-$(HAVE_DSPR2)',
'VP9_COMMON_SRCS-$(HAVE_DSPR2)',
'VP8_CX_SRCS_REMOVE-$(HAVE_EDSP)',
]
libvpx_files = [
'build/make/obj_int_extract.c',
'build/make/ads2gas.pl',
'build/make/thumb.pm',
'LICENSE',
'PATENTS',
]
ignore_files = [
'vp8/common/context.c',
'vp8/common/textblit.c',
'vp8/encoder/ssim.c',
'vp8/encoder/x86/ssim_opt.asm',
'vp9/common/vp9_textblit.c',
'vp9/common/vp9_textblit.h',
'vp9/encoder/vp9_ssim.c',
'vp9/encoder/x86/vp9_ssim_opt.asm',
'vpx_mem/vpx_mem_tracker.c',
'vpx_scale/generic/bicubic_scaler.c',
'vpx_scale/win32/scaleopt.c',
'vpx_scale/win32/scalesystemdependent.c',
]
ignore_folders = [
'examples/',
'googletest/',
'libmkv/',
'libyuv/',
'mips/',
'nestegg/',
'objdir/',
'ppc/',
'test/',
'vpx_mem/memory_manager/',
]
files = {
'EXPORTS': [
'vpx_mem/include/vpx_mem_intrnl.h',
'vpx_mem/vpx_mem.h',
'vpx_ports/arm.h',
'vpx_ports/mem.h',
'vpx_ports/vpx_timer.h',
'vpx_ports/x86.h',
'vpx_scale/vpx_scale.h',
'vpx_scale/yv12config.h',
'vpx/vp8cx.h',
'vpx/vp8dx.h',
'vpx/vp8.h',
'vpx/vpx_codec.h',
'vpx/vpx_decoder.h',
'vpx/vpx_encoder.h',
'vpx/vpx_image.h',
'vpx/vpx_integer.h',
],
'X86-64_ASM_ENCODER': [
'vp9/encoder/x86/vp9_quantize_ssse3.asm',
],
'X86-64_ASM': [
'third_party/x86inc/x86inc.asm',
'vp8/common/x86/loopfilter_block_sse2.asm',
],
'X86_ASM': [
]
}
manual = [
# special case in moz.build
'vp8/encoder/boolhuff.c',
# 64bit only
'vp8/common/x86/loopfilter_block_sse2.asm',
'vp9/encoder/x86/vp9_quantize_ssse3.asm',
# offsets are special cased in Makefile.in
'vp8/encoder/vp8_asm_enc_offsets.c',
'vpx_scale/vpx_scale_asm_offsets.c',
# ignore while vp9 postproc is not enabled
'vp9/common/x86/vp9_postproc_mmx.asm',
'vp9/common/x86/vp9_postproc_sse2.asm',
# ssim_opt is not enabled
'vp8/encoder/x86/ssim_opt.asm',
'vp9/encoder/x86/vp9_ssim_opt.asm',
# asm includes
'vpx_ports/x86_abi_support.asm',
]
platform_files = [
'vp8_rtcd.h',
'vp9_rtcd.h',
'vpx_config.asm',
'vpx_config.c',
'vpx_config.h',
'vpx_scale_rtcd.h',
]
def prepare_upstream(prefix, commit=None):
if os.path.exists(prefix):
print "Please remove '%s' folder before running %s" % (prefix, sys.argv[0])
sys.exit(1)
upstream_url = 'https://gerrit.chromium.org/gerrit/webm/libvpx'
subprocess.call(['git', 'clone', upstream_url, prefix])
if commit:
os.chdir(prefix)
subprocess.call(['git', 'checkout', commit])
else:
os.chdir(prefix)
p = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE)
stdout, stderr = p.communicate()
commit = stdout.strip()
for target in PLATFORMS:
target_objdir = os.path.join(prefix, 'objdir', target)
os.makedirs(target_objdir)
os.chdir(target_objdir)
configure = ['../../configure', '--target=%s' % target, '--disable-examples', '--disable-install-docs']
if 'darwin9' in target:
configure += ['--enable-pic']
if 'linux' in target:
configure += ['--enable-pic']
# mozilla linux toolchain currently does not support avx2,
# remove once gcc is updated
configure += ['--disable-avx2']
# x86inc.asm is not compatible with pic 32bit builds
if target == 'x86-linux-gcc':
configure += ['--disable-use-x86inc']
if target == 'armv7-android-gcc':
configure += ['--sdk-path=%s' % ndk_path]
subprocess.call(configure)
make_targets = [f for f in platform_files if not os.path.exists(f)]
if make_targets:
subprocess.call(['make'] + make_targets)
for f in make_targets:
if not os.path.exists(f):
print "%s missing from %s, check toolchain" % (f, target)
sys.exit(1)
os.chdir(base)
return commit
def cleanup_upstream():
shutil.rmtree(os.path.join(base, 'upstream'))
def get_module(key):
for module in MODULES:
if key in MODULES[module]:
return module
def get_libvpx_files(prefix):
for root, folders, files in os.walk(prefix):
for f in files:
f = os.path.join(root, f)[len(prefix):]
if os.path.splitext(f)[-1] in extensions \
and os.sep in f \
and f not in ignore_files \
and not any(folder in f for folder in ignore_folders):
libvpx_files.append(f)
return libvpx_files
def get_sources(prefix):
source = {}
unknown = {}
disabled = {}
for mk in mk_files:
with open(os.path.join(prefix, mk)) as f:
base = os.path.dirname(mk)
for l in f:
if '+=' in l:
l = l.split('+=')
key = l[0].strip()
value = l[1].strip().replace('$(ASM)', '.asm')
value = os.path.join(base, value)
if not key.startswith('#') and os.path.splitext(value)[-1] in extensions:
if key not in source:
source[key] = []
source[key].append(value)
for key in source:
for f in source[key]:
if key.endswith('EXPORTS') and f.endswith('.h'):
files['EXPORTS'].append(f)
if os.path.splitext(f)[-1] in ('.c', '.asm') and not f in manual:
module = get_module(key)
if module:
if not module in files:
files[module] = []
t = files[module]
elif key in DISABLED_MODULES:
if not key in disabled:
disabled[key] = []
t = disabled[key]
else:
if not key in unknown:
unknown[key] = []
t = unknown[key]
t.append(f)
for key in files:
files[key] = list(sorted(set(files[key])))
return source, files, disabled, unknown
def update_sources_mozbuild(files, sources_mozbuild):
f = StringIO()
pprint(files, stream=f)
sources_mozbuild_new = "files = {\n %s\n}\n" % f.getvalue().strip()[1:-1]
if sources_mozbuild != sources_mozbuild_new:
print 'updating sources.mozbuild'
with open('sources.mozbuild', 'w') as f:
f.write(sources_mozbuild_new)
def get_current_files():
current_files = []
for root, folders, files in os.walk('.'):
for f in files:
f = os.path.join(root, f)[len('.%s'%os.sep):]
if 'upstream%s'%os.sep in f or not os.sep in f:
continue
if os.path.splitext(f)[-1] in extensions:
current_files.append(f)
return current_files
def is_new(a, b):
return not os.path.exists(a) \
or not os.path.exists(b) \
or open(a).read() != open(b).read()
def get_sources_mozbuild():
with open('sources.mozbuild') as f:
sources_mozbuild = f.read()
exec(sources_mozbuild)
return sources_mozbuild, files
def update_and_remove_files(prefix, libvpx_files, files):
current_files = get_current_files()
def copy(src, dst):
print ' ', dst
shutil.copy(src, dst)
# Update files
first = True
for f in libvpx_files:
fdir = os.path.dirname(f)
if fdir and not os.path.exists(fdir):
os.makedirs(fdir)
s = os.path.join(prefix, f)
if is_new(f, s):
if first:
print "Copy files:"
first = False
copy(s, f)
# Copy configuration files for each platform
for target in PLATFORMS:
first = True
for f in platform_files:
t = os.path.splitext(f)
t = '%s_%s%s' % (t[0], target, t[1])
f = os.path.join(prefix, 'objdir', target, f)
if is_new(f, t):
if first:
print "Copy files for %s:" % target
first = False
copy(f, t)
# Copy vpx_version.h from one of the build targets
s = os.path.join(prefix, 'objdir/x86-linux-gcc/vpx_version.h')
f = 'vpx_version.h'
if is_new(s, f):
copy(s, f)
# Remove unknown files from tree
removed_files = [f for f in current_files if f not in libvpx_files]
if removed_files:
print "Remove files:"
for f in removed_files:
os.unlink(f)
print ' ', f
def apply_patches():
# Patch to permit vpx users to specify their own <stdint.h> types.
os.system("patch -p3 < stdint.patch")
def update_readme(commit):
with open('README_MOZILLA') as f:
readme = f.read()
if 'The git commit ID used was' in readme:
new_readme = re.sub('The git commit ID used was [a-f0-9]+',
'The git commit ID used was %s' % commit, readme)
else:
new_readme = "%s\n\nThe git commit ID used was %s\n" % (readme, commit)
if readme != new_readme:
with open('README_MOZILLA', 'w') as f:
f.write(new_readme)
def print_info(source, files, disabled, unknown, moz_build_files):
for key in moz_build_files:
if key not in files:
print key, 'MISSING'
else:
gone = set(moz_build_files[key]) - set(files[key])
new = set(files[key]) - set(moz_build_files[key])
if gone:
print key, 'GONE:'
print ' '+ '\n '.join(gone)
if new:
print key, 'NEW:'
print ' '+ '\n '.join(new)
if unknown:
print "Please update this script, the following modules are unknown"
pprint(unknown)
if DEBUG:
print "===== SOURCE"
pprint(source)
print "===== FILES"
pprint(files)
print "===== DISABLED"
pprint(disabled)
print "===== UNKNOWN"
pprint(unknown)
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='''This script only works on Mac OS X since the OS X Toolchain is not available on other platforms.
In addition you need XCode and the Android NDK installed.
If commit hash is not provided, current git master is used.''')
parser.add_argument('--debug', dest='debug', action="store_true")
parser.add_argument('--ndk', dest='ndk', type=str)
parser.add_argument('--commit', dest='commit', type=str, default=None)
args = parser.parse_args()
if sys.platform != 'darwin' or not args.ndk:
parser.print_help()
sys.exit(1)
ndk_path = args.ndk
commit = args.commit
DEBUG = args.debug
base = os.path.abspath(os.curdir)
prefix = os.path.join(base, 'upstream/')
commit = prepare_upstream(prefix, commit)
libvpx_files = get_libvpx_files(prefix)
source, files, disabled, unknown = get_sources(prefix)
sources_mozbuild, moz_build_files = get_sources_mozbuild()
print_info(source, files, disabled, unknown, moz_build_files)
update_sources_mozbuild(files, sources_mozbuild)
update_and_remove_files(prefix, libvpx_files, files)
apply_patches()
update_readme(commit)
cleanup_upstream()

View File

@ -1,362 +0,0 @@
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -e
PLATFORMS='
x86-win32-vs8
x86_64-win64-vs8
x86-linux-gcc
x86_64-linux-gcc
generic-gnu
x86-darwin9-gcc
x86_64-darwin9-gcc
armv7-android-gcc
'
if [ $# -lt 1 ]; then
echo Usage: update.sh /path/to/libvpx/
echo The libvpx dir must contain a directory "objdir" with the following directories configured in it:
for target in ${PLATFORMS}; do
echo -e " * objdir/${target}"
done
echo You can configure these from objdir/\$target with the following command:
echo $ ../../configure --target=\$target --disable-examples --disable-install-docs
echo For Android you need --sdk-path=/path/to/android-ndk-r\$REV
echo For Mac, you also need --enable-pic
exit -1
fi
# These are relative to SDK source dir.
commonFiles=(
LICENSE
PATENTS
build/make/ads2gas.pl
build/make/obj_int_extract.c
vp8/common/alloccommon.c
vp8/common/alloccommon.h
vp8/common/arm/armv6/bilinearfilter_v6.asm
vp8/common/arm/armv6/copymem16x16_v6.asm
vp8/common/arm/armv6/copymem8x4_v6.asm
vp8/common/arm/armv6/copymem8x8_v6.asm
vp8/common/arm/armv6/dc_only_idct_add_v6.asm
vp8/common/arm/armv6/dequant_idct_v6.asm
vp8/common/arm/armv6/dequantize_v6.asm
vp8/common/arm/armv6/filter_v6.asm
vp8/common/arm/armv6/idct_blk_v6.c
vp8/common/arm/armv6/idct_v6.asm
vp8/common/arm/armv6/intra4x4_predict_v6.asm
vp8/common/arm/armv6/iwalsh_v6.asm
vp8/common/arm/armv6/loopfilter_v6.asm
vp8/common/arm/armv6/simpleloopfilter_v6.asm
vp8/common/arm/armv6/sixtappredict8x4_v6.asm
vp8/common/arm/armv6/vp8_sad16x16_armv6.asm
vp8/common/arm/armv6/vp8_variance16x16_armv6.asm
vp8/common/arm/armv6/vp8_variance8x8_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_h_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_hv_armv6.asm
vp8/common/arm/armv6/vp8_variance_halfpixvar16x16_v_armv6.asm
vp8/common/arm/bilinearfilter_arm.c
vp8/common/arm/bilinearfilter_arm.h
vp8/common/arm/dequantize_arm.c
vp8/common/arm/filter_arm.c
vp8/common/arm/loopfilter_arm.c
vp8/common/arm/neon/bilinearpredict16x16_neon.asm
vp8/common/arm/neon/bilinearpredict4x4_neon.asm
vp8/common/arm/neon/bilinearpredict8x4_neon.asm
vp8/common/arm/neon/bilinearpredict8x8_neon.asm
vp8/common/arm/neon/buildintrapredictorsmby_neon.asm
vp8/common/arm/neon/copymem16x16_neon.asm
vp8/common/arm/neon/copymem8x4_neon.asm
vp8/common/arm/neon/copymem8x8_neon.asm
vp8/common/arm/neon/dc_only_idct_add_neon.asm
vp8/common/arm/neon/dequant_idct_neon.asm
vp8/common/arm/neon/dequantizeb_neon.asm
vp8/common/arm/neon/idct_blk_neon.c
vp8/common/arm/neon/idct_dequant_0_2x_neon.asm
vp8/common/arm/neon/idct_dequant_full_2x_neon.asm
vp8/common/arm/neon/iwalsh_neon.asm
vp8/common/arm/neon/loopfilter_neon.asm
vp8/common/arm/neon/loopfiltersimplehorizontaledge_neon.asm
vp8/common/arm/neon/loopfiltersimpleverticaledge_neon.asm
vp8/common/arm/neon/mbloopfilter_neon.asm
vp8/common/arm/neon/sad16_neon.asm
vp8/common/arm/neon/sad8_neon.asm
vp8/common/arm/neon/save_reg_neon.asm
vp8/common/arm/neon/shortidct4x4llm_neon.asm
vp8/common/arm/neon/sixtappredict16x16_neon.asm
vp8/common/arm/neon/sixtappredict4x4_neon.asm
vp8/common/arm/neon/sixtappredict8x4_neon.asm
vp8/common/arm/neon/sixtappredict8x8_neon.asm
vp8/common/arm/neon/variance_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance16x16_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance16x16s_neon.asm
vp8/common/arm/neon/vp8_subpixelvariance8x8_neon.asm
vp8/common/arm/reconintra_arm.c
vp8/common/arm/variance_arm.c
vp8/common/asm_com_offsets.c
vp8/common/blockd.c
vp8/common/blockd.h
vp8/common/coefupdateprobs.h
vp8/common/common.h
vp8/common/debugmodes.c
vp8/common/default_coef_probs.h
vp8/common/dequantize.c
vp8/common/entropy.c
vp8/common/entropy.h
vp8/common/entropymode.c
vp8/common/entropymode.h
vp8/common/entropymv.c
vp8/common/entropymv.h
vp8/common/extend.c
vp8/common/extend.h
vp8/common/filter.c
vp8/common/filter.h
vp8/common/findnearmv.c
vp8/common/findnearmv.h
vp8/common/generic/systemdependent.c
vp8/common/header.h
vp8/common/idct_blk.c
vp8/common/idctllm.c
vp8/common/invtrans.h
vp8/common/loopfilter.c
vp8/common/loopfilter.h
vp8/common/loopfilter_filters.c
vp8/common/mbpitch.c
vp8/common/mfqe.c
vp8/common/modecont.c
vp8/common/modecont.h
vp8/common/mv.h
vp8/common/onyx.h
vp8/common/onyxc_int.h
vp8/common/onyxd.h
vp8/common/postproc.c
vp8/common/postproc.h
vp8/common/ppflags.h
vp8/common/pragmas.h
vp8/common/quant_common.c
vp8/common/quant_common.h
vp8/common/reconinter.c
vp8/common/reconinter.h
vp8/common/reconintra.c
vp8/common/reconintra4x4.c
vp8/common/reconintra4x4.h
vp8/common/rtcd.c
vp8/common/sad_c.c
vp8/common/setupintrarecon.c
vp8/common/setupintrarecon.h
vp8/common/swapyv12buffer.c
vp8/common/swapyv12buffer.h
vp8/common/systemdependent.h
vp8/common/threading.h
vp8/common/treecoder.c
vp8/common/treecoder.h
vp8/common/variance.h
vp8/common/variance_c.c
vp8/common/vp8_entropymodedata.h
vp8/common/x86/dequantize_mmx.asm
vp8/common/x86/filter_x86.c
vp8/common/x86/filter_x86.h
vp8/common/x86/idct_blk_mmx.c
vp8/common/x86/idct_blk_sse2.c
vp8/common/x86/idctllm_mmx.asm
vp8/common/x86/idctllm_sse2.asm
vp8/common/x86/iwalsh_mmx.asm
vp8/common/x86/iwalsh_sse2.asm
vp8/common/x86/loopfilter_block_sse2.asm
vp8/common/x86/loopfilter_mmx.asm
vp8/common/x86/loopfilter_sse2.asm
vp8/common/x86/loopfilter_x86.c
vp8/common/x86/mfqe_sse2.asm
vp8/common/x86/postproc_mmx.asm
vp8/common/x86/postproc_sse2.asm
vp8/common/x86/postproc_x86.c
vp8/common/x86/recon_mmx.asm
vp8/common/x86/recon_sse2.asm
vp8/common/x86/recon_wrapper_sse2.c
vp8/common/x86/sad_mmx.asm
vp8/common/x86/sad_sse2.asm
vp8/common/x86/sad_sse3.asm
vp8/common/x86/sad_sse4.asm
vp8/common/x86/sad_ssse3.asm
vp8/common/x86/subpixel_mmx.asm
vp8/common/x86/subpixel_sse2.asm
vp8/common/x86/subpixel_ssse3.asm
vp8/common/x86/variance_impl_mmx.asm
vp8/common/x86/variance_impl_sse2.asm
vp8/common/x86/variance_impl_ssse3.asm
vp8/common/x86/variance_mmx.c
vp8/common/x86/variance_sse2.c
vp8/common/x86/variance_ssse3.c
vp8/common/x86/vp8_asm_stubs.c
vp8/decoder/asm_dec_offsets.c
vp8/decoder/dboolhuff.c
vp8/decoder/dboolhuff.h
vp8/decoder/decodemv.c
vp8/decoder/decodemv.h
vp8/decoder/decoderthreading.h
vp8/decoder/decodframe.c
vp8/decoder/detokenize.c
vp8/decoder/detokenize.h
vp8/decoder/ec_types.h
vp8/decoder/error_concealment.c
vp8/decoder/error_concealment.h
vp8/decoder/onyxd_if.c
vp8/decoder/onyxd_int.h
vp8/decoder/threading.c
vp8/decoder/treereader.h
vp8/encoder/arm/armv5te/boolhuff_armv5te.asm
vp8/encoder/arm/armv5te/vp8_packtokens_armv5.asm
vp8/encoder/arm/armv5te/vp8_packtokens_mbrow_armv5.asm
vp8/encoder/arm/armv5te/vp8_packtokens_partitions_armv5.asm
vp8/encoder/arm/armv6/vp8_fast_quantize_b_armv6.asm
vp8/encoder/arm/armv6/vp8_mse16x16_armv6.asm
vp8/encoder/arm/armv6/vp8_short_fdct4x4_armv6.asm
vp8/encoder/arm/armv6/vp8_subtract_armv6.asm
vp8/encoder/arm/armv6/walsh_v6.asm
vp8/encoder/arm/boolhuff_arm.c
vp8/encoder/arm/dct_arm.c
vp8/encoder/arm/neon/fastquantizeb_neon.asm
vp8/encoder/arm/neon/picklpf_arm.c
vp8/encoder/arm/neon/shortfdct_neon.asm
vp8/encoder/arm/neon/subtract_neon.asm
vp8/encoder/arm/neon/vp8_memcpy_neon.asm
vp8/encoder/arm/neon/vp8_mse16x16_neon.asm
vp8/encoder/arm/neon/vp8_shortwalsh4x4_neon.asm
vp8/encoder/arm/quantize_arm.c
vp8/encoder/asm_enc_offsets.c
vp8/encoder/bitstream.c
vp8/encoder/bitstream.h
vp8/encoder/block.h
vp8/encoder/boolhuff.c
vp8/encoder/boolhuff.h
vp8/encoder/dct.c
vp8/encoder/dct_value_cost.h
vp8/encoder/dct_value_tokens.h
vp8/encoder/defaultcoefcounts.h
vp8/encoder/denoising.c
vp8/encoder/denoising.h
vp8/encoder/encodeframe.c
vp8/encoder/encodeframe.h
vp8/encoder/encodeintra.c
vp8/encoder/encodeintra.h
vp8/encoder/encodemb.c
vp8/encoder/encodemb.h
vp8/encoder/encodemv.c
vp8/encoder/encodemv.h
vp8/encoder/ethreading.c
vp8/encoder/firstpass.c
vp8/encoder/firstpass.h
vp8/encoder/lookahead.c
vp8/encoder/lookahead.h
vp8/encoder/mcomp.c
vp8/encoder/mcomp.h
vp8/encoder/modecosts.c
vp8/encoder/modecosts.h
vp8/encoder/mr_dissim.c
vp8/encoder/mr_dissim.h
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h
vp8/encoder/pickinter.c
vp8/encoder/pickinter.h
vp8/encoder/picklpf.c
vp8/encoder/psnr.c
vp8/encoder/psnr.h
vp8/encoder/quantize.c
vp8/encoder/quantize.h
vp8/encoder/ratectrl.c
vp8/encoder/ratectrl.h
vp8/encoder/rdopt.c
vp8/encoder/rdopt.h
vp8/encoder/segmentation.c
vp8/encoder/segmentation.h
vp8/encoder/temporal_filter.c
vp8/encoder/tokenize.c
vp8/encoder/tokenize.h
vp8/encoder/treewriter.c
vp8/encoder/treewriter.h
vp8/encoder/x86/dct_mmx.asm
vp8/encoder/x86/dct_sse2.asm
vp8/encoder/x86/denoising_sse2.c
vp8/encoder/x86/encodeopt.asm
vp8/encoder/x86/fwalsh_sse2.asm
vp8/encoder/x86/quantize_mmx.asm
vp8/encoder/x86/quantize_sse2.asm
vp8/encoder/x86/quantize_sse4.asm
vp8/encoder/x86/quantize_ssse3.asm
vp8/encoder/x86/ssim_opt.asm
vp8/encoder/x86/subtract_mmx.asm
vp8/encoder/x86/subtract_sse2.asm
vp8/encoder/x86/temporal_filter_apply_sse2.asm
vp8/encoder/x86/vp8_enc_stubs_mmx.c
vp8/encoder/x86/vp8_enc_stubs_sse2.c
vp8/vp8_cx_iface.c
vp8/vp8_dx_iface.c
vpx/internal/vpx_codec_internal.h
vpx/src/vpx_codec.c
vpx/src/vpx_decoder.c
vpx/src/vpx_encoder.c
vpx/src/vpx_image.c
vpx/vp8.h
vpx/vp8cx.h
vpx/vp8dx.h
vpx/vpx_codec.h
vpx/vpx_codec_impl_bottom.h
vpx/vpx_codec_impl_top.h
vpx/vpx_decoder.h
vpx/vpx_encoder.h
vpx/vpx_image.h
vpx/vpx_integer.h
vpx_mem/include/vpx_mem_intrnl.h
vpx_mem/include/vpx_mem_tracker.h
vpx_mem/vpx_mem.c
vpx_mem/vpx_mem.h
vpx_ports/arm.h
vpx_ports/arm_cpudetect.c
vpx_ports/asm_offsets.h
vpx_ports/emms.asm
vpx_ports/mem.h
vpx_ports/mem_ops.h
vpx_ports/mem_ops_aligned.h
vpx_ports/vpx_timer.h
vpx_ports/vpxtypes.h
vpx_ports/x86.h
vpx_ports/x86_abi_support.asm
vpx_ports/x86_cpuid.c
vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm
vpx_scale/arm/neon/vp8_vpxyv12_extendframeborders_neon.asm
vpx_scale/arm/neon/yv12extend_arm.c
vpx_scale/generic/gen_scalers.c
vpx_scale/generic/vpxscale.c
vpx_scale/generic/yv12config.c
vpx_scale/generic/yv12extend.c
vpx_scale/generic/yv12extend_generic.h
vpx_scale/include/generic/vpxscale_arbitrary.h
vpx_scale/include/generic/vpxscale_depricated.h
vpx_scale/scale_mode.h
vpx_scale/vpxscale.h
vpx_scale/yv12config.h
)
# Copy configuration files for each platform
for target in ${PLATFORMS}; do
cp ${1}/objdir/${target}/vpx_config.h vpx_config_${target}.h
cp ${1}/objdir/${target}/vpx_config.c vpx_config_${target}.c
cp ${1}/objdir/${target}/vpx_rtcd.h vpx_rtcd_${target}.h
done
# Copy vpx_version.h from one of the build targets
cp ${1}/objdir/x86-linux-gcc/vpx_version.h vpx_version.h
# Copy common source files into mozilla tree.
for f in ${commonFiles[@]}
do
mkdir -p -v `dirname $f`
cp -v $1/$f $f
done
# Patch to permit vpx users to specify their own <stdint.h> types.
patch -p3 < stdint.patch

View File

@ -173,7 +173,6 @@ void vp8_create_common(VP8_COMMON *oci)
oci->use_bilinear_mc_filter = 0;
oci->full_pixel = 0;
oci->multi_token_partition = ONE_PARTITION;
oci->clr_type = REG_YUV;
oci->clamp_type = RECON_CLAMP_REQUIRED;
/* Initialize reference frame sign bias structure to defaults */

View File

@ -394,7 +394,7 @@
mov r4, #0x40 ; rounding factor (for smlad{x})
|height_loop_2nd_4|
ldrd r8, [r0, #-4] ; load the data
ldrd r8, r9, [r0, #-4] ; load the data
orr r7, r7, r3, lsr #1 ; loop counter
|width_loop_2nd_4|

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
void vp8_dequant_idct_add_y_block_v6(short *q, short *dq,

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include <math.h>
#include "vp8/common/filter.h"
#include "bilinearfilter_arm.h"

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include <math.h>
#include "vp8/common/filter.h"
#include "vpx_ports/mem.h"

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/common/loopfilter.h"
#include "vp8/common/onyxc_int.h"

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
/* place these declarations here because we don't want to maintain them
* outside of this scope

View File

@ -9,9 +9,6 @@
;
bilinear_taps_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
;-----------------
EXPORT |vp8_sub_pixel_variance16x16_neon_func|
@ -29,6 +26,9 @@ bilinear_taps_coeff
; stack(r6) unsigned int *sse
;note: most of the code is copied from bilinear_predict16x16_neon and vp8_variance16x16_neon.
bilinear_taps_coeff
DCD 128, 0, 112, 16, 96, 32, 80, 48, 64, 64, 48, 80, 32, 96, 16, 112
|vp8_sub_pixel_variance16x16_neon_func| PROC
push {r4-r6, lr}

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/common/variance.h"
#include "vp8/common/filter.h"

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"

View File

@ -9,9 +9,7 @@
*/
#include <stdlib.h>
#include "filter.h"
#include "vpx_ports/mem.h"
DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]) =
{

View File

@ -12,11 +12,13 @@
#ifndef FILTER_H
#define FILTER_H
#include "vpx_ports/mem.h"
#define BLOCK_HEIGHT_WIDTH 4
#define VP8_FILTER_WEIGHT 128
#define VP8_FILTER_SHIFT 7
extern const short vp8_bilinear_filters[8][2];
extern const short vp8_sub_pel_filters[8][6];
extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters[8][2]);
extern DECLARE_ALIGNED(16, const short, vp8_sub_pel_filters[8][6]);
#endif

View File

@ -124,7 +124,7 @@ static int above_block_mv(const MODE_INFO *cur_mb, int b, int mi_stride)
b += 16;
}
return (cur_mb->bmi + b - 4)->mv.as_int;
return (cur_mb->bmi + (b - 4))->mv.as_int;
}
static B_PREDICTION_MODE left_block_mode(const MODE_INFO *cur_mb, int b)
{

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#if ARCH_ARM
#include "vpx_ports/arm.h"
#elif ARCH_X86 || ARCH_X86_64
@ -82,6 +82,7 @@ static int get_cpu_count()
}
#endif
void vp8_clear_system_state_c() {};
void vp8_machine_specific_config(VP8_COMMON *ctx)
{

View File

@ -9,7 +9,8 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_mem/vpx_mem.h"
void vp8_dequant_idct_add_c(short *input, short *dq,
unsigned char *dest, int stride);
@ -32,7 +33,7 @@ void vp8_dequant_idct_add_y_block_c
else
{
vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
q += 16;
@ -58,7 +59,7 @@ void vp8_dequant_idct_add_uv_block_c
else
{
vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
q += 16;
@ -77,7 +78,7 @@ void vp8_dequant_idct_add_uv_block_c
else
{
vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
q += 16;

View File

@ -13,7 +13,7 @@
#define __INC_INVTRANS_H
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "blockd.h"
#include "onyxc_int.h"

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "loopfilter.h"
#include "onyxc_int.h"
#include "vpx_mem/vpx_mem.h"
@ -156,39 +156,38 @@ void vp8_loop_filter_frame_init(VP8_COMMON *cm,
continue;
}
lvl_ref = lvl_seg;
/* INTRA_FRAME */
ref = INTRA_FRAME;
/* Apply delta for reference frame */
lvl_ref += mbd->ref_lf_deltas[ref];
lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref];
/* Apply delta for Intra modes */
mode = 0; /* B_PRED */
/* Only the split mode BPRED has a further special case */
lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode];
lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */
lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode];
/* clamp */
lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0;
lfi->lvl[seg][ref][mode] = lvl_mode;
mode = 1; /* all the rest of Intra modes */
lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0; /* clamp */
/* clamp */
lvl_mode = (lvl_ref > 0) ? (lvl_ref > 63 ? 63 : lvl_ref) : 0;
lfi->lvl[seg][ref][mode] = lvl_mode;
/* LAST, GOLDEN, ALT */
for(ref = 1; ref < MAX_REF_FRAMES; ref++)
{
int lvl_ref = lvl_seg;
/* Apply delta for reference frame */
lvl_ref += mbd->ref_lf_deltas[ref];
lvl_ref = lvl_seg + mbd->ref_lf_deltas[ref];
/* Apply delta for Inter modes */
for (mode = 1; mode < 4; mode++)
{
lvl_mode = lvl_ref + mbd->mode_lf_deltas[mode];
lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0; /* clamp */
/* clamp */
lvl_mode = (lvl_mode > 0) ? (lvl_mode > 63 ? 63 : lvl_mode) : 0;
lfi->lvl[seg][ref][mode] = lvl_mode;
}
@ -567,46 +566,28 @@ void vp8_loop_filter_partial_frame
int mb_cols = post->y_width >> 4;
int mb_rows = post->y_height >> 4;
int linestocopy, i;
int linestocopy;
loop_filter_info_n *lfi_n = &cm->lf_info;
loop_filter_info lfi;
int filter_level;
int alt_flt_enabled = mbd->segmentation_enabled;
FRAME_TYPE frame_type = cm->frame_type;
const MODE_INFO *mode_info_context;
int lvl_seg[MAX_MB_SEGMENTS];
#if 0
if(default_filt_lvl == 0) /* no filter applied */
return;
#endif
/* Initialize the loop filter for this frame. */
vp8_loop_filter_frame_init( cm, mbd, default_filt_lvl);
/* number of MB rows to use in partial filtering */
linestocopy = mb_rows / PARTIAL_FRAME_FRACTION;
linestocopy = linestocopy ? linestocopy << 4 : 16; /* 16 lines per MB */
/* Note the baseline filter values for each segment */
/* See vp8_loop_filter_frame_init. Rather than call that for each change
* to default_filt_lvl, copy the relevant calculation here.
*/
if (alt_flt_enabled)
{
for (i = 0; i < MAX_MB_SEGMENTS; i++)
{ /* Abs value */
if (mbd->mb_segement_abs_delta == SEGMENT_ABSDATA)
{
lvl_seg[i] = mbd->segment_feature_data[MB_LVL_ALT_LF][i];
}
/* Delta Value */
else
{
lvl_seg[i] = default_filt_lvl
+ mbd->segment_feature_data[MB_LVL_ALT_LF][i];
lvl_seg[i] = (lvl_seg[i] > 0) ?
((lvl_seg[i] > 63) ? 63: lvl_seg[i]) : 0;
}
}
}
/* Set up the buffer pointers; partial image starts at ~middle of frame */
y_ptr = post->y_buffer + ((post->y_height >> 5) * 16) * post->y_stride;
mode_info_context = cm->mi + (post->y_height >> 5) * (mb_cols + 1);
@ -620,10 +601,12 @@ void vp8_loop_filter_partial_frame
mode_info_context->mbmi.mode != SPLITMV &&
mode_info_context->mbmi.mb_skip_coeff);
if (alt_flt_enabled)
filter_level = lvl_seg[mode_info_context->mbmi.segment_id];
else
filter_level = default_filt_lvl;
const int mode_index =
lfi_n->mode_lf_lut[mode_info_context->mbmi.mode];
const int seg = mode_info_context->mbmi.segment_id;
const int ref_frame = mode_info_context->mbmi.ref_frame;
filter_level = lfi_n->lvl[seg][ref_frame][mode_index];
if (filter_level)
{

View File

@ -14,7 +14,7 @@
#include "vpx_ports/mem.h"
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#define MAX_LOOP_FILTER 63
/* fraction of total macroblock rows to be used in fast filter level picking */

View File

@ -54,7 +54,7 @@ static void vp8_filter(signed char mask, uc hev, uc *op1,
{
signed char ps0, qs0;
signed char ps1, qs1;
signed char vp8_filter, Filter1, Filter2;
signed char filter_value, Filter1, Filter2;
signed char u;
ps1 = (signed char) * op1 ^ 0x80;
@ -63,35 +63,35 @@ static void vp8_filter(signed char mask, uc hev, uc *op1,
qs1 = (signed char) * oq1 ^ 0x80;
/* add outer taps if we have high edge variance */
vp8_filter = vp8_signed_char_clamp(ps1 - qs1);
vp8_filter &= hev;
filter_value = vp8_signed_char_clamp(ps1 - qs1);
filter_value &= hev;
/* inner taps */
vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0));
vp8_filter &= mask;
filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0));
filter_value &= mask;
/* save bottom 3 bits so that we round one side +4 and the other +3
* if it equals 4 we'll set to adjust by -1 to account for the fact
* we'd round 3 the other way
*/
Filter1 = vp8_signed_char_clamp(vp8_filter + 4);
Filter2 = vp8_signed_char_clamp(vp8_filter + 3);
Filter1 = vp8_signed_char_clamp(filter_value + 4);
Filter2 = vp8_signed_char_clamp(filter_value + 3);
Filter1 >>= 3;
Filter2 >>= 3;
u = vp8_signed_char_clamp(qs0 - Filter1);
*oq0 = u ^ 0x80;
u = vp8_signed_char_clamp(ps0 + Filter2);
*op0 = u ^ 0x80;
vp8_filter = Filter1;
filter_value = Filter1;
/* outer tap adjustments */
vp8_filter += 1;
vp8_filter >>= 1;
vp8_filter &= ~hev;
filter_value += 1;
filter_value >>= 1;
filter_value &= ~hev;
u = vp8_signed_char_clamp(qs1 - vp8_filter);
u = vp8_signed_char_clamp(qs1 - filter_value);
*oq1 = u ^ 0x80;
u = vp8_signed_char_clamp(ps1 + vp8_filter);
u = vp8_signed_char_clamp(ps1 + filter_value);
*op1 = u ^ 0x80;
}
@ -162,7 +162,7 @@ static void vp8_mbfilter(signed char mask, uc hev,
uc *op2, uc *op1, uc *op0, uc *oq0, uc *oq1, uc *oq2)
{
signed char s, u;
signed char vp8_filter, Filter1, Filter2;
signed char filter_value, Filter1, Filter2;
signed char ps2 = (signed char) * op2 ^ 0x80;
signed char ps1 = (signed char) * op1 ^ 0x80;
signed char ps0 = (signed char) * op0 ^ 0x80;
@ -171,11 +171,11 @@ static void vp8_mbfilter(signed char mask, uc hev,
signed char qs2 = (signed char) * oq2 ^ 0x80;
/* add outer taps if we have high edge variance */
vp8_filter = vp8_signed_char_clamp(ps1 - qs1);
vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (qs0 - ps0));
vp8_filter &= mask;
filter_value = vp8_signed_char_clamp(ps1 - qs1);
filter_value = vp8_signed_char_clamp(filter_value + 3 * (qs0 - ps0));
filter_value &= mask;
Filter2 = vp8_filter;
Filter2 = filter_value;
Filter2 &= hev;
/* save bottom 3 bits so that we round one side +4 and the other +3 */
@ -188,8 +188,8 @@ static void vp8_mbfilter(signed char mask, uc hev,
/* only apply wider filter if not high edge variance */
vp8_filter &= ~hev;
Filter2 = vp8_filter;
filter_value &= ~hev;
Filter2 = filter_value;
/* roughly 3/7th difference across boundary */
u = vp8_signed_char_clamp((63 + Filter2 * 27) >> 7);
@ -291,24 +291,24 @@ static signed char vp8_simple_filter_mask(uc blimit, uc p1, uc p0, uc q0, uc q1)
static void vp8_simple_filter(signed char mask, uc *op1, uc *op0, uc *oq0, uc *oq1)
{
signed char vp8_filter, Filter1, Filter2;
signed char filter_value, Filter1, Filter2;
signed char p1 = (signed char) * op1 ^ 0x80;
signed char p0 = (signed char) * op0 ^ 0x80;
signed char q0 = (signed char) * oq0 ^ 0x80;
signed char q1 = (signed char) * oq1 ^ 0x80;
signed char u;
vp8_filter = vp8_signed_char_clamp(p1 - q1);
vp8_filter = vp8_signed_char_clamp(vp8_filter + 3 * (q0 - p0));
vp8_filter &= mask;
filter_value = vp8_signed_char_clamp(p1 - q1);
filter_value = vp8_signed_char_clamp(filter_value + 3 * (q0 - p0));
filter_value &= mask;
/* save bottom 3 bits so that we round one side +4 and the other +3 */
Filter1 = vp8_signed_char_clamp(vp8_filter + 4);
Filter1 = vp8_signed_char_clamp(filter_value + 4);
Filter1 >>= 3;
u = vp8_signed_char_clamp(q0 - Filter1);
*oq0 = u ^ 0x80;
Filter2 = vp8_signed_char_clamp(vp8_filter + 3);
Filter2 = vp8_signed_char_clamp(filter_value + 3);
Filter2 >>= 3;
u = vp8_signed_char_clamp(p0 + Filter2);
*op0 = u ^ 0x80;

View File

@ -20,7 +20,7 @@
#include "postproc.h"
#include "variance.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_scale/yv12config.h"
#include <limits.h>
@ -280,7 +280,7 @@ void vp8_multiframe_quality_enhance
FRAME_TYPE frame_type = cm->frame_type;
/* Point at base of Mb MODE_INFO list has motion vectors etc */
const MODE_INFO *mode_info_context = cm->mi;
const MODE_INFO *mode_info_context = cm->show_frame_mi;
int mb_row;
int mb_col;
int totmap, map[4];

View File

@ -41,7 +41,8 @@ extern "C"
{
USAGE_STREAM_FROM_SERVER = 0x0,
USAGE_LOCAL_FILE_PLAYBACK = 0x1,
USAGE_CONSTRAINED_QUALITY = 0x2
USAGE_CONSTRAINED_QUALITY = 0x2,
USAGE_CONSTANT_QUALITY = 0x3
} END_USAGE;

View File

@ -13,7 +13,7 @@
#define __INC_VP8C_INT_H
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx/internal/vpx_codec_internal.h"
#include "loopfilter.h"
#include "entropymv.h"
@ -72,7 +72,6 @@ typedef struct VP8Common
int horiz_scale;
int vert_scale;
YUV_TYPE clr_type;
CLAMP_TYPE clamp_type;
YV12_BUFFER_CONFIG *frame_to_show;
@ -115,9 +114,6 @@ typedef struct VP8Common
int uvdc_delta_q;
int uvac_delta_q;
unsigned int frames_since_golden;
unsigned int frames_till_alt_ref_frame;
/* We allocate a MODE_INFO struct for each macroblock, together with
an extra row on top and column on the left to simplify prediction. */
@ -127,7 +123,8 @@ typedef struct VP8Common
MODE_INFO *prev_mip; /* MODE_INFO array 'mip' from last decoded frame */
MODE_INFO *prev_mi; /* 'mi' from last frame (points into prev_mip) */
#endif
MODE_INFO *show_frame_mi; /* MODE_INFO for the last decoded frame
to show */
LOOPFILTERTYPE filter_type;
loop_filter_info_n lf_info;
@ -156,7 +153,6 @@ typedef struct VP8Common
unsigned int current_video_frame;
int near_boffset[3];
int version;
TOKEN_PARTITION multi_token_partition;
@ -164,8 +160,10 @@ typedef struct VP8Common
#ifdef PACKET_TESTING
VP8_HEADER oh;
#endif
#if CONFIG_POSTPROC_VISUALIZER
double bitrate;
double framerate;
#endif
#if CONFIG_MULTITHREAD
int processor_core_count;

View File

@ -34,7 +34,6 @@ extern "C"
int postprocess;
int max_threads;
int error_concealment;
int input_fragments;
} VP8D_CONFIG;
typedef enum
@ -56,10 +55,6 @@ extern "C"
vpx_codec_err_t vp8dx_get_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
vpx_codec_err_t vp8dx_set_reference(struct VP8D_COMP* comp, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd);
struct VP8D_COMP* vp8dx_create_decompressor(VP8D_CONFIG *oxcf);
void vp8dx_remove_decompressor(struct VP8D_COMP* comp);
#ifdef __cplusplus
}
#endif

View File

@ -10,11 +10,12 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_scale_rtcd.h"
#include "vpx_scale/yv12config.h"
#include "postproc.h"
#include "common.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/vpx_scale.h"
#include "systemdependent.h"
#include <limits.h>
@ -333,7 +334,7 @@ void vp8_deblock(VP8_COMMON *cm,
double level = 6.0e-05 * q * q * q - .0067 * q * q + .306 * q + .0065;
int ppl = (int)(level + .5);
const MODE_INFO *mode_info_context = cm->mi;
const MODE_INFO *mode_info_context = cm->show_frame_mi;
int mbr, mbc;
/* The pixel thresholds are adjusted according to if or not the macroblock
@ -438,29 +439,28 @@ static void fillrd(struct postproc_state *state, int q, int a)
char char_dist[300];
double sigma;
int ai = a, qi = q, i;
int i;
vp8_clear_system_state();
sigma = ai + .5 + .6 * (63 - qi) / 63.0;
sigma = a + .5 + .6 * (63 - q) / 63.0;
/* set up a lookup table of 256 entries that matches
* a gaussian distribution with sigma determined by q.
*/
{
double i;
int next, j;
next = 0;
for (i = -32; i < 32; i++)
{
int a = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i));
const int v = (int)(.5 + 256 * vp8_gaussian(sigma, 0, i));
if (a)
if (v)
{
for (j = 0; j < a; j++)
for (j = 0; j < v; j++)
{
char_dist[next+j] = (char) i;
}
@ -543,12 +543,12 @@ void vp8_plane_add_noise_c(unsigned char *Start, char *noise,
* filled with the same color block.
*/
void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v,
int y1, int u1, int v1, int alpha, int stride)
int y_1, int u_1, int v_1, int alpha, int stride)
{
int i, j;
int y1_const = y1*((1<<16)-alpha);
int u1_const = u1*((1<<16)-alpha);
int v1_const = v1*((1<<16)-alpha);
int y1_const = y_1*((1<<16)-alpha);
int u1_const = u_1*((1<<16)-alpha);
int v1_const = v_1*((1<<16)-alpha);
y += 2*stride + 2;
for (i = 0; i < 12; i++)
@ -581,12 +581,12 @@ void vp8_blend_mb_inner_c (unsigned char *y, unsigned char *u, unsigned char *v,
* unblended to allow for other visualizations to be layered.
*/
void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v,
int y1, int u1, int v1, int alpha, int stride)
int y_1, int u_1, int v_1, int alpha, int stride)
{
int i, j;
int y1_const = y1*((1<<16)-alpha);
int u1_const = u1*((1<<16)-alpha);
int v1_const = v1*((1<<16)-alpha);
int y1_const = y_1*((1<<16)-alpha);
int u1_const = u_1*((1<<16)-alpha);
int v1_const = v_1*((1<<16)-alpha);
for (i = 0; i < 2; i++)
{
@ -645,12 +645,12 @@ void vp8_blend_mb_outer_c (unsigned char *y, unsigned char *u, unsigned char *v,
}
void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v,
int y1, int u1, int v1, int alpha, int stride)
int y_1, int u_1, int v_1, int alpha, int stride)
{
int i, j;
int y1_const = y1*((1<<16)-alpha);
int u1_const = u1*((1<<16)-alpha);
int v1_const = v1*((1<<16)-alpha);
int y1_const = y_1*((1<<16)-alpha);
int u1_const = u_1*((1<<16)-alpha);
int v1_const = v_1*((1<<16)-alpha);
for (i = 0; i < 4; i++)
{
@ -675,46 +675,46 @@ void vp8_blend_b_c (unsigned char *y, unsigned char *u, unsigned char *v,
}
}
static void constrain_line (int x0, int *x1, int y0, int *y1, int width, int height)
static void constrain_line (int x_0, int *x_1, int y_0, int *y_1, int width, int height)
{
int dx;
int dy;
if (*x1 > width)
if (*x_1 > width)
{
dx = *x1 - x0;
dy = *y1 - y0;
dx = *x_1 - x_0;
dy = *y_1 - y_0;
*x1 = width;
*x_1 = width;
if (dx)
*y1 = ((width-x0)*dy)/dx + y0;
*y_1 = ((width-x_0)*dy)/dx + y_0;
}
if (*x1 < 0)
if (*x_1 < 0)
{
dx = *x1 - x0;
dy = *y1 - y0;
dx = *x_1 - x_0;
dy = *y_1 - y_0;
*x1 = 0;
*x_1 = 0;
if (dx)
*y1 = ((0-x0)*dy)/dx + y0;
*y_1 = ((0-x_0)*dy)/dx + y_0;
}
if (*y1 > height)
if (*y_1 > height)
{
dx = *x1 - x0;
dy = *y1 - y0;
dx = *x_1 - x_0;
dy = *y_1 - y_0;
*y1 = height;
*y_1 = height;
if (dy)
*x1 = ((height-y0)*dx)/dy + x0;
*x_1 = ((height-y_0)*dx)/dy + x_0;
}
if (*y1 < 0)
if (*y_1 < 0)
{
dx = *x1 - x0;
dy = *y1 - y0;
dx = *x_1 - x_0;
dy = *y_1 - y_0;
*y1 = 0;
*y_1 = 0;
if (dy)
*x1 = ((0-y0)*dx)/dy + x0;
*x_1 = ((0-y_0)*dx)/dy + x_0;
}
}
@ -923,7 +923,7 @@ int vp8_post_proc_frame(VP8_COMMON *oci, YV12_BUFFER_CONFIG *dest, vp8_ppflags_t
if (flags & VP8D_DEBUG_TXT_RATE_INFO)
{
char message[512];
sprintf(message, "Bitrate: %10.2f frame_rate: %10.2f ", oci->bitrate, oci->framerate);
sprintf(message, "Bitrate: %10.2f framerate: %10.2f ", oci->bitrate, oci->framerate);
vp8_blit_text(message, oci->post_proc_buffer.y_buffer, oci->post_proc_buffer.y_stride);
}

View File

@ -11,7 +11,7 @@
#include <limits.h>
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx/vpx_integer.h"
#include "blockd.h"
#include "reconinter.h"
@ -138,14 +138,10 @@ void vp8_build_inter_predictors_b(BLOCKD *d, int pitch, unsigned char *base_pre,
{
for (r = 0; r < 4; r++)
{
#if !(CONFIG_FAST_UNALIGNED)
pred_ptr[0] = ptr[0];
pred_ptr[1] = ptr[1];
pred_ptr[2] = ptr[2];
pred_ptr[3] = ptr[3];
#else
*(uint32_t *)pred_ptr = *(uint32_t *)ptr ;
#endif
pred_ptr += pitch;
ptr += pre_stride;
}
@ -196,16 +192,12 @@ static void build_inter_predictors_b(BLOCKD *d, unsigned char *dst, int dst_stri
{
for (r = 0; r < 4; r++)
{
#if !(CONFIG_FAST_UNALIGNED)
dst[0] = ptr[0];
dst[1] = ptr[1];
dst[2] = ptr[2];
dst[3] = ptr[3];
#else
*(uint32_t *)dst = *(uint32_t *)ptr ;
#endif
dst += dst_stride;
ptr += pre_stride;
dst += dst_stride;
ptr += pre_stride;
}
}
}
@ -270,7 +262,7 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
+ x->block[yoffset+4].bmi.mv.as_mv.row
+ x->block[yoffset+5].bmi.mv.as_mv.row;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8);
x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask;
@ -279,7 +271,7 @@ void vp8_build_inter4x4_predictors_mbuv(MACROBLOCKD *x)
+ x->block[yoffset+4].bmi.mv.as_mv.col
+ x->block[yoffset+5].bmi.mv.as_mv.col;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8);
x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask;
@ -558,7 +550,7 @@ void build_4x4uvmvs(MACROBLOCKD *x)
+ x->mode_info_context->bmi[yoffset + 4].mv.as_mv.row
+ x->mode_info_context->bmi[yoffset + 5].mv.as_mv.row;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8);
x->block[uoffset].bmi.mv.as_mv.row = (temp / 8) & x->fullpixel_mask;
@ -567,7 +559,7 @@ void build_4x4uvmvs(MACROBLOCKD *x)
+ x->mode_info_context->bmi[yoffset + 4].mv.as_mv.col
+ x->mode_info_context->bmi[yoffset + 5].mv.as_mv.col;
temp += 4 + ((temp >> (sizeof(int) * CHAR_BIT - 1)) << 3);
temp += 4 + ((temp >> (sizeof(temp) * CHAR_BIT - 1)) * 8);
x->block[uoffset].bmi.mv.as_mv.col = (temp / 8) & x->fullpixel_mask;

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_mem/vpx_mem.h"
#include "blockd.h"
@ -36,7 +36,6 @@ void vp8_build_intra_predictors_mby_s_c(MACROBLOCKD *x,
case DC_PRED:
{
int expected_dc;
int i;
int shift;
int average = 0;
@ -168,7 +167,6 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
{
int expected_udc;
int expected_vdc;
int i;
int shift;
int Uaverage = 0;
int Vaverage = 0;
@ -217,8 +215,6 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
break;
case V_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
vpx_memcpy(upred_ptr, uabove_row, 8);
@ -231,8 +227,6 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
break;
case H_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
vpx_memset(upred_ptr, uleft_col[i], 8);
@ -245,8 +239,6 @@ void vp8_build_intra_predictors_mbuv_s_c(MACROBLOCKD *x,
break;
case TM_PRED:
{
int i;
for (i = 0; i < 8; i++)
{
for (j = 0; j < 8; j++)

View File

@ -10,17 +10,17 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "blockd.h"
void vp8_intra4x4_predict_c(unsigned char *Above,
unsigned char *yleft, int left_stride,
B_PREDICTION_MODE b_mode,
int _b_mode,
unsigned char *dst, int dst_stride,
unsigned char top_left)
{
int i, r, c;
B_PREDICTION_MODE b_mode = (B_PREDICTION_MODE)_b_mode;
unsigned char Left[4];
Left[0] = yleft[0];
Left[1] = yleft[left_stride];

View File

@ -9,97 +9,13 @@
*/
#include "vpx_config.h"
#define RTCD_C
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_ports/vpx_once.h"
#if CONFIG_MULTITHREAD && defined(_WIN32)
#include <windows.h>
#include <stdlib.h>
static void once(void (*func)(void))
{
static CRITICAL_SECTION *lock;
static LONG waiters;
static int done;
void *lock_ptr = &lock;
/* If the initialization is complete, return early. This isn't just an
* optimization, it prevents races on the destruction of the global
* lock.
*/
if(done)
return;
InterlockedIncrement(&waiters);
/* Get a lock. We create one and try to make it the one-true-lock,
* throwing it away if we lost the race.
*/
{
/* Scope to protect access to new_lock */
CRITICAL_SECTION *new_lock = malloc(sizeof(CRITICAL_SECTION));
InitializeCriticalSection(new_lock);
if (InterlockedCompareExchangePointer(lock_ptr, new_lock, NULL) != NULL)
{
DeleteCriticalSection(new_lock);
free(new_lock);
}
}
/* At this point, we have a lock that can be synchronized on. We don't
* care which thread actually performed the allocation.
*/
EnterCriticalSection(lock);
if (!done)
{
func();
done = 1;
}
LeaveCriticalSection(lock);
/* Last one out should free resources. The destructed objects are
* protected by checking if(done) above.
*/
if(!InterlockedDecrement(&waiters))
{
DeleteCriticalSection(lock);
free(lock);
lock = NULL;
}
}
#elif CONFIG_MULTITHREAD && HAVE_PTHREAD_H
#include <pthread.h>
static void once(void (*func)(void))
{
static pthread_once_t lock = PTHREAD_ONCE_INIT;
pthread_once(&lock, func);
}
#else
/* No-op version that performs no synchronization. vpx_rtcd() is idempotent,
* so as long as your platform provides atomic loads/stores of pointers
* no synchronization is strictly necessary.
*/
static void once(void (*func)(void))
{
static int done;
if(!done)
{
func();
done = 1;
}
}
#endif
void vpx_rtcd()
extern void vpx_scale_rtcd(void);
void vp8_rtcd()
{
vpx_scale_rtcd();
once(setup_rtcd_internal);
}

View File

@ -10,12 +10,6 @@
#include "vpx_config.h"
#if ARCH_X86 || ARCH_X86_64
void vpx_reset_mmx_state(void);
#define vp8_clear_system_state() vpx_reset_mmx_state()
#else
#define vp8_clear_system_state()
#endif
struct VP8Common;
void vp8_machine_specific_config(struct VP8Common *);

View File

@ -75,7 +75,7 @@ unsigned int vp8_variance16x16_c(
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 16, &var, &avg);
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 8));
return (var - (((unsigned int)avg * avg) >> 8));
}
unsigned int vp8_variance8x16_c(
@ -91,7 +91,7 @@ unsigned int vp8_variance8x16_c(
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 16, &var, &avg);
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
unsigned int vp8_variance16x8_c(
@ -107,7 +107,7 @@ unsigned int vp8_variance16x8_c(
variance(src_ptr, source_stride, ref_ptr, recon_stride, 16, 8, &var, &avg);
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
@ -124,7 +124,7 @@ unsigned int vp8_variance8x8_c(
variance(src_ptr, source_stride, ref_ptr, recon_stride, 8, 8, &var, &avg);
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 6));
return (var - (((unsigned int)avg * avg) >> 6));
}
unsigned int vp8_variance4x4_c(
@ -140,7 +140,7 @@ unsigned int vp8_variance4x4_c(
variance(src_ptr, source_stride, ref_ptr, recon_stride, 4, 4, &var, &avg);
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 4));
return (var - (((unsigned int)avg * avg) >> 4));
}

View File

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vpx_ports/mem.h"
#include "vp8/common/x86/filter_x86.h"
DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]) =
{

View File

@ -11,9 +11,15 @@
#ifndef FILTER_X86_H
#define FILTER_X86_H
#include "vpx_ports/mem.h"
/* x86 assembly specific copy of vp8/common/filter.c:vp8_bilinear_filters with
* duplicated values */
extern const short vp8_bilinear_filters_x86_4[8][8]; /* duplicated 4x */
extern const short vp8_bilinear_filters_x86_8[8][16]; /* duplicated 8x */
/* duplicated 4x */
extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_4[8][8]);
/* duplicated 8x */
extern DECLARE_ALIGNED(16, const short, vp8_bilinear_filters_x86_8[8][16]);
#endif /* FILTER_X86_H */

View File

@ -9,8 +9,9 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/common/blockd.h"
#include "vpx_mem/vpx_mem.h"
extern void vp8_dequantize_b_impl_mmx(short *sq, short *dq, short *q);
@ -35,7 +36,7 @@ void vp8_dequant_idct_add_y_block_mmx
else if (eobs[0] == 1)
{
vp8_dc_only_idct_add_mmx (q[0]*dq[0], dst, stride, dst, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
if (eobs[1] > 1)
@ -44,7 +45,7 @@ void vp8_dequant_idct_add_y_block_mmx
{
vp8_dc_only_idct_add_mmx (q[16]*dq[0], dst+4, stride,
dst+4, stride);
((int *)(q+16))[0] = 0;
vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
}
if (eobs[2] > 1)
@ -53,7 +54,7 @@ void vp8_dequant_idct_add_y_block_mmx
{
vp8_dc_only_idct_add_mmx (q[32]*dq[0], dst+8, stride,
dst+8, stride);
((int *)(q+32))[0] = 0;
vpx_memset(q + 32, 0, 2 * sizeof(q[0]));
}
if (eobs[3] > 1)
@ -62,7 +63,7 @@ void vp8_dequant_idct_add_y_block_mmx
{
vp8_dc_only_idct_add_mmx (q[48]*dq[0], dst+12, stride,
dst+12, stride);
((int *)(q+48))[0] = 0;
vpx_memset(q + 48, 0, 2 * sizeof(q[0]));
}
q += 64;
@ -84,7 +85,7 @@ void vp8_dequant_idct_add_uv_block_mmx
else if (eobs[0] == 1)
{
vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstu, stride, dstu, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
if (eobs[1] > 1)
@ -93,7 +94,7 @@ void vp8_dequant_idct_add_uv_block_mmx
{
vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstu+4, stride,
dstu+4, stride);
((int *)(q+16))[0] = 0;
vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
}
q += 32;
@ -108,7 +109,7 @@ void vp8_dequant_idct_add_uv_block_mmx
else if (eobs[0] == 1)
{
vp8_dc_only_idct_add_mmx (q[0]*dq[0], dstv, stride, dstv, stride);
((int *)q)[0] = 0;
vpx_memset(q, 0, 2 * sizeof(q[0]));
}
if (eobs[1] > 1)
@ -117,7 +118,7 @@ void vp8_dequant_idct_add_uv_block_mmx
{
vp8_dc_only_idct_add_mmx (q[16]*dq[0], dstv+4, stride,
dstv+4, stride);
((int *)(q+16))[0] = 0;
vpx_memset(q + 16, 0, 2 * sizeof(q[0]));
}
q += 32;

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
void vp8_idct_dequant_0_2x_sse2
(short *q, short *dq ,

View File

@ -24,7 +24,7 @@ sym(vp8_short_inv_walsh4x4_mmx):
movq mm0, [rdx + 0] ;ip[0]
movq mm1, [rdx + 8] ;ip[4]
movd mm7, rax
movq mm7, rax
movq mm2, [rdx + 16] ;ip[8]
movq mm3, [rdx + 24] ;ip[12]

View File

@ -136,7 +136,7 @@
global sym(vp8_loop_filter_bh_y_sse2) PRIVATE
sym(vp8_loop_filter_bh_y_sse2):
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
%define src rcx ; src_ptr
%define stride rdx ; src_pixel_step
%define blimit r8
@ -256,7 +256,7 @@ LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2
movdqa i12, xmm3
movdqa i13, xmm8
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
pop r13
pop r12
RESTORE_XMM
@ -278,7 +278,7 @@ LF_FILTER xmm0, xmm1, xmm3, xmm8, xmm4, xmm2
global sym(vp8_loop_filter_bv_y_sse2) PRIVATE
sym(vp8_loop_filter_bv_y_sse2):
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
%define src rcx ; src_ptr
%define stride rdx ; src_pixel_step
%define blimit r8
@ -779,7 +779,7 @@ LF_FILTER xmm0, xmm1, xmm4, xmm8, xmm3, xmm2
; un-ALIGN_STACK
pop rsp
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
pop r13
pop r12
RESTORE_XMM

View File

@ -271,7 +271,13 @@ sym(vp8_variance_and_sad_16x16_sse2):
SECTION_RODATA
align 16
t128:
%ifndef __NASM_VER__
ddq 128
%elif CONFIG_BIG_ENDIAN
dq 0, 128
%else
dq 128, 0
%endif
align 16
tMFQE: ; 1 << MFQE_PRECISION
times 8 dw 0x10

View File

@ -61,7 +61,7 @@ sym(vp8_mbpost_proc_down_mmx):
mov rcx, 8
.init_borderd ; initialize borders
lea rdi, [rdi + rax]
movq [rdi], xmm1
movq [rdi], mm1
dec rcx
jne .init_borderd
@ -193,7 +193,6 @@ sym(vp8_mbpost_proc_down_mmx):
movq mm4, [sym(vp8_rv) + rcx*2]
%endif
paddw mm1, mm4
;paddw xmm1, eight8s
psraw mm1, 4
packuswb mm1, mm0

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_mem/vpx_mem.h"
#include "vp8/common/blockd.h"

View File

@ -33,7 +33,7 @@
movsxd rax, dword ptr arg(1) ; src_stride
movsxd rdx, dword ptr arg(3) ; ref_stride
%else
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
SAVE_XMM 7, u
%define src_ptr rcx
%define src_stride rdx
@ -76,7 +76,7 @@
pop rsi
pop rbp
%else
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
RESTORE_XMM
%endif
%endif
@ -111,7 +111,7 @@
xchg rbx, rax
%else
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
SAVE_XMM 7, u
%define src_ptr rcx
%define src_stride rdx
@ -156,7 +156,7 @@
pop rsi
pop rbp
%else
%ifidn __OUTPUT_FORMAT__,x64
%if LIBVPX_YASM_WIN64
pop rsi
RESTORE_XMM
%endif

View File

@ -91,7 +91,7 @@ unsigned int vp8_variance4x4_mmx(
vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 4));
return (var - (((unsigned int)avg * avg) >> 4));
}
@ -108,7 +108,7 @@ unsigned int vp8_variance8x8_mmx(
vp8_get8x8var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 6));
return (var - (((unsigned int)avg * avg) >> 6));
}
@ -153,7 +153,7 @@ unsigned int vp8_variance16x16_mmx(
var = sse0 + sse1 + sse2 + sse3;
avg = sum0 + sum1 + sum2 + sum3;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 8));
return (var - (((unsigned int)avg * avg) >> 8));
}
unsigned int vp8_variance16x8_mmx(
@ -172,7 +172,7 @@ unsigned int vp8_variance16x8_mmx(
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
@ -194,7 +194,7 @@ unsigned int vp8_variance8x16_mmx(
avg = sum0 + sum1;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
@ -219,7 +219,7 @@ unsigned int vp8_sub_pixel_variance4x4_mmx
&xsum, &xxsum
);
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 4));
return (xxsum - (((unsigned int)xsum * xsum) >> 4));
}
@ -244,7 +244,7 @@ unsigned int vp8_sub_pixel_variance8x8_mmx
&xsum, &xxsum
);
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 6));
return (xxsum - (((unsigned int)xsum * xsum) >> 6));
}
unsigned int vp8_sub_pixel_variance16x16_mmx
@ -282,7 +282,7 @@ unsigned int vp8_sub_pixel_variance16x16_mmx
xxsum0 += xxsum1;
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}
@ -335,7 +335,7 @@ unsigned int vp8_sub_pixel_variance16x8_mmx
xxsum0 += xxsum1;
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 7));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7));
}
unsigned int vp8_sub_pixel_variance8x16_mmx
@ -358,7 +358,7 @@ unsigned int vp8_sub_pixel_variance8x16_mmx
&xsum, &xxsum
);
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 7));
return (xxsum - (((unsigned int)xsum * xsum) >> 7));
}

View File

@ -148,7 +148,7 @@ unsigned int vp8_variance4x4_wmt(
vp8_get4x4var_mmx(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 4));
return (var - (((unsigned int)avg * avg) >> 4));
}
@ -165,7 +165,7 @@ unsigned int vp8_variance8x8_wmt
vp8_get8x8var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &var, &avg) ;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 6));
return (var - (((unsigned int)avg * avg) >> 6));
}
@ -184,7 +184,7 @@ unsigned int vp8_variance16x16_wmt
vp8_get16x16var_sse2(src_ptr, source_stride, ref_ptr, recon_stride, &sse0, &sum0) ;
*sse = sse0;
return (sse0 - ((unsigned int)(sum0 * sum0) >> 8));
return (sse0 - (((unsigned int)sum0 * sum0) >> 8));
}
unsigned int vp8_mse16x16_wmt(
const unsigned char *src_ptr,
@ -220,7 +220,7 @@ unsigned int vp8_variance16x8_wmt
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
@ -241,7 +241,7 @@ unsigned int vp8_variance8x16_wmt
var = sse0 + sse1;
avg = sum0 + sum1;
*sse = var;
return (var - ((unsigned int)(avg * avg) >> 7));
return (var - (((unsigned int)avg * avg) >> 7));
}
@ -265,7 +265,7 @@ unsigned int vp8_sub_pixel_variance4x4_wmt
&xsum, &xxsum
);
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 4));
return (xxsum - (((unsigned int)xsum * xsum) >> 4));
}
@ -314,7 +314,7 @@ unsigned int vp8_sub_pixel_variance8x8_wmt
}
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 6));
return (xxsum - (((unsigned int)xsum * xsum) >> 6));
}
unsigned int vp8_sub_pixel_variance16x16_wmt
@ -376,7 +376,7 @@ unsigned int vp8_sub_pixel_variance16x16_wmt
}
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}
unsigned int vp8_sub_pixel_mse16x16_wmt(
@ -447,7 +447,7 @@ unsigned int vp8_sub_pixel_variance16x8_wmt
}
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 7));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7));
}
unsigned int vp8_sub_pixel_variance8x16_wmt
@ -495,7 +495,7 @@ unsigned int vp8_sub_pixel_variance8x16_wmt
}
*sse = xxsum;
return (xxsum - ((unsigned int)(xsum * xsum) >> 7));
return (xxsum - (((unsigned int)xsum * xsum) >> 7));
}
@ -515,7 +515,7 @@ unsigned int vp8_variance_halfpixvar16x16_h_wmt(
&xsum0, &xxsum0);
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}
@ -534,7 +534,7 @@ unsigned int vp8_variance_halfpixvar16x16_v_wmt(
&xsum0, &xxsum0);
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}
@ -554,5 +554,5 @@ unsigned int vp8_variance_halfpixvar16x16_hv_wmt(
&xsum0, &xxsum0);
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}

View File

@ -113,7 +113,7 @@ unsigned int vp8_sub_pixel_variance16x16_ssse3
}
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 8));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 8));
}
unsigned int vp8_sub_pixel_variance16x8_ssse3
@ -162,5 +162,5 @@ unsigned int vp8_sub_pixel_variance16x8_ssse3
}
*sse = xxsum0;
return (xxsum0 - ((unsigned int)(xsum0 * xsum0) >> 7));
return (xxsum0 - (((unsigned int)xsum0 * xsum0) >> 7));
}

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vpx_ports/mem.h"
#include "filter_x86.h"
@ -611,16 +611,12 @@ void vp8_sixtap_predict4x4_ssse3
for (r = 0; r < 4; r++)
{
#if !(CONFIG_FAST_UNALIGNED)
dst_ptr[0] = src_ptr[0];
dst_ptr[1] = src_ptr[1];
dst_ptr[2] = src_ptr[2];
dst_ptr[3] = src_ptr[3];
#else
*(uint32_t *)dst_ptr = *(uint32_t *)src_ptr ;
#endif
dst_ptr += dst_pitch;
src_ptr += src_pixels_per_line;
dst_ptr += dst_pitch;
src_ptr += src_pixels_per_line;
}
}
}

View File

@ -1,26 +0,0 @@
/*
* Copyright (c) 2011 The WebM project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "vpx_ports/asm_offsets.h"
#include "onyxd_int.h"
BEGIN
DEFINE(bool_decoder_user_buffer_end, offsetof(BOOL_DECODER, user_buffer_end));
DEFINE(bool_decoder_user_buffer, offsetof(BOOL_DECODER, user_buffer));
DEFINE(bool_decoder_value, offsetof(BOOL_DECODER, value));
DEFINE(bool_decoder_count, offsetof(BOOL_DECODER, count));
DEFINE(bool_decoder_range, offsetof(BOOL_DECODER, range));
END
/* add asserts for any offset that is not supported by assembly code */
/* add asserts for any size that is not supported by assembly code */

View File

@ -10,18 +10,20 @@
#include "dboolhuff.h"
#include "vpx_ports/mem.h"
#include "vpx_mem/vpx_mem.h"
int vp8dx_start_decode(BOOL_DECODER *br,
const unsigned char *source,
unsigned int source_sz)
unsigned int source_sz,
vp8_decrypt_cb *decrypt_cb,
void *decrypt_state)
{
br->user_buffer_end = source+source_sz;
br->user_buffer = source;
br->value = 0;
br->count = -8;
br->range = 255;
br->decrypt_cb = decrypt_cb;
br->decrypt_state = decrypt_state;
if (source_sz && !source)
return 1;
@ -32,21 +34,42 @@ int vp8dx_start_decode(BOOL_DECODER *br,
return 0;
}
void vp8dx_bool_decoder_fill(BOOL_DECODER *br)
{
const unsigned char *bufptr;
const unsigned char *bufend;
VP8_BD_VALUE value;
int count;
bufend = br->user_buffer_end;
bufptr = br->user_buffer;
value = br->value;
count = br->count;
const unsigned char *bufptr = br->user_buffer;
VP8_BD_VALUE value = br->value;
int count = br->count;
int shift = VP8_BD_VALUE_SIZE - 8 - (count + 8);
size_t bytes_left = br->user_buffer_end - bufptr;
size_t bits_left = bytes_left * CHAR_BIT;
int x = (int)(shift + CHAR_BIT - bits_left);
int loop_end = 0;
unsigned char decrypted[sizeof(VP8_BD_VALUE) + 1];
VP8DX_BOOL_DECODER_FILL(count, value, bufptr, bufend);
if (br->decrypt_cb) {
size_t n = bytes_left > sizeof(decrypted) ? sizeof(decrypted) : bytes_left;
br->decrypt_cb(br->decrypt_state, bufptr, decrypted, (int)n);
bufptr = decrypted;
}
if(x >= 0)
{
count += VP8_LOTS_OF_BITS;
loop_end = x;
}
if (x < 0 || bits_left)
{
while(shift >= loop_end)
{
count += CHAR_BIT;
value |= (VP8_BD_VALUE)*bufptr << shift;
++bufptr;
++br->user_buffer;
shift -= CHAR_BIT;
}
}
br->user_buffer = bufptr;
br->value = value;
br->count = count;
}

View File

@ -9,21 +9,30 @@
*/
#ifndef DBOOLHUFF_H
#define DBOOLHUFF_H
#ifndef DBOOLHUFF_H_
#define DBOOLHUFF_H_
#include <stddef.h>
#include <limits.h>
#include "vpx_config.h"
#include "vpx_ports/mem.h"
#include "vpx/vpx_integer.h"
typedef size_t VP8_BD_VALUE;
# define VP8_BD_VALUE_SIZE ((int)sizeof(VP8_BD_VALUE)*CHAR_BIT)
#define VP8_BD_VALUE_SIZE ((int)sizeof(VP8_BD_VALUE)*CHAR_BIT)
/*This is meant to be a large, positive constant that can still be efficiently
loaded as an immediate (on platforms like ARM, for example).
Even relatively modest values like 100 would work fine.*/
# define VP8_LOTS_OF_BITS (0x40000000)
#define VP8_LOTS_OF_BITS (0x40000000)
/*Decrypt n bytes of data from input -> output, using the decrypt_state
passed in VP8D_SET_DECRYPTOR.
*/
typedef void (vp8_decrypt_cb)(void *decrypt_state, const unsigned char *input,
unsigned char *output, int count);
typedef struct
{
@ -32,46 +41,20 @@ typedef struct
VP8_BD_VALUE value;
int count;
unsigned int range;
vp8_decrypt_cb *decrypt_cb;
void *decrypt_state;
} BOOL_DECODER;
DECLARE_ALIGNED(16, extern const unsigned char, vp8_norm[256]);
int vp8dx_start_decode(BOOL_DECODER *br,
const unsigned char *source,
unsigned int source_sz);
unsigned int source_sz,
vp8_decrypt_cb *decrypt_cb,
void *decrypt_state);
void vp8dx_bool_decoder_fill(BOOL_DECODER *br);
/*The refill loop is used in several places, so define it in a macro to make
sure they're all consistent.
An inline function would be cleaner, but has a significant penalty, because
multiple BOOL_DECODER fields must be modified, and the compiler is not smart
enough to eliminate the stores to those fields and the subsequent reloads
from them when inlining the function.*/
#define VP8DX_BOOL_DECODER_FILL(_count,_value,_bufptr,_bufend) \
do \
{ \
int shift = VP8_BD_VALUE_SIZE - 8 - ((_count) + 8); \
int loop_end, x; \
size_t bits_left = ((_bufend)-(_bufptr))*CHAR_BIT; \
\
x = (int)(shift + CHAR_BIT - bits_left); \
loop_end = 0; \
if(x >= 0) \
{ \
(_count) += VP8_LOTS_OF_BITS; \
loop_end = x; \
if(!bits_left) break; \
} \
while(shift >= loop_end) \
{ \
(_count) += CHAR_BIT; \
(_value) |= (VP8_BD_VALUE)*(_bufptr)++ << shift; \
shift -= CHAR_BIT; \
} \
} \
while(0) \
static int vp8dx_decode_bool(BOOL_DECODER *br, int probability) {
unsigned int bit = 0;
@ -151,4 +134,5 @@ static int vp8dx_bool_error(BOOL_DECODER *br)
/* No error. */
return 0;
}
#endif
#endif // DBOOLHUFF_H_

View File

@ -110,8 +110,8 @@ static int read_mvcomponent(vp8_reader *r, const MV_CONTEXT *mvc)
static void read_mv(vp8_reader *r, MV *mv, const MV_CONTEXT *mvc)
{
mv->row = (short)(read_mvcomponent(r, mvc) << 1);
mv->col = (short)(read_mvcomponent(r, ++mvc) << 1);
mv->row = (short)(read_mvcomponent(r, mvc) * 2);
mv->col = (short)(read_mvcomponent(r, ++mvc) * 2);
}
@ -292,9 +292,9 @@ static void decode_split_mv(vp8_reader *const bc, MODE_INFO *mi,
blockmv.as_int = 0;
if( vp8_read(bc, prob[2]) )
{
blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) << 1;
blockmv.as_mv.row = read_mvcomponent(bc, &mvc[0]) * 2;
blockmv.as_mv.row += best_mv.as_mv.row;
blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) << 1;
blockmv.as_mv.col = read_mvcomponent(bc, &mvc[1]) * 2;
blockmv.as_mv.col += best_mv.as_mv.col;
}
}
@ -512,15 +512,15 @@ static void read_mb_modes_mv(VP8D_COMP *pbi, MODE_INFO *mi, MB_MODE_INFO *mbmi)
else
{
mbmi->mode = NEARMV;
vp8_clamp_mv2(&near_mvs[CNT_NEAR], &pbi->mb);
mbmi->mv.as_int = near_mvs[CNT_NEAR].as_int;
vp8_clamp_mv2(&mbmi->mv, &pbi->mb);
}
}
else
{
mbmi->mode = NEARESTMV;
vp8_clamp_mv2(&near_mvs[CNT_NEAREST], &pbi->mb);
mbmi->mv.as_int = near_mvs[CNT_NEAREST].as_int;
vp8_clamp_mv2(&mbmi->mv, &pbi->mb);
}
}
else

View File

@ -8,7 +8,11 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef DECODEMV_H_
#define DECODEMV_H_
#include "onyxd_int.h"
void vp8_decode_mode_mvs(VP8D_COMP *);
#endif // DECODEMV_H_

View File

@ -8,19 +8,15 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef _DECODER_THREADING_H
#define _DECODER_THREADING_H
#ifndef DECODERTHREADING_H_
#define DECODERTHREADING_H_
#if CONFIG_MULTITHREAD
extern void vp8mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd);
extern void vp8_decoder_remove_threads(VP8D_COMP *pbi);
extern void vp8_decoder_create_threads(VP8D_COMP *pbi);
extern void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows);
extern void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows);
void vp8mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd);
void vp8_decoder_remove_threads(VP8D_COMP *pbi);
void vp8_decoder_create_threads(VP8D_COMP *pbi);
void vp8mt_alloc_temp_buffers(VP8D_COMP *pbi, int width, int prev_mb_rows);
void vp8mt_de_alloc_temp_buffers(VP8D_COMP *pbi, int mb_rows);
#endif
#endif
#endif // DECODERTHREADING_H_

View File

@ -10,7 +10,8 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "./vpx_scale_rtcd.h"
#include "onyxd_int.h"
#include "vp8/common/header.h"
#include "vp8/common/reconintra4x4.h"
@ -20,7 +21,7 @@
#include "vp8/common/alloccommon.h"
#include "vp8/common/entropymode.h"
#include "vp8/common/quant_common.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/setupintrarecon.h"
#include "decodemv.h"
@ -210,7 +211,7 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
(b->qcoeff[0] * DQC[0],
dst, dst_stride,
dst, dst_stride);
((int *)b->qcoeff)[0] = 0;
vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0]));
}
}
}
@ -247,21 +248,14 @@ static void decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
vp8_short_inv_walsh4x4(&b->dqcoeff[0],
xd->qcoeff);
((int *)b->qcoeff)[0] = 0;
((int *)b->qcoeff)[1] = 0;
((int *)b->qcoeff)[2] = 0;
((int *)b->qcoeff)[3] = 0;
((int *)b->qcoeff)[4] = 0;
((int *)b->qcoeff)[5] = 0;
((int *)b->qcoeff)[6] = 0;
((int *)b->qcoeff)[7] = 0;
vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0]));
}
else
{
b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0];
vp8_short_inv_walsh4x4_1(&b->dqcoeff[0],
xd->qcoeff);
((int *)b->qcoeff)[0] = 0;
vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0]));
}
/* override the dc dequant constant in order to preserve the
@ -575,7 +569,7 @@ static void decode_mb_rows(VP8D_COMP *pbi)
xd->left_available = 0;
xd->mb_to_top_edge = -((mb_row * 16)) << 3;
xd->mb_to_top_edge = -((mb_row * 16) << 3);
xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3;
xd->recon_above[0] = dst_buffer[0] + recon_yoffset;
@ -758,11 +752,16 @@ static void decode_mb_rows(VP8D_COMP *pbi)
}
static unsigned int read_partition_size(const unsigned char *cx_size)
static unsigned int read_partition_size(VP8D_COMP *pbi,
const unsigned char *cx_size)
{
const unsigned int size =
cx_size[0] + (cx_size[1] << 8) + (cx_size[2] << 16);
return size;
unsigned char temp[3];
if (pbi->decrypt_cb)
{
pbi->decrypt_cb(pbi->decrypt_state, cx_size, temp, 3);
cx_size = temp;
}
return cx_size[0] + (cx_size[1] << 8) + (cx_size[2] << 16);
}
static int read_is_valid(const unsigned char *start,
@ -793,7 +792,7 @@ static unsigned int read_available_partition_size(
if (i < num_part - 1)
{
if (read_is_valid(partition_size_ptr, 3, first_fragment_end))
partition_size = read_partition_size(partition_size_ptr);
partition_size = read_partition_size(pbi, partition_size_ptr);
else if (pbi->ec_active)
partition_size = (unsigned int)bytes_left;
else
@ -827,8 +826,8 @@ static void setup_token_decoder(VP8D_COMP *pbi,
unsigned int partition_idx;
unsigned int fragment_idx;
unsigned int num_token_partitions;
const unsigned char *first_fragment_end = pbi->fragments[0] +
pbi->fragment_sizes[0];
const unsigned char *first_fragment_end = pbi->fragments.ptrs[0] +
pbi->fragments.sizes[0];
TOKEN_PARTITION multi_token_partition =
(TOKEN_PARTITION)vp8_read_literal(&pbi->mbc[8], 2);
@ -838,10 +837,10 @@ static void setup_token_decoder(VP8D_COMP *pbi,
/* Check for partitions within the fragments and unpack the fragments
* so that each fragment pointer points to its corresponding partition. */
for (fragment_idx = 0; fragment_idx < pbi->num_fragments; ++fragment_idx)
for (fragment_idx = 0; fragment_idx < pbi->fragments.count; ++fragment_idx)
{
unsigned int fragment_size = pbi->fragment_sizes[fragment_idx];
const unsigned char *fragment_end = pbi->fragments[fragment_idx] +
unsigned int fragment_size = pbi->fragments.sizes[fragment_idx];
const unsigned char *fragment_end = pbi->fragments.ptrs[fragment_idx] +
fragment_size;
/* Special case for handling the first partition since we have already
* read its size. */
@ -849,16 +848,16 @@ static void setup_token_decoder(VP8D_COMP *pbi,
{
/* Size of first partition + token partition sizes element */
ptrdiff_t ext_first_part_size = token_part_sizes -
pbi->fragments[0] + 3 * (num_token_partitions - 1);
pbi->fragments.ptrs[0] + 3 * (num_token_partitions - 1);
fragment_size -= (unsigned int)ext_first_part_size;
if (fragment_size > 0)
{
pbi->fragment_sizes[0] = (unsigned int)ext_first_part_size;
pbi->fragments.sizes[0] = (unsigned int)ext_first_part_size;
/* The fragment contains an additional partition. Move to
* next. */
fragment_idx++;
pbi->fragments[fragment_idx] = pbi->fragments[0] +
pbi->fragment_sizes[0];
pbi->fragments.ptrs[fragment_idx] = pbi->fragments.ptrs[0] +
pbi->fragments.sizes[0];
}
}
/* Split the chunk into partitions read from the bitstream */
@ -867,12 +866,12 @@ static void setup_token_decoder(VP8D_COMP *pbi,
ptrdiff_t partition_size = read_available_partition_size(
pbi,
token_part_sizes,
pbi->fragments[fragment_idx],
pbi->fragments.ptrs[fragment_idx],
first_fragment_end,
fragment_end,
fragment_idx - 1,
num_token_partitions);
pbi->fragment_sizes[fragment_idx] = (unsigned int)partition_size;
pbi->fragments.sizes[fragment_idx] = (unsigned int)partition_size;
fragment_size -= (unsigned int)partition_size;
assert(fragment_idx <= num_token_partitions);
if (fragment_size > 0)
@ -880,19 +879,20 @@ static void setup_token_decoder(VP8D_COMP *pbi,
/* The fragment contains an additional partition.
* Move to next. */
fragment_idx++;
pbi->fragments[fragment_idx] =
pbi->fragments[fragment_idx - 1] + partition_size;
pbi->fragments.ptrs[fragment_idx] =
pbi->fragments.ptrs[fragment_idx - 1] + partition_size;
}
}
}
pbi->num_fragments = num_token_partitions + 1;
pbi->fragments.count = num_token_partitions + 1;
for (partition_idx = 1; partition_idx < pbi->num_fragments; ++partition_idx)
for (partition_idx = 1; partition_idx < pbi->fragments.count; ++partition_idx)
{
if (vp8dx_start_decode(bool_decoder,
pbi->fragments[partition_idx],
pbi->fragment_sizes[partition_idx]))
pbi->fragments.ptrs[partition_idx],
pbi->fragments.sizes[partition_idx],
pbi->decrypt_cb, pbi->decrypt_state))
vpx_internal_error(&pbi->common.error, VPX_CODEC_MEM_ERROR,
"Failed to allocate bool decoder %d",
partition_idx);
@ -979,11 +979,11 @@ static void init_frame(VP8D_COMP *pbi)
int vp8_decode_frame(VP8D_COMP *pbi)
{
vp8_reader *const bc = & pbi->mbc[8];
VP8_COMMON *const pc = & pbi->common;
MACROBLOCKD *const xd = & pbi->mb;
const unsigned char *data = pbi->fragments[0];
const unsigned char *data_end = data + pbi->fragment_sizes[0];
vp8_reader *const bc = &pbi->mbc[8];
VP8_COMMON *const pc = &pbi->common;
MACROBLOCKD *const xd = &pbi->mb;
const unsigned char *data = pbi->fragments.ptrs[0];
const unsigned char *data_end = data + pbi->fragments.sizes[0];
ptrdiff_t first_partition_length_in_bytes;
int i, j, k, l;
@ -1015,18 +1015,30 @@ int vp8_decode_frame(VP8D_COMP *pbi)
}
else
{
pc->frame_type = (FRAME_TYPE)(data[0] & 1);
pc->version = (data[0] >> 1) & 7;
pc->show_frame = (data[0] >> 4) & 1;
first_partition_length_in_bytes =
(data[0] | (data[1] << 8) | (data[2] << 16)) >> 5;
unsigned char clear_buffer[10];
const unsigned char *clear = data;
if (pbi->decrypt_cb)
{
int n = (int)(data_end - data);
if (n > 10) n = 10;
pbi->decrypt_cb(pbi->decrypt_state, data, clear_buffer, n);
clear = clear_buffer;
}
if (!pbi->ec_active && (data + first_partition_length_in_bytes > data_end
pc->frame_type = (FRAME_TYPE)(clear[0] & 1);
pc->version = (clear[0] >> 1) & 7;
pc->show_frame = (clear[0] >> 4) & 1;
first_partition_length_in_bytes =
(clear[0] | (clear[1] << 8) | (clear[2] << 16)) >> 5;
if (!pbi->ec_active &&
(data + first_partition_length_in_bytes > data_end
|| data + first_partition_length_in_bytes < data))
vpx_internal_error(&pc->error, VPX_CODEC_CORRUPT_FRAME,
"Truncated packet or corrupt partition 0 length");
data += 3;
clear += 3;
vp8_setup_version(pc);
@ -1039,7 +1051,7 @@ int vp8_decode_frame(VP8D_COMP *pbi)
*/
if (!pbi->ec_active || data + 3 < data_end)
{
if (data[0] != 0x9d || data[1] != 0x01 || data[2] != 0x2a)
if (clear[0] != 0x9d || clear[1] != 0x01 || clear[2] != 0x2a)
vpx_internal_error(&pc->error, VPX_CODEC_UNSUP_BITSTREAM,
"Invalid frame sync code");
}
@ -1050,13 +1062,13 @@ int vp8_decode_frame(VP8D_COMP *pbi)
*/
if (!pbi->ec_active || data + 6 < data_end)
{
pc->Width = (data[3] | (data[4] << 8)) & 0x3fff;
pc->horiz_scale = data[4] >> 6;
pc->Height = (data[5] | (data[6] << 8)) & 0x3fff;
pc->vert_scale = data[6] >> 6;
pc->Width = (clear[3] | (clear[4] << 8)) & 0x3fff;
pc->horiz_scale = clear[4] >> 6;
pc->Height = (clear[5] | (clear[6] << 8)) & 0x3fff;
pc->vert_scale = clear[6] >> 6;
}
data += 7;
clear += 7;
}
else
{
@ -1071,11 +1083,12 @@ int vp8_decode_frame(VP8D_COMP *pbi)
init_frame(pbi);
if (vp8dx_start_decode(bc, data, (unsigned int)(data_end - data)))
if (vp8dx_start_decode(bc, data, (unsigned int)(data_end - data),
pbi->decrypt_cb, pbi->decrypt_state))
vpx_internal_error(&pc->error, VPX_CODEC_MEM_ERROR,
"Failed to allocate bool decoder 0");
if (pc->frame_type == KEY_FRAME) {
pc->clr_type = (YUV_TYPE)vp8_read_bit(bc);
(void)vp8_read_bit(bc); // colorspace
pc->clamp_type = (CLAMP_TYPE)vp8_read_bit(bc);
}
@ -1334,11 +1347,11 @@ int vp8_decode_frame(VP8D_COMP *pbi)
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd && pc->multi_token_partition != ONE_PARTITION)
{
unsigned int i;
unsigned int thread;
vp8mt_decode_mb_rows(pbi, xd);
vp8_yv12_extend_frame_borders(yv12_fb_new);
for (i = 0; i < pbi->decoding_thread_count; ++i)
corrupt_tokens |= pbi->mb_row_di[i].mbd.corrupted;
for (thread = 0; thread < pbi->decoding_thread_count; ++thread)
corrupt_tokens |= pbi->mb_row_di[thread].mbd.corrupted;
}
else
#endif

View File

@ -8,13 +8,12 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef DETOKENIZE_H
#define DETOKENIZE_H
#ifndef DETOKENIZE_H_
#define DETOKENIZE_H_
#include "onyxd_int.h"
void vp8_reset_mb_tokens_context(MACROBLOCKD *x);
int vp8_decode_mb_tokens(VP8D_COMP *, MACROBLOCKD *);
#endif /* DETOKENIZE_H */
#endif // DETOKENIZE_H

View File

@ -14,7 +14,6 @@
#define MAX_OVERLAPS 16
/* The area (pixel area in Q6) the block pointed to by bmi overlaps
* another block with.
*/
@ -48,4 +47,4 @@ typedef struct
MV_REFERENCE_FRAME ref_frame;
} EC_BLOCK;
#endif /* VP8_DEC_EC_TYPES_H */
#endif // VP8_DEC_EC_TYPES_H

View File

@ -8,14 +8,14 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include <assert.h>
#include "error_concealment.h"
#include "onyxd_int.h"
#include "decodemv.h"
#include "vpx_mem/vpx_mem.h"
#include "vp8/common/findnearmv.h"
#include <assert.h>
#define MIN(x,y) (((x)<(y))?(x):(y))
#define MAX(x,y) (((x)>(y))?(x):(y))

View File

@ -9,8 +9,8 @@
*/
#ifndef ERROR_CONCEALMENT_H
#define ERROR_CONCEALMENT_H
#ifndef ERROR_CONCEALMENT_H_
#define ERROR_CONCEALMENT_H_
#include "onyxd_int.h"
#include "ec_types.h"
@ -38,4 +38,4 @@ void vp8_interpolate_motion(MACROBLOCKD *mb,
*/
void vp8_conceal_corrupt_mb(MACROBLOCKD *xd);
#endif
#endif // ERROR_CONCEALMENT_H_

View File

@ -25,7 +25,8 @@
#include <assert.h>
#include "vp8/common/quant_common.h"
#include "vpx_scale/vpxscale.h"
#include "./vpx_scale_rtcd.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/systemdependent.h"
#include "vpx_ports/vpx_timer.h"
#include "detokenize.h"
@ -41,7 +42,16 @@ extern void vp8cx_init_de_quantizer(VP8D_COMP *pbi);
static int get_free_fb (VP8_COMMON *cm);
static void ref_cnt_fb (int *buf, int *idx, int new_idx);
struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
static void remove_decompressor(VP8D_COMP *pbi)
{
#if CONFIG_ERROR_CONCEALMENT
vp8_de_alloc_overlap_lists(pbi);
#endif
vp8_remove_common(&pbi->common);
vpx_free(pbi);
}
static struct VP8D_COMP * create_decompressor(VP8D_CONFIG *oxcf)
{
VP8D_COMP *pbi = vpx_memalign(32, sizeof(VP8D_COMP));
@ -53,7 +63,7 @@ struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
if (setjmp(pbi->common.error.jmp))
{
pbi->common.error.setjmp = 0;
vp8dx_remove_decompressor(pbi);
remove_decompressor(pbi);
return 0;
}
@ -64,11 +74,6 @@ struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
pbi->common.current_video_frame = 0;
pbi->ready_for_new_data = 1;
#if CONFIG_MULTITHREAD
pbi->max_threads = oxcf->max_threads;
vp8_decoder_create_threads(pbi);
#endif
/* vp8cx_init_de_quantizer() is first called here. Add check in frame_init_dequantizer() to avoid
* unnecessary calling of vp8cx_init_de_quantizer() for every frame.
*/
@ -91,9 +96,6 @@ struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
pbi->decoded_key_frame = 0;
pbi->input_fragments = oxcf->input_fragments;
pbi->num_fragments = 0;
/* Independent partitions is activated when a frame updates the
* token probability table to have equal probabilities over the
* PREV_COEF context.
@ -105,25 +107,6 @@ struct VP8D_COMP * vp8dx_create_decompressor(VP8D_CONFIG *oxcf)
return pbi;
}
void vp8dx_remove_decompressor(VP8D_COMP *pbi)
{
if (!pbi)
return;
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd)
vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows);
vp8_decoder_remove_threads(pbi);
#endif
#if CONFIG_ERROR_CONCEALMENT
vp8_de_alloc_overlap_lists(pbi);
#endif
vp8_remove_common(&pbi->common);
vpx_free(pbi);
}
vpx_codec_err_t vp8dx_get_reference(VP8D_COMP *pbi, enum vpx_ref_frame_type ref_frame_flag, YV12_BUFFER_CONFIG *sd)
{
VP8_COMMON *cm = &pbi->common;
@ -281,60 +264,13 @@ static int swap_frame_buffers (VP8_COMMON *cm)
return err;
}
int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size,
const uint8_t *source,
int64_t time_stamp)
int check_fragments_for_errors(VP8D_COMP *pbi)
{
#if HAVE_NEON
int64_t dx_store_reg[8];
#endif
VP8_COMMON *cm = &pbi->common;
int retcode = -1;
pbi->common.error.error_code = VPX_CODEC_OK;
if (pbi->num_fragments == 0)
{
/* New frame, reset fragment pointers and sizes */
vpx_memset((void*)pbi->fragments, 0, sizeof(pbi->fragments));
vpx_memset(pbi->fragment_sizes, 0, sizeof(pbi->fragment_sizes));
}
if (pbi->input_fragments && !(source == NULL && size == 0))
{
/* Store a pointer to this fragment and return. We haven't
* received the complete frame yet, so we will wait with decoding.
*/
assert(pbi->num_fragments < MAX_PARTITIONS);
pbi->fragments[pbi->num_fragments] = source;
pbi->fragment_sizes[pbi->num_fragments] = size;
pbi->num_fragments++;
if (pbi->num_fragments > (1 << EIGHT_PARTITION) + 1)
{
pbi->common.error.error_code = VPX_CODEC_UNSUP_BITSTREAM;
pbi->common.error.setjmp = 0;
pbi->num_fragments = 0;
return -1;
}
return 0;
}
if (!pbi->input_fragments)
{
pbi->fragments[0] = source;
pbi->fragment_sizes[0] = size;
pbi->num_fragments = 1;
}
assert(pbi->common.multi_token_partition <= EIGHT_PARTITION);
if (pbi->num_fragments == 0)
{
pbi->num_fragments = 1;
pbi->fragments[0] = NULL;
pbi->fragment_sizes[0] = 0;
}
if (!pbi->ec_active &&
pbi->num_fragments <= 1 && pbi->fragment_sizes[0] == 0)
pbi->fragments.count <= 1 && pbi->fragments.sizes[0] == 0)
{
VP8_COMMON *cm = &pbi->common;
/* If error concealment is disabled we won't signal missing frames
* to the decoder.
*/
@ -360,12 +296,29 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size,
/* Signal that we have no frame to show. */
cm->show_frame = 0;
pbi->num_fragments = 0;
/* Nothing more to do. */
return 0;
}
return 1;
}
int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size,
const uint8_t *source,
int64_t time_stamp)
{
#if HAVE_NEON
int64_t dx_store_reg[8];
#endif
VP8_COMMON *cm = &pbi->common;
int retcode = -1;
pbi->common.error.error_code = VPX_CODEC_OK;
retcode = check_fragments_for_errors(pbi);
if(retcode <= 0)
return retcode;
#if HAVE_NEON
#if CONFIG_RUNTIME_CPU_DETECT
if (cm->cpu_caps & HAS_NEON)
@ -418,7 +371,13 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size,
vp8_clear_system_state();
#if CONFIG_ERROR_CONCEALMENT
if (cm->show_frame)
{
cm->current_video_frame++;
cm->show_frame_mi = cm->mi;
}
#if CONFIG_ERROR_CONCEALMENT
/* swap the mode infos to storage for future error concealment */
if (pbi->ec_enabled && pbi->common.prev_mi)
{
@ -440,9 +399,6 @@ int vp8dx_receive_compressed_data(VP8D_COMP *pbi, size_t size,
}
#endif
if (cm->show_frame)
cm->current_video_frame++;
pbi->ready_for_new_data = 0;
pbi->last_time_stamp = time_stamp;
@ -457,7 +413,6 @@ decode_exit:
#endif
pbi->common.error.setjmp = 0;
pbi->num_fragments = 0;
return retcode;
}
int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_stamp, int64_t *time_end_stamp, vp8_ppflags_t *flags)
@ -475,7 +430,6 @@ int vp8dx_get_raw_frame(VP8D_COMP *pbi, YV12_BUFFER_CONFIG *sd, int64_t *time_st
*time_stamp = pbi->last_time_stamp;
*time_end_stamp = 0;
sd->clrtype = pbi->common.clr_type;
#if CONFIG_POSTPROC
ret = vp8_post_proc_frame(&pbi->common, sd, flags);
#else
@ -520,3 +474,54 @@ int vp8dx_references_buffer( VP8_COMMON *oci, int ref_frame )
return 0;
}
int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf)
{
if(!fb->use_frame_threads)
{
/* decoder instance for single thread mode */
fb->pbi[0] = create_decompressor(oxcf);
if(!fb->pbi[0])
return VPX_CODEC_ERROR;
#if CONFIG_MULTITHREAD
/* enable row-based threading only when use_frame_threads
* is disabled */
fb->pbi[0]->max_threads = oxcf->max_threads;
vp8_decoder_create_threads(fb->pbi[0]);
#endif
}
else
{
/* TODO : create frame threads and decoder instances for each
* thread here */
}
return VPX_CODEC_OK;
}
int vp8_remove_decoder_instances(struct frame_buffers *fb)
{
if(!fb->use_frame_threads)
{
VP8D_COMP *pbi = fb->pbi[0];
if (!pbi)
return VPX_CODEC_ERROR;
#if CONFIG_MULTITHREAD
if (pbi->b_multithreaded_rd)
vp8mt_de_alloc_temp_buffers(pbi, pbi->common.mb_rows);
vp8_decoder_remove_threads(pbi);
#endif
/* decoder instance for single thread mode */
remove_decompressor(pbi);
}
else
{
/* TODO : remove frame threads and decoder instances for each
* thread here */
}
return VPX_CODEC_OK;
}

View File

@ -9,8 +9,9 @@
*/
#ifndef __INC_VP8D_INT_H
#define __INC_VP8D_INT_H
#ifndef ONYXD_INT_H_
#define ONYXD_INT_H_
#include "vpx_config.h"
#include "vp8/common/onyxd.h"
#include "treereader.h"
@ -33,6 +34,31 @@ typedef struct
MACROBLOCKD mbd;
} MB_ROW_DEC;
typedef struct
{
int enabled;
unsigned int count;
const unsigned char *ptrs[MAX_PARTITIONS];
unsigned int sizes[MAX_PARTITIONS];
} FRAGMENT_DATA;
#define MAX_FB_MT_DEC 32
struct frame_buffers
{
/*
* this struct will be populated with frame buffer management
* info in future commits. */
/* enable/disable frame-based threading */
int use_frame_threads;
/* decoder instances */
struct VP8D_COMP *pbi[MAX_FB_MT_DEC];
};
typedef struct VP8D_COMP
{
DECLARE_ALIGNED(16, MACROBLOCKD, mb);
@ -46,10 +72,7 @@ typedef struct VP8D_COMP
VP8D_CONFIG oxcf;
const unsigned char *fragments[MAX_PARTITIONS];
unsigned int fragment_sizes[MAX_PARTITIONS];
unsigned int num_fragments;
FRAGMENT_DATA fragments;
#if CONFIG_MULTITHREAD
/* variable for threading */
@ -95,15 +118,19 @@ typedef struct VP8D_COMP
#endif
int ec_enabled;
int ec_active;
int input_fragments;
int decoded_key_frame;
int independent_partitions;
int frame_corrupt_residual;
vp8_decrypt_cb *decrypt_cb;
void *decrypt_state;
} VP8D_COMP;
int vp8_decode_frame(VP8D_COMP *cpi);
int vp8_create_decoder_instances(struct frame_buffers *fb, VP8D_CONFIG *oxcf);
int vp8_remove_decoder_instances(struct frame_buffers *fb);
#if CONFIG_DEBUG
#define CHECK_MEM_ERROR(lval,expr) do {\
lval = (expr); \
@ -121,4 +148,4 @@ int vp8_decode_frame(VP8D_COMP *cpi);
} while(0)
#endif
#endif
#endif // ONYXD_INT_H_

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#if !defined(WIN32) && CONFIG_OS_SUPPORT == 1
# include <unistd.h>
#endif
@ -36,7 +36,7 @@
} while (0)
extern void vp8_mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd);
void vp8_mb_init_dequantizer(VP8D_COMP *pbi, MACROBLOCKD *xd);
static void setup_decoding_thread_data(VP8D_COMP *pbi, MACROBLOCKD *xd, MB_ROW_DEC *mbrd, int count)
{
@ -227,7 +227,7 @@ static void mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
{
vp8_dc_only_idct_add(b->qcoeff[0] * DQC[0],
dst, dst_stride, dst, dst_stride);
((int *)b->qcoeff)[0] = 0;
vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0]));
}
}
}
@ -264,21 +264,14 @@ static void mt_decode_macroblock(VP8D_COMP *pbi, MACROBLOCKD *xd,
vp8_short_inv_walsh4x4(&b->dqcoeff[0],
xd->qcoeff);
((int *)b->qcoeff)[0] = 0;
((int *)b->qcoeff)[1] = 0;
((int *)b->qcoeff)[2] = 0;
((int *)b->qcoeff)[3] = 0;
((int *)b->qcoeff)[4] = 0;
((int *)b->qcoeff)[5] = 0;
((int *)b->qcoeff)[6] = 0;
((int *)b->qcoeff)[7] = 0;
vpx_memset(b->qcoeff, 0, 16 * sizeof(b->qcoeff[0]));
}
else
{
b->dqcoeff[0] = b->qcoeff[0] * xd->dequant_y2[0];
vp8_short_inv_walsh4x4_1(&b->dqcoeff[0],
xd->qcoeff);
((int *)b->qcoeff)[0] = 0;
vpx_memset(b->qcoeff, 0, 2 * sizeof(b->qcoeff[0]));
}
/* override the dc dequant constant in order to preserve the
@ -343,7 +336,6 @@ static void mt_decode_mb_rows(VP8D_COMP *pbi, MACROBLOCKD *xd, int start_mb_row)
for (mb_row = start_mb_row; mb_row < pc->mb_rows; mb_row += (pbi->decoding_thread_count + 1))
{
int i;
int recon_yoffset, recon_uvoffset;
int mb_col;
int filter_level;

View File

@ -9,18 +9,17 @@
*/
#ifndef tree_reader_h
#define tree_reader_h 1
#ifndef TREEREADER_H_
#define TREEREADER_H_
#include "vp8/common/treecoder.h"
#include "dboolhuff.h"
typedef BOOL_DECODER vp8_reader;
#define vp8_read vp8dx_decode_bool
#define vp8_read_literal vp8_decode_value
#define vp8_read_bit( R) vp8_read( R, vp8_prob_half)
#define vp8_read_bit(R) vp8_read(R, vp8_prob_half)
/* Intent of tree data structure is to make decoding trivial. */
@ -38,4 +37,4 @@ static int vp8_treed_read(
return -i;
}
#endif /* tree_reader_h */
#endif // TREEREADER_H_

View File

@ -15,7 +15,7 @@
EXPORT |vp8_encode_value|
IMPORT |vp8_validate_buffer_arm|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -12,7 +12,7 @@
EXPORT |vp8cx_pack_tokens_armv5|
IMPORT |vp8_validate_buffer_arm|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -12,7 +12,7 @@
EXPORT |vp8cx_pack_mb_row_tokens_armv5|
IMPORT |vp8_validate_buffer_arm|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -12,7 +12,7 @@
EXPORT |vp8cx_pack_tokens_into_partitions_armv5|
IMPORT |vp8_validate_buffer_arm|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -11,7 +11,7 @@
EXPORT |vp8_fast_quantize_b_armv6|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -13,7 +13,7 @@
EXPORT |vp8_subtract_mbuv_armv6|
EXPORT |vp8_subtract_b_armv6|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -9,7 +9,7 @@
*/
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#if HAVE_MEDIA

View File

@ -12,7 +12,7 @@
EXPORT |vp8_fast_quantize_b_neon|
EXPORT |vp8_fast_quantize_b_pair_neon|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -97,7 +97,7 @@ coeff
vmlal.s16 q11, d6, d17 ; c1*2217 + d1*5352 + 12000
vmlsl.s16 q12, d6, d16 ; d1*2217 - c1*5352 + 51000
vmvn.s16 d4, d4
vmvn d4, d4
vshrn.s32 d1, q11, #16 ; op[4] = (c1*2217 + d1*5352 + 12000)>>16
vsub.s16 d1, d1, d4 ; op[4] += (d1!=0)
vshrn.s32 d3, q12, #16 ; op[12]= (d1*2217 - c1*5352 + 51000)>>16
@ -200,7 +200,7 @@ coeff
vmlal.s16 q11, d27, d17 ; B[4] = c1*2217 + d1*5352 + 12000
vmlsl.s16 q12, d27, d16 ; B[12] = d1*2217 - c1*5352 + 51000
vmvn.s16 q14, q14
vmvn q14, q14
vshrn.s32 d1, q9, #16 ; A[4] = (c1*2217 + d1*5352 + 12000)>>16
vshrn.s32 d3, q10, #16 ; A[12]= (d1*2217 - c1*5352 + 51000)>>16

View File

@ -12,7 +12,7 @@
EXPORT |vp8_subtract_mby_neon|
EXPORT |vp8_subtract_mbuv_neon|
INCLUDE asm_enc_offsets.asm
INCLUDE vp8_asm_enc_offsets.asm
ARM
REQUIRE8

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "vp8/encoder/block.h"
#include <math.h>
#include "vpx_mem/vpx_mem.h"

View File

@ -50,7 +50,7 @@ const int vp8cx_base_skip_false_prob[128] =
unsigned __int64 Sectionbits[500];
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
int intra_mode_stats[10][10][10];
static unsigned int tree_update_hist [BLOCK_TYPES] [COEF_BANDS] [PREV_COEF_CONTEXTS] [ENTROPY_NODES] [2];
extern unsigned int active_section;
@ -90,17 +90,17 @@ static void update_mode(
if (new_b + (n << 8) < old_b)
{
int i = 0;
int j = 0;
vp8_write_bit(w, 1);
do
{
const vp8_prob p = Pnew[i];
const vp8_prob p = Pnew[j];
vp8_write_literal(w, Pcur[i] = p ? p : 1, 8);
vp8_write_literal(w, Pcur[j] = p ? p : 1, 8);
}
while (++i < n);
while (++j < n);
}
else
vp8_write_bit(w, 0);
@ -245,15 +245,15 @@ void vp8_pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount)
if (L)
{
const unsigned char *pp = b->prob;
int v = e >> 1;
int n = L; /* number of bits in v, assumed nonzero */
int i = 0;
const unsigned char *proba = b->prob;
const int v2 = e >> 1;
int n2 = L; /* number of bits in v2, assumed nonzero */
i = 0;
do
{
const int bb = (v >> --n) & 1;
split = 1 + (((range - 1) * pp[i>>1]) >> 8);
const int bb = (v2 >> --n2) & 1;
split = 1 + (((range - 1) * proba[i>>1]) >> 8);
i = b->tree[i+bb];
if (bb)
@ -301,7 +301,7 @@ void vp8_pack_tokens_c(vp8_writer *w, const TOKENEXTRA *p, int xcount)
lowvalue <<= shift;
}
while (n);
while (n2);
}
@ -432,7 +432,7 @@ static void write_mv_ref
assert(NEARESTMV <= m && m <= SPLITMV);
#endif
vp8_write_token(w, vp8_mv_ref_tree, p,
vp8_mv_ref_encoding_array - NEARESTMV + m);
vp8_mv_ref_encoding_array + (m - NEARESTMV));
}
static void write_sub_mv_ref
@ -444,7 +444,7 @@ static void write_sub_mv_ref
assert(LEFT4X4 <= m && m <= NEW4X4);
#endif
vp8_write_token(w, vp8_sub_mv_ref_tree, p,
vp8_sub_mv_ref_encoding_array - LEFT4X4 + m);
vp8_sub_mv_ref_encoding_array + (m - LEFT4X4));
}
static void write_mv
@ -531,7 +531,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
vp8_convert_rfct_to_prob(cpi);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 1;
#endif
@ -577,10 +577,10 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
*/
xd->mb_to_left_edge = -((mb_col * 16) << 3);
xd->mb_to_right_edge = ((pc->mb_cols - 1 - mb_col) * 16) << 3;
xd->mb_to_top_edge = -((mb_row * 16)) << 3;
xd->mb_to_top_edge = -((mb_row * 16) << 3);
xd->mb_to_bottom_edge = ((pc->mb_rows - 1 - mb_row) * 16) << 3;
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 9;
#endif
@ -593,7 +593,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
if (rf == INTRA_FRAME)
{
vp8_write(w, 0, cpi->prob_intra_coded);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 6;
#endif
write_ymode(w, mode, pc->fc.ymode_prob);
@ -633,13 +633,13 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
vp8_mv_ref_probs(mv_ref_p, ct);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
accum_mv_refs(mode, ct);
#endif
}
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 3;
#endif
@ -649,7 +649,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
{
case NEWMV:
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 5;
#endif
@ -692,7 +692,7 @@ static void pack_inter_mode_mvs(VP8_COMP *const cpi)
if (blockmode == NEW4X4)
{
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 11;
#endif
write_mv(w, &blockmv.as_mv, &best_mv, (const MV_CONTEXT *) mvc);
@ -769,7 +769,7 @@ static void write_kfmodes(VP8_COMP *cpi)
const B_PREDICTION_MODE L = left_block_mode(m, i);
const int bm = m->bmi[i].as_mode;
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
++intra_mode_stats [A] [L] [bm];
#endif
@ -980,6 +980,12 @@ void vp8_calc_ref_frame_costs(int *ref_frame_cost,
int prob_garf
)
{
assert(prob_intra >= 0);
assert(prob_intra <= 255);
assert(prob_last >= 0);
assert(prob_last <= 255);
assert(prob_garf >= 0);
assert(prob_garf <= 255);
ref_frame_cost[INTRA_FRAME] = vp8_cost_zero(prob_intra);
ref_frame_cost[LAST_FRAME] = vp8_cost_one(prob_intra)
+ vp8_cost_zero(prob_last);
@ -1056,7 +1062,7 @@ int vp8_update_coef_context(VP8_COMP *cpi)
if (cpi->common.frame_type == KEY_FRAME)
{
/* Reset to default counts/probabilities at key frames */
vp8_copy(cpi->coef_counts, default_coef_counts);
vp8_copy(cpi->mb.coef_counts, default_coef_counts);
}
if (cpi->oxcf.error_resilient_mode & VPX_ERROR_RESILIENT_PARTITIONS)
@ -1154,7 +1160,7 @@ void vp8_update_coef_probs(VP8_COMP *cpi)
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
++ tree_update_hist [i][j][k][t] [u];
#endif
@ -1175,7 +1181,7 @@ void vp8_update_coef_probs(VP8_COMP *cpi)
while (++t < ENTROPY_NODES);
/* Accum token counts for generation of default statistics */
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
t = 0;
do
@ -1316,7 +1322,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
vp8_start_encode(bc, cx_data, cx_data_end);
/* signal clr type */
vp8_write_bit(bc, pc->clr_type);
vp8_write_bit(bc, 0);
vp8_write_bit(bc, pc->clamp_type);
}
@ -1521,7 +1527,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
if (pc->frame_type != KEY_FRAME)
vp8_write_bit(bc, pc->refresh_last_frame);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
if (pc->frame_type == INTER_FRAME)
active_section = 0;
@ -1544,7 +1550,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
vp8_update_coef_probs(cpi);
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 2;
#endif
@ -1555,7 +1561,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
{
write_kfmodes(cpi);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 8;
#endif
}
@ -1563,7 +1569,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
{
pack_inter_mode_mvs(cpi);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 1;
#endif
}
@ -1681,7 +1687,7 @@ void vp8_pack_bitstream(VP8_COMP *cpi, unsigned char *dest, unsigned char * dest
#endif
}
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
void print_tree_update_probs()
{
int i, j, k, l;

View File

@ -37,7 +37,7 @@ typedef struct block
/* 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries */
short *quant;
short *quant_fast;
unsigned char *quant_shift;
short *quant_shift;
short *zbin;
short *zrun_zbin_boost;
short *round;

View File

@ -16,7 +16,7 @@ unsigned __int64 Sectionbits[500];
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
unsigned int active_section = 0;
#endif

View File

@ -67,7 +67,7 @@ static void vp8_encode_bool(BOOL_CODER *br, int bit, int probability)
unsigned int lowvalue = br->lowvalue;
register unsigned int shift;
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
#if defined(SECTIONBITS_OUTPUT)
if (bit)

View File

@ -20,10 +20,10 @@ void vp8_short_fdct4x4_c(short *input, short *output, int pitch)
for (i = 0; i < 4; i++)
{
a1 = ((ip[0] + ip[3])<<3);
b1 = ((ip[1] + ip[2])<<3);
c1 = ((ip[1] - ip[2])<<3);
d1 = ((ip[0] - ip[3])<<3);
a1 = ((ip[0] + ip[3]) * 8);
b1 = ((ip[1] + ip[2]) * 8);
c1 = ((ip[1] - ip[2]) * 8);
d1 = ((ip[0] - ip[3]) * 8);
op[0] = a1 + b1;
op[2] = a1 - b1;
@ -72,10 +72,10 @@ void vp8_short_walsh4x4_c(short *input, short *output, int pitch)
for (i = 0; i < 4; i++)
{
a1 = ((ip[0] + ip[2])<<2);
d1 = ((ip[1] + ip[3])<<2);
c1 = ((ip[1] - ip[3])<<2);
b1 = ((ip[0] - ip[2])<<2);
a1 = ((ip[0] + ip[2]) * 4);
d1 = ((ip[1] + ip[3]) * 4);
c1 = ((ip[1] - ip[3]) * 4);
b1 = ((ip[0] - ip[2]) * 4);
op[0] = a1 + d1 + (a1!=0);
op[1] = b1 + c1;

View File

@ -13,7 +13,7 @@
#include "vp8/common/reconinter.h"
#include "vpx/vpx_integer.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
static const unsigned int NOISE_MOTION_THRESHOLD = 25 * 25;
/* SSE_DIFF_THRESHOLD is selected as ~95% confidence assuming
@ -206,8 +206,6 @@ void vp8_denoiser_denoise_mb(VP8_DENOISER *denoiser,
MB_MODE_INFO saved_mbmi;
MACROBLOCKD *filter_xd = &x->e_mbd;
MB_MODE_INFO *mbmi = &filter_xd->mode_info_context->mbmi;
int mv_col;
int mv_row;
int sse_diff = zero_mv_sse - best_sse;
saved_mbmi = *mbmi;

View File

@ -10,6 +10,7 @@
#include "vpx_config.h"
#include "vp8_rtcd.h"
#include "encodemb.h"
#include "encodemv.h"
#include "vp8/common/common.h"
@ -852,11 +853,10 @@ void vp8_encode_frame(VP8_COMP *cpi)
if (xd->segmentation_enabled)
{
int i, j;
int j;
if (xd->segmentation_enabled)
{
for (i = 0; i < cpi->encoding_thread_count; i++)
{
for (j = 0; j < 4; j++)
@ -1299,8 +1299,9 @@ int vp8cx_encode_inter_macroblock
}
{
/* Experimental code. Special case for gf and arf zeromv modes.
* Increase zbin size to supress noise
/* Experimental code.
* Special case for gf and arf zeromv modes, for 1 temporal layer.
* Increase zbin size to supress noise.
*/
x->zbin_mode_boost = 0;
if (x->zbin_mode_boost_enabled)
@ -1309,7 +1310,8 @@ int vp8cx_encode_inter_macroblock
{
if (xd->mode_info_context->mbmi.mode == ZEROMV)
{
if (xd->mode_info_context->mbmi.ref_frame != LAST_FRAME)
if (xd->mode_info_context->mbmi.ref_frame != LAST_FRAME &&
cpi->oxcf.number_of_layers == 1)
x->zbin_mode_boost = GF_ZEROMV_ZBIN_BOOST;
else
x->zbin_mode_boost = LF_ZEROMV_ZBIN_BOOST;

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "quantize.h"
#include "vp8/common/reconintra4x4.h"
#include "encodemb.h"

View File

@ -10,7 +10,7 @@
#include "vpx_config.h"
#include "vpx_rtcd.h"
#include "vp8_rtcd.h"
#include "encodemb.h"
#include "vp8/common/reconinter.h"
#include "quantize.h"

View File

@ -16,7 +16,7 @@
#include <math.h>
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
extern unsigned int active_section;
#endif
@ -359,7 +359,7 @@ void vp8_write_mvprobs(VP8_COMP *cpi)
vp8_writer *const w = cpi->bc;
MV_CONTEXT *mvc = cpi->common.fc.mvc;
int flags[2] = {0, 0};
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 4;
#endif
write_component_probs(
@ -374,7 +374,7 @@ void vp8_write_mvprobs(VP8_COMP *cpi)
if (flags[0] || flags[1])
vp8_build_component_cost_table(cpi->mb.mvcost, (const MV_CONTEXT *) cpi->common.fc.mvc, flags);
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
active_section = 5;
#endif
}

View File

@ -12,6 +12,7 @@
#include <limits.h>
#include <stdio.h>
#include "./vpx_scale_rtcd.h"
#include "block.h"
#include "onyx_int.h"
#include "vp8/common/variance.h"
@ -20,7 +21,7 @@
#include "vp8/common/systemdependent.h"
#include "mcomp.h"
#include "firstpass.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/vpx_scale.h"
#include "encodemb.h"
#include "vp8/common/extend.h"
#include "vpx_mem/vpx_mem.h"
@ -710,8 +711,8 @@ skip_motion_search:
neutral_count++;
}
d->bmi.mv.as_mv.row <<= 3;
d->bmi.mv.as_mv.col <<= 3;
d->bmi.mv.as_mv.row *= 8;
d->bmi.mv.as_mv.col *= 8;
this_error = motion_error;
vp8_set_mbmode_and_mvs(x, NEWMV, &d->bmi.mv);
vp8_encode_inter16x16y(x);
@ -857,7 +858,9 @@ skip_motion_search:
*/
if ((cm->current_video_frame > 0) &&
(cpi->twopass.this_frame_stats.pcnt_inter > 0.20) &&
((cpi->twopass.this_frame_stats.intra_error / cpi->twopass.this_frame_stats.coded_error) > 2.0))
((cpi->twopass.this_frame_stats.intra_error /
DOUBLE_DIVIDE_CHECK(cpi->twopass.this_frame_stats.coded_error)) >
2.0))
{
vp8_yv12_copy_frame(lst_yv12, gld_yv12);
}
@ -906,13 +909,16 @@ extern const int vp8_bits_per_mb[2][QINDEX_RANGE];
static double bitcost( double prob )
{
return -(log( prob ) / log( 2.0 ));
if (prob > 0.000122)
return -log(prob) / log(2.0);
else
return 13.0;
}
static int64_t estimate_modemvcost(VP8_COMP *cpi,
FIRSTPASS_STATS * fpstats)
{
int mv_cost;
int mode_cost;
int64_t mode_cost;
double av_pct_inter = fpstats->pcnt_inter / fpstats->count;
double av_pct_motion = fpstats->pcnt_motion / fpstats->count;
@ -934,10 +940,9 @@ static int64_t estimate_modemvcost(VP8_COMP *cpi,
/* Crude estimate of overhead cost from modes
* << 9 is the normalization to (bits * 512) used in vp8_bits_per_mb
*/
mode_cost =
(int)( ( ((av_pct_inter - av_pct_motion) * zz_cost) +
(av_pct_motion * motion_cost) +
(av_intra * intra_cost) ) * cpi->common.MBs ) << 9;
mode_cost =((((av_pct_inter - av_pct_motion) * zz_cost) +
(av_pct_motion * motion_cost) +
(av_intra * intra_cost)) * cpi->common.MBs) * 512;
return mv_cost + mode_cost;
}
@ -1322,7 +1327,7 @@ static int estimate_kf_group_q(VP8_COMP *cpi, double section_err, int section_ta
return Q;
}
extern void vp8_new_frame_rate(VP8_COMP *cpi, double framerate);
extern void vp8_new_framerate(VP8_COMP *cpi, double framerate);
void vp8_init_second_pass(VP8_COMP *cpi)
{
@ -1346,9 +1351,9 @@ void vp8_init_second_pass(VP8_COMP *cpi)
* sum duration is not. Its calculated based on the actual durations of
* all frames from the first pass.
*/
vp8_new_frame_rate(cpi, 10000000.0 * cpi->twopass.total_stats.count / cpi->twopass.total_stats.duration);
vp8_new_framerate(cpi, 10000000.0 * cpi->twopass.total_stats.count / cpi->twopass.total_stats.duration);
cpi->output_frame_rate = cpi->frame_rate;
cpi->output_framerate = cpi->framerate;
cpi->twopass.bits_left = (int64_t)(cpi->twopass.total_stats.duration * cpi->oxcf.target_bandwidth / 10000000.0) ;
cpi->twopass.bits_left -= (int64_t)(cpi->twopass.total_stats.duration * two_pass_min_rate / 10000000.0);
@ -2115,23 +2120,25 @@ static void define_gf_group(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
(cpi->twopass.kf_group_error_left > 0))
{
cpi->twopass.gf_group_bits =
(int)((double)cpi->twopass.kf_group_bits *
(gf_group_err / (double)cpi->twopass.kf_group_error_left));
(int64_t)(cpi->twopass.kf_group_bits *
(gf_group_err / cpi->twopass.kf_group_error_left));
}
else
cpi->twopass.gf_group_bits = 0;
cpi->twopass.gf_group_bits = (int)(
cpi->twopass.gf_group_bits =
(cpi->twopass.gf_group_bits < 0)
? 0
: (cpi->twopass.gf_group_bits > cpi->twopass.kf_group_bits)
? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits);
? cpi->twopass.kf_group_bits : cpi->twopass.gf_group_bits;
/* Clip cpi->twopass.gf_group_bits based on user supplied data rate
* variability limit (cpi->oxcf.two_pass_vbrmax_section)
*/
if (cpi->twopass.gf_group_bits > max_bits * cpi->baseline_gf_interval)
cpi->twopass.gf_group_bits = max_bits * cpi->baseline_gf_interval;
if (cpi->twopass.gf_group_bits >
(int64_t)max_bits * cpi->baseline_gf_interval)
cpi->twopass.gf_group_bits =
(int64_t)max_bits * cpi->baseline_gf_interval;
/* Reset the file position */
reset_fpf_position(cpi, start_pos);
@ -2393,7 +2400,7 @@ static void assign_std_frame_bits(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
target_frame_size += cpi->min_frame_bandwidth;
/* Every other frame gets a few extra bits */
if ( (cpi->common.frames_since_golden & 0x01) &&
if ( (cpi->frames_since_golden & 0x01) &&
(cpi->frames_till_gf_update_due > 0) )
{
target_frame_size += cpi->twopass.alt_extra_bits;
@ -2445,7 +2452,7 @@ void vp8_second_pass(VP8_COMP *cpi)
*/
if (cpi->oxcf.error_resilient_mode)
{
cpi->twopass.gf_group_bits = (int)cpi->twopass.kf_group_bits;
cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits;
cpi->twopass.gf_group_error_left =
(int)cpi->twopass.kf_group_error_left;
cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
@ -2524,7 +2531,7 @@ void vp8_second_pass(VP8_COMP *cpi)
/* Set nominal per second bandwidth for this frame */
cpi->target_bandwidth = (int)
(cpi->per_frame_bandwidth * cpi->output_frame_rate);
(cpi->per_frame_bandwidth * cpi->output_framerate);
if (cpi->target_bandwidth < 0)
cpi->target_bandwidth = 0;
@ -3180,7 +3187,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
/* Convert to a per second bitrate */
cpi->target_bandwidth = (int)(cpi->twopass.kf_bits *
cpi->output_frame_rate);
cpi->output_framerate);
}
/* Note the total error score of the kf group minus the key frame itself */
@ -3219,7 +3226,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
cpi->common.vert_scale = NORMAL;
/* Calculate Average bits per frame. */
av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->frame_rate);
av_bits_per_frame = cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate);
/* CBR... Use the clip average as the target for deciding resample */
if (cpi->oxcf.end_usage == USAGE_STREAM_FROM_SERVER)
@ -3294,7 +3301,7 @@ static void find_next_key_frame(VP8_COMP *cpi, FIRSTPASS_STATS *this_frame)
}
else
{
int64_t clip_bits = (int64_t)(cpi->twopass.total_stats.count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->frame_rate));
int64_t clip_bits = (int64_t)(cpi->twopass.total_stats.count * cpi->oxcf.target_bandwidth / DOUBLE_DIVIDE_CHECK((double)cpi->framerate));
int64_t over_spend = cpi->oxcf.starting_buffer_level - cpi->buffer_level;
/* If triggered last time the threshold for triggering again is

View File

@ -18,7 +18,7 @@
#include <math.h>
#include "vp8/common/findnearmv.h"
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
static int mv_ref_ct [31] [4] [2];
static int mv_mode_cts [4] [2];
#endif
@ -210,7 +210,7 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
unsigned char *z = (*(b->base_src) + b->src);
int rr = ref_mv->as_mv.row >> 1, rc = ref_mv->as_mv.col >> 1;
int br = bestmv->as_mv.row << 2, bc = bestmv->as_mv.col << 2;
int br = bestmv->as_mv.row * 4, bc = bestmv->as_mv.col * 4;
int tr = br, tc = bc;
unsigned int besterr;
unsigned int left, right, up, down, diag;
@ -220,10 +220,14 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
unsigned int quarteriters = 4;
int thismse;
int minc = MAX(x->mv_col_min << 2, (ref_mv->as_mv.col >> 1) - ((1 << mvlong_width) - 1));
int maxc = MIN(x->mv_col_max << 2, (ref_mv->as_mv.col >> 1) + ((1 << mvlong_width) - 1));
int minr = MAX(x->mv_row_min << 2, (ref_mv->as_mv.row >> 1) - ((1 << mvlong_width) - 1));
int maxr = MIN(x->mv_row_max << 2, (ref_mv->as_mv.row >> 1) + ((1 << mvlong_width) - 1));
int minc = MAX(x->mv_col_min * 4,
(ref_mv->as_mv.col >> 1) - ((1 << mvlong_width) - 1));
int maxc = MIN(x->mv_col_max * 4,
(ref_mv->as_mv.col >> 1) + ((1 << mvlong_width) - 1));
int minr = MAX(x->mv_row_min * 4,
(ref_mv->as_mv.row >> 1) - ((1 << mvlong_width) - 1));
int maxr = MIN(x->mv_row_max * 4,
(ref_mv->as_mv.row >> 1) + ((1 << mvlong_width) - 1));
int y_stride;
int offset;
@ -233,19 +237,18 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
#if ARCH_X86 || ARCH_X86_64
MACROBLOCKD *xd = &x->e_mbd;
unsigned char *y0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y;
int buf_r1, buf_r2, buf_c1, buf_c2;
int buf_r1, buf_r2, buf_c1;
/* Clamping to avoid out-of-range data access */
buf_r1 = ((bestmv->as_mv.row - 3) < x->mv_row_min)?(bestmv->as_mv.row - x->mv_row_min):3;
buf_r2 = ((bestmv->as_mv.row + 3) > x->mv_row_max)?(x->mv_row_max - bestmv->as_mv.row):3;
buf_c1 = ((bestmv->as_mv.col - 3) < x->mv_col_min)?(bestmv->as_mv.col - x->mv_col_min):3;
buf_c2 = ((bestmv->as_mv.col + 3) > x->mv_col_max)?(x->mv_col_max - bestmv->as_mv.col):3;
y_stride = 32;
/* Copy to intermediate buffer before searching. */
vfp->copymem(y0 - buf_c1 - pre_stride*buf_r1, pre_stride, xd->y_buf, y_stride, 16+buf_r1+buf_r2);
vfp->copymem(y_0 - buf_c1 - pre_stride*buf_r1, pre_stride, xd->y_buf, y_stride, 16+buf_r1+buf_r2);
y = xd->y_buf + y_stride*buf_r1 +buf_c1;
#else
unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
@ -255,8 +258,8 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
offset = (bestmv->as_mv.row) * y_stride + bestmv->as_mv.col;
/* central mv */
bestmv->as_mv.row <<= 3;
bestmv->as_mv.col <<= 3;
bestmv->as_mv.row *= 8;
bestmv->as_mv.col *= 8;
/* calculate central point error */
besterr = vfp->vf(y, y_stride, z, b->src_stride, sse1);
@ -338,8 +341,8 @@ int vp8_find_best_sub_pixel_step_iteratively(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
tc = bc;
}
bestmv->as_mv.row = br << 1;
bestmv->as_mv.col = bc << 1;
bestmv->as_mv.row = br * 2;
bestmv->as_mv.col = bc * 2;
if ((abs(bestmv->as_mv.col - ref_mv->as_mv.col) > (MAX_FULL_PEL_VAL<<3)) ||
(abs(bestmv->as_mv.row - ref_mv->as_mv.row) > (MAX_FULL_PEL_VAL<<3)))
@ -376,12 +379,12 @@ int vp8_find_best_sub_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
#if ARCH_X86 || ARCH_X86_64
MACROBLOCKD *xd = &x->e_mbd;
unsigned char *y0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y;
y_stride = 32;
/* Copy 18 rows x 32 cols area to intermediate buffer before searching. */
vfp->copymem(y0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18);
vfp->copymem(y_0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18);
y = xd->y_buf + y_stride + 1;
#else
unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
@ -687,12 +690,12 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
#if ARCH_X86 || ARCH_X86_64
MACROBLOCKD *xd = &x->e_mbd;
unsigned char *y0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y_0 = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
unsigned char *y;
y_stride = 32;
/* Copy 18 rows x 32 cols area to intermediate buffer before searching. */
vfp->copymem(y0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18);
vfp->copymem(y_0 - 1 - pre_stride, pre_stride, xd->y_buf, y_stride, 18);
y = xd->y_buf + y_stride + 1;
#else
unsigned char *y = base_pre + d->offset + (bestmv->as_mv.row) * pre_stride + bestmv->as_mv.col;
@ -700,8 +703,8 @@ int vp8_find_best_half_pixel_step(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
#endif
/* central mv */
bestmv->as_mv.row <<= 3;
bestmv->as_mv.col <<= 3;
bestmv->as_mv.row *= 8;
bestmv->as_mv.col *= 8;
startmv = *bestmv;
/* calculate central point error */
@ -1316,8 +1319,8 @@ int vp8_diamond_search_sadx4
(*num00)++;
}
this_mv.as_mv.row = best_mv->as_mv.row << 3;
this_mv.as_mv.col = best_mv->as_mv.col << 3;
this_mv.as_mv.row = best_mv->as_mv.row * 8;
this_mv.as_mv.col = best_mv->as_mv.col * 8;
return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad)
+ mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
@ -1710,8 +1713,8 @@ int vp8_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
}
}
this_mv.as_mv.row = best_mv->as_mv.row << 3;
this_mv.as_mv.col = best_mv->as_mv.col << 3;
this_mv.as_mv.row = best_mv->as_mv.row * 8;
this_mv.as_mv.col = best_mv->as_mv.col * 8;
return fn_ptr->vf(what, what_stride, bestaddress, in_what_stride, &thissad)
+ mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
@ -1906,14 +1909,14 @@ int vp8_refining_search_sadx4(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
}
}
this_mv.as_mv.row = ref_mv->as_mv.row << 3;
this_mv.as_mv.col = ref_mv->as_mv.col << 3;
this_mv.as_mv.row = ref_mv->as_mv.row * 8;
this_mv.as_mv.col = ref_mv->as_mv.col * 8;
return fn_ptr->vf(what, what_stride, best_address, in_what_stride, &thissad)
+ mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
}
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
void print_mode_context(void)
{
FILE *f = fopen("modecont.c", "w");
@ -1966,8 +1969,8 @@ void print_mode_context(void)
fclose(f);
}
/* MV ref count ENTROPY_STATS stats code */
#ifdef ENTROPY_STATS
/* MV ref count VP8_ENTROPY_STATS stats code */
#ifdef VP8_ENTROPY_STATS
void init_mv_ref_counts()
{
vpx_memset(mv_ref_ct, 0, sizeof(mv_ref_ct));
@ -2021,6 +2024,6 @@ void accum_mv_refs(MB_PREDICTION_MODE m, const int ct[4])
}
}
#endif/* END MV ref count ENTROPY_STATS stats code */
#endif/* END MV ref count VP8_ENTROPY_STATS stats code */
#endif

View File

@ -15,7 +15,7 @@
#include "block.h"
#include "vp8/common/variance.h"
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
extern void init_mv_ref_counts();
extern void accum_mv_refs(MB_PREDICTION_MODE, const int near_mv_ref_cts[4]);
#endif

View File

@ -10,6 +10,7 @@
#include "vpx_config.h"
#include "./vpx_scale_rtcd.h"
#include "vp8/common/onyxc_int.h"
#include "vp8/common/blockd.h"
#include "onyx_int.h"
@ -19,7 +20,7 @@
#include "mcomp.h"
#include "firstpass.h"
#include "psnr.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/extend.h"
#include "ratectrl.h"
#include "vp8/common/quant_common.h"
@ -110,7 +111,7 @@ extern int skip_false_count;
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
extern int intra_mode_stats[10][10][10];
#endif
@ -288,6 +289,125 @@ static void restore_layer_context(VP8_COMP *cpi, const int layer)
sizeof(cpi->mb.count_mb_ref_frame_usage));
}
static int rescale(int val, int num, int denom)
{
int64_t llnum = num;
int64_t llden = denom;
int64_t llval = val;
return (int)(llval * llnum / llden);
}
static void init_temporal_layer_context(VP8_COMP *cpi,
VP8_CONFIG *oxcf,
const int layer,
double prev_layer_framerate)
{
LAYER_CONTEXT *lc = &cpi->layer_context[layer];
lc->framerate = cpi->output_framerate / cpi->oxcf.rate_decimator[layer];
lc->target_bandwidth = cpi->oxcf.target_bitrate[layer] * 1000;
lc->starting_buffer_level_in_ms = oxcf->starting_buffer_level;
lc->optimal_buffer_level_in_ms = oxcf->optimal_buffer_level;
lc->maximum_buffer_size_in_ms = oxcf->maximum_buffer_size;
lc->starting_buffer_level =
rescale((int)(oxcf->starting_buffer_level),
lc->target_bandwidth, 1000);
if (oxcf->optimal_buffer_level == 0)
lc->optimal_buffer_level = lc->target_bandwidth / 8;
else
lc->optimal_buffer_level =
rescale((int)(oxcf->optimal_buffer_level),
lc->target_bandwidth, 1000);
if (oxcf->maximum_buffer_size == 0)
lc->maximum_buffer_size = lc->target_bandwidth / 8;
else
lc->maximum_buffer_size =
rescale((int)(oxcf->maximum_buffer_size),
lc->target_bandwidth, 1000);
/* Work out the average size of a frame within this layer */
if (layer > 0)
lc->avg_frame_size_for_layer =
(int)((cpi->oxcf.target_bitrate[layer] -
cpi->oxcf.target_bitrate[layer-1]) * 1000 /
(lc->framerate - prev_layer_framerate));
lc->active_worst_quality = cpi->oxcf.worst_allowed_q;
lc->active_best_quality = cpi->oxcf.best_allowed_q;
lc->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
lc->buffer_level = lc->starting_buffer_level;
lc->bits_off_target = lc->starting_buffer_level;
lc->total_actual_bits = 0;
lc->ni_av_qi = 0;
lc->ni_tot_qi = 0;
lc->ni_frames = 0;
lc->rate_correction_factor = 1.0;
lc->key_frame_rate_correction_factor = 1.0;
lc->gf_rate_correction_factor = 1.0;
lc->inter_frame_target = 0;
}
// Upon a run-time change in temporal layers, reset the layer context parameters
// for any "new" layers. For "existing" layers, let them inherit the parameters
// from the previous layer state (at the same layer #). In future we may want
// to better map the previous layer state(s) to the "new" ones.
static void reset_temporal_layer_change(VP8_COMP *cpi,
VP8_CONFIG *oxcf,
const int prev_num_layers)
{
int i;
double prev_layer_framerate = 0;
const int curr_num_layers = cpi->oxcf.number_of_layers;
// If the previous state was 1 layer, get current layer context from cpi.
// We need this to set the layer context for the new layers below.
if (prev_num_layers == 1)
{
cpi->current_layer = 0;
save_layer_context(cpi);
}
for (i = 0; i < curr_num_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
if (i >= prev_num_layers)
{
init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
}
// The initial buffer levels are set based on their starting levels.
// We could set the buffer levels based on the previous state (normalized
// properly by the layer bandwidths) but we would need to keep track of
// the previous set of layer bandwidths (i.e., target_bitrate[i])
// before the layer change. For now, reset to the starting levels.
lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms *
cpi->oxcf.target_bitrate[i];
lc->bits_off_target = lc->buffer_level;
// TDOD(marpan): Should we set the rate_correction_factor and
// active_worst/best_quality to values derived from the previous layer
// state (to smooth-out quality dips/rate fluctuation at transition)?
// We need to treat the 1 layer case separately: oxcf.target_bitrate[i]
// is not set for 1 layer, and the restore_layer_context/save_context()
// are not called in the encoding loop, so we need to call it here to
// pass the layer context state to |cpi|.
if (curr_num_layers == 1)
{
lc->target_bandwidth = cpi->oxcf.target_bandwidth;
lc->buffer_level = cpi->oxcf.starting_buffer_level_in_ms *
lc->target_bandwidth / 1000;
lc->bits_off_target = lc->buffer_level;
restore_layer_context(cpi, 0);
}
prev_layer_framerate = cpi->output_framerate /
cpi->oxcf.rate_decimator[i];
}
}
static void setup_features(VP8_COMP *cpi)
{
// If segmentation enabled set the update flags
@ -640,7 +760,6 @@ void vp8_set_speed_features(VP8_COMP *cpi)
for (i = 0; i < MAX_MODES; i ++)
{
cpi->mode_check_freq[i] = 0;
cpi->mode_chosen_counts[i] = 0;
}
cpi->mb.mbs_tested_so_far = 0;
@ -825,7 +944,7 @@ void vp8_set_speed_features(VP8_COMP *cpi)
{
unsigned int sum = 0;
unsigned int total_mbs = cm->MBs;
int i, thresh;
int thresh;
unsigned int total_skip;
int min = 2000;
@ -1163,21 +1282,21 @@ int vp8_reverse_trans(int x)
return 63;
}
void vp8_new_frame_rate(VP8_COMP *cpi, double framerate)
void vp8_new_framerate(VP8_COMP *cpi, double framerate)
{
if(framerate < .1)
framerate = 30;
cpi->frame_rate = framerate;
cpi->output_frame_rate = framerate;
cpi->framerate = framerate;
cpi->output_framerate = framerate;
cpi->per_frame_bandwidth = (int)(cpi->oxcf.target_bandwidth /
cpi->output_frame_rate);
cpi->output_framerate);
cpi->av_per_frame_bandwidth = cpi->per_frame_bandwidth;
cpi->min_frame_bandwidth = (int)(cpi->av_per_frame_bandwidth *
cpi->oxcf.two_pass_vbrmin_section / 100);
/* Set Maximum gf/arf interval */
cpi->max_gf_interval = ((int)(cpi->output_frame_rate / 2.0) + 2);
cpi->max_gf_interval = ((int)(cpi->output_framerate / 2.0) + 2);
if(cpi->max_gf_interval < 12)
cpi->max_gf_interval = 12;
@ -1200,17 +1319,6 @@ void vp8_new_frame_rate(VP8_COMP *cpi, double framerate)
}
static int
rescale(int val, int num, int denom)
{
int64_t llnum = num;
int64_t llden = denom;
int64_t llval = val;
return (int)(llval * llnum / llden);
}
static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
{
VP8_COMMON *cm = &cpi->common;
@ -1229,13 +1337,13 @@ static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
* seems like a reasonable framerate, then use that as a guess, otherwise
* use 30.
*/
cpi->frame_rate = (double)(oxcf->timebase.den) /
(double)(oxcf->timebase.num);
cpi->framerate = (double)(oxcf->timebase.den) /
(double)(oxcf->timebase.num);
if (cpi->frame_rate > 180)
cpi->frame_rate = 30;
if (cpi->framerate > 180)
cpi->framerate = 30;
cpi->ref_frame_rate = cpi->frame_rate;
cpi->ref_framerate = cpi->framerate;
/* change includes all joint functionality */
vp8_change_config(cpi, oxcf);
@ -1261,63 +1369,13 @@ static void init_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
if (cpi->oxcf.number_of_layers > 1)
{
unsigned int i;
double prev_layer_frame_rate=0;
double prev_layer_framerate=0;
for (i=0; i<cpi->oxcf.number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
/* Layer configuration */
lc->frame_rate =
cpi->output_frame_rate / cpi->oxcf.rate_decimator[i];
lc->target_bandwidth = cpi->oxcf.target_bitrate[i] * 1000;
lc->starting_buffer_level_in_ms = oxcf->starting_buffer_level;
lc->optimal_buffer_level_in_ms = oxcf->optimal_buffer_level;
lc->maximum_buffer_size_in_ms = oxcf->maximum_buffer_size;
lc->starting_buffer_level =
rescale((int)(oxcf->starting_buffer_level),
lc->target_bandwidth, 1000);
if (oxcf->optimal_buffer_level == 0)
lc->optimal_buffer_level = lc->target_bandwidth / 8;
else
lc->optimal_buffer_level =
rescale((int)(oxcf->optimal_buffer_level),
lc->target_bandwidth, 1000);
if (oxcf->maximum_buffer_size == 0)
lc->maximum_buffer_size = lc->target_bandwidth / 8;
else
lc->maximum_buffer_size =
rescale((int)oxcf->maximum_buffer_size,
lc->target_bandwidth, 1000);
/* Work out the average size of a frame within this layer */
if (i > 0)
lc->avg_frame_size_for_layer =
(int)((cpi->oxcf.target_bitrate[i] -
cpi->oxcf.target_bitrate[i-1]) * 1000 /
(lc->frame_rate - prev_layer_frame_rate));
lc->active_worst_quality = cpi->oxcf.worst_allowed_q;
lc->active_best_quality = cpi->oxcf.best_allowed_q;
lc->avg_frame_qindex = cpi->oxcf.worst_allowed_q;
lc->buffer_level = lc->starting_buffer_level;
lc->bits_off_target = lc->starting_buffer_level;
lc->total_actual_bits = 0;
lc->ni_av_qi = 0;
lc->ni_tot_qi = 0;
lc->ni_frames = 0;
lc->rate_correction_factor = 1.0;
lc->key_frame_rate_correction_factor = 1.0;
lc->gf_rate_correction_factor = 1.0;
lc->inter_frame_target = 0;
prev_layer_frame_rate = lc->frame_rate;
init_temporal_layer_context(cpi, oxcf, i, prev_layer_framerate);
prev_layer_framerate = cpi->output_framerate /
cpi->oxcf.rate_decimator[i];
}
}
@ -1341,14 +1399,14 @@ static void update_layer_contexts (VP8_COMP *cpi)
if (oxcf->number_of_layers > 1)
{
unsigned int i;
double prev_layer_frame_rate=0;
double prev_layer_framerate=0;
for (i=0; i<oxcf->number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
lc->frame_rate =
cpi->ref_frame_rate / oxcf->rate_decimator[i];
lc->framerate =
cpi->ref_framerate / oxcf->rate_decimator[i];
lc->target_bandwidth = oxcf->target_bitrate[i] * 1000;
lc->starting_buffer_level = rescale(
@ -1374,9 +1432,9 @@ static void update_layer_contexts (VP8_COMP *cpi)
lc->avg_frame_size_for_layer =
(int)((oxcf->target_bitrate[i] -
oxcf->target_bitrate[i-1]) * 1000 /
(lc->frame_rate - prev_layer_frame_rate));
(lc->framerate - prev_layer_framerate));
prev_layer_frame_rate = lc->frame_rate;
prev_layer_framerate = lc->framerate;
}
}
}
@ -1384,7 +1442,7 @@ static void update_layer_contexts (VP8_COMP *cpi)
void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
{
VP8_COMMON *cm = &cpi->common;
int last_w, last_h;
int last_w, last_h, prev_number_of_layers;
if (!cpi)
return;
@ -1409,6 +1467,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
last_w = cpi->oxcf.Width;
last_h = cpi->oxcf.Height;
prev_number_of_layers = cpi->oxcf.number_of_layers;
cpi->oxcf = *oxcf;
@ -1566,7 +1625,7 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->oxcf.target_bandwidth, 1000);
/* Set up frame rate and related parameters rate control values. */
vp8_new_frame_rate(cpi, cpi->frame_rate);
vp8_new_framerate(cpi, cpi->framerate);
/* Set absolute upper and lower quality limits */
cpi->worst_quality = cpi->oxcf.worst_allowed_q;
@ -1601,6 +1660,16 @@ void vp8_change_config(VP8_COMP *cpi, VP8_CONFIG *oxcf)
cpi->target_bandwidth = cpi->oxcf.target_bandwidth;
// Check if the number of temporal layers has changed, and if so reset the
// pattern counter and set/initialize the temporal layer context for the
// new layer configuration.
if (cpi->oxcf.number_of_layers != prev_number_of_layers)
{
// If the number of temporal layers are changed we must start at the
// base of the pattern cycle, so reset temporal_pattern_counter.
cpi->temporal_pattern_counter = 0;
reset_temporal_layer_change(cpi, oxcf, prev_number_of_layers);
}
cm->Width = cpi->oxcf.Width;
cm->Height = cpi->oxcf.Height;
@ -1738,6 +1807,7 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
memcpy(cpi->base_skip_false_prob, vp8cx_base_skip_false_prob, sizeof(vp8cx_base_skip_false_prob));
cpi->common.current_video_frame = 0;
cpi->temporal_pattern_counter = 0;
cpi->kf_overspend_bits = 0;
cpi->kf_bitrate_adjustment = 0;
cpi->frames_till_gf_update_due = 0;
@ -1805,7 +1875,7 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
else
cpi->cyclic_refresh_map = (signed char *) NULL;
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
init_context_counters();
#endif
@ -1875,7 +1945,7 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
for (i = 0; i < KEY_FRAME_CONTEXT; i++)
{
cpi->prior_key_frame_distance[i] = (int)cpi->output_frame_rate;
cpi->prior_key_frame_distance[i] = (int)cpi->output_framerate;
}
#ifdef OUTPUT_YUV_SRC
@ -1923,7 +1993,7 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
cpi->mb.rd_thresh_mult[i] = 128;
}
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
init_mv_ref_counts();
#endif
@ -2060,7 +2130,7 @@ void vp8_remove_compressor(VP8_COMP **ptr)
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
print_context_counters();
print_tree_update_probs();
print_mode_context();
@ -2203,7 +2273,7 @@ void vp8_remove_compressor(VP8_COMP **ptr)
{
extern int count_mb_seg[4];
FILE *f = fopen("modes.stt", "a");
double dr = (double)cpi->frame_rate * (double)bytes * (double)8 / (double)count / (double)1000 ;
double dr = (double)cpi->framerate * (double)bytes * (double)8 / (double)count / (double)1000 ;
fprintf(f, "intra_mode in Intra Frames:\n");
fprintf(f, "Y: %8d, %8d, %8d, %8d, %8d\n", y_modes[0], y_modes[1], y_modes[2], y_modes[3], y_modes[4]);
fprintf(f, "UV:%8d, %8d, %8d, %8d\n", uv_modes[0], uv_modes[1], uv_modes[2], uv_modes[3]);
@ -2242,7 +2312,7 @@ void vp8_remove_compressor(VP8_COMP **ptr)
}
#endif
#ifdef ENTROPY_STATS
#ifdef VP8_ENTROPY_STATS
{
int i, j, k;
FILE *fmode = fopen("modecontext.c", "w");
@ -2587,7 +2657,7 @@ static void scale_and_extend_source(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi)
Scale2Ratio(cm->horiz_scale, &hr, &hs);
Scale2Ratio(cm->vert_scale, &vr, &vs);
vp8_scale_frame(sd, &cpi->scaled_source, cm->temp_scale_frame.y_buffer,
vpx_scale_frame(sd, &cpi->scaled_source, cm->temp_scale_frame.y_buffer,
tmp_height, hs, hr, vs, vr, 0);
vp8_yv12_extend_frame_borders(&cpi->scaled_source);
@ -2680,12 +2750,12 @@ static void update_alt_ref_frame_stats(VP8_COMP *cpi)
cpi->gf_active_count = cm->mb_rows * cm->mb_cols;
/* this frame refreshes means next frames don't unless specified by user */
cpi->common.frames_since_golden = 0;
cpi->frames_since_golden = 0;
/* Clear the alternate reference update pending flag. */
cpi->source_alt_ref_pending = 0;
/* Set the alternate refernce frame active flag */
/* Set the alternate reference frame active flag */
cpi->source_alt_ref_active = 1;
@ -2732,7 +2802,7 @@ static void update_golden_frame_stats(VP8_COMP *cpi)
* user
*/
cm->refresh_golden_frame = 0;
cpi->common.frames_since_golden = 0;
cpi->frames_since_golden = 0;
cpi->recent_ref_frame_usage[INTRA_FRAME] = 1;
cpi->recent_ref_frame_usage[LAST_FRAME] = 1;
@ -2764,12 +2834,12 @@ static void update_golden_frame_stats(VP8_COMP *cpi)
if (cpi->frames_till_gf_update_due > 0)
cpi->frames_till_gf_update_due--;
if (cpi->common.frames_till_alt_ref_frame)
cpi->common.frames_till_alt_ref_frame --;
if (cpi->frames_till_alt_ref_frame)
cpi->frames_till_alt_ref_frame --;
cpi->common.frames_since_golden ++;
cpi->frames_since_golden ++;
if (cpi->common.frames_since_golden > 1)
if (cpi->frames_since_golden > 1)
{
cpi->recent_ref_frame_usage[INTRA_FRAME] +=
cpi->mb.count_mb_ref_frame_usage[INTRA_FRAME];
@ -2815,14 +2885,16 @@ static void update_rd_ref_frame_probs(VP8_COMP *cpi)
if (cpi->common.refresh_alt_ref_frame)
{
cpi->prob_intra_coded += 40;
if (cpi->prob_intra_coded > 255)
cpi->prob_intra_coded = 255;
cpi->prob_last_coded = 200;
cpi->prob_gf_coded = 1;
}
else if (cpi->common.frames_since_golden == 0)
else if (cpi->frames_since_golden == 0)
{
cpi->prob_last_coded = 214;
}
else if (cpi->common.frames_since_golden == 1)
else if (cpi->frames_since_golden == 1)
{
cpi->prob_last_coded = 192;
cpi->prob_gf_coded = 220;
@ -3296,12 +3368,12 @@ static void encode_frame_to_data_rate
cpi->per_frame_bandwidth = cpi->twopass.gf_bits;
/* per second target bitrate */
cpi->target_bandwidth = (int)(cpi->twopass.gf_bits *
cpi->output_frame_rate);
cpi->output_framerate);
}
}
else
#endif
cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_frame_rate);
cpi->per_frame_bandwidth = (int)(cpi->target_bandwidth / cpi->output_framerate);
/* Default turn off buffer to buffer copying */
cm->copy_buffer_to_gf = 0;
@ -3330,7 +3402,7 @@ static void encode_frame_to_data_rate
else
cpi->common.ref_frame_sign_bias[ALTREF_FRAME] = 0;
/* Check to see if a key frame is signalled
/* Check to see if a key frame is signaled
* For two pass with auto key frame enabled cm->frame_type may already
* be set, but not for one pass.
*/
@ -3465,7 +3537,7 @@ static void encode_frame_to_data_rate
/* Note that we should not throw out a key frame (especially when
* spatial resampling is enabled).
*/
if ((cm->frame_type == KEY_FRAME))
if (cm->frame_type == KEY_FRAME)
{
cpi->decimation_count = cpi->decimation_factor;
}
@ -3483,6 +3555,8 @@ static void encode_frame_to_data_rate
cm->current_video_frame++;
cpi->frames_since_key++;
// We advance the temporal pattern for dropped frames.
cpi->temporal_pattern_counter++;
#if CONFIG_INTERNAL_STATS
cpi->count ++;
@ -3500,7 +3574,8 @@ static void encode_frame_to_data_rate
for (i=cpi->current_layer+1; i<cpi->oxcf.number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
lc->bits_off_target += cpi->av_per_frame_bandwidth;
lc->bits_off_target += (int)(lc->target_bandwidth /
lc->framerate);
if (lc->bits_off_target > lc->maximum_buffer_size)
lc->bits_off_target = lc->maximum_buffer_size;
lc->buffer_level = lc->bits_off_target;
@ -3524,6 +3599,8 @@ static void encode_frame_to_data_rate
#endif
cm->current_video_frame++;
cpi->frames_since_key++;
// We advance the temporal pattern for dropped frames.
cpi->temporal_pattern_counter++;
return;
}
@ -4481,7 +4558,7 @@ static void encode_frame_to_data_rate
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
int bits_off_for_this_layer =
(int)(lc->target_bandwidth / lc->frame_rate -
(int)(lc->target_bandwidth / lc->framerate -
cpi->projected_frame_size);
lc->bits_off_target += bits_off_for_this_layer;
@ -4597,9 +4674,6 @@ static void encode_frame_to_data_rate
cm->frame_type, cm->refresh_golden_frame,
cm->refresh_alt_ref_frame);
for (i = 0; i < MAX_MODES; i++)
fprintf(fmodes, "%5d ", cpi->mode_chosen_counts[i]);
fprintf(fmodes, "\n");
fclose(fmodes);
@ -4694,6 +4768,7 @@ static void encode_frame_to_data_rate
{
cm->current_video_frame++;
cpi->frames_since_key++;
cpi->temporal_pattern_counter++;
}
/* reset to normal state now that we are done. */
@ -4731,7 +4806,7 @@ static void Pass2Encode(VP8_COMP *cpi, unsigned long *size, unsigned char *dest,
{
double two_pass_min_rate = (double)(cpi->oxcf.target_bandwidth
*cpi->oxcf.two_pass_vbrmin_section / 100);
cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->frame_rate);
cpi->twopass.bits_left += (int64_t)(two_pass_min_rate / cpi->framerate);
}
}
#endif
@ -4747,8 +4822,10 @@ int vp8_receive_raw_frame(VP8_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_C
{
#if HAVE_NEON
int64_t store_reg[8];
#endif
#if CONFIG_RUNTIME_CPU_DETECT
VP8_COMMON *cm = &cpi->common;
#endif
#endif
struct vpx_usec_timer timer;
int res = 0;
@ -4774,7 +4851,6 @@ int vp8_receive_raw_frame(VP8_COMP *cpi, unsigned int frame_flags, YV12_BUFFER_C
if(vp8_lookahead_push(cpi->lookahead, sd, time_stamp, end_time,
frame_flags, cpi->active_map_enabled ? cpi->active_map : NULL))
res = -1;
cm->clr_type = sd->clrtype;
vpx_usec_timer_mark(&timer);
cpi->time_receive_data += vpx_usec_timer_elapsed(&timer);
@ -4859,7 +4935,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
cpi->frames_till_gf_update_due);
force_src_buffer = &cpi->alt_ref_buffer;
}
cm->frames_till_alt_ref_frame = cpi->frames_till_gf_update_due;
cpi->frames_till_alt_ref_frame = cpi->frames_till_gf_update_due;
cm->refresh_alt_ref_frame = 1;
cm->refresh_golden_frame = 0;
cm->refresh_last_frame = 0;
@ -4964,7 +5040,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if (this_duration)
{
if (step)
cpi->ref_frame_rate = 10000000.0 / this_duration;
cpi->ref_framerate = 10000000.0 / this_duration;
else
{
double avg_duration, interval;
@ -4978,11 +5054,11 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if(interval > 10000000.0)
interval = 10000000;
avg_duration = 10000000.0 / cpi->ref_frame_rate;
avg_duration = 10000000.0 / cpi->ref_framerate;
avg_duration *= (interval - avg_duration + this_duration);
avg_duration /= interval;
cpi->ref_frame_rate = 10000000.0 / avg_duration;
cpi->ref_framerate = 10000000.0 / avg_duration;
}
if (cpi->oxcf.number_of_layers > 1)
@ -4993,12 +5069,12 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
for (i=0; i<cpi->oxcf.number_of_layers; i++)
{
LAYER_CONTEXT *lc = &cpi->layer_context[i];
lc->frame_rate = cpi->ref_frame_rate /
cpi->oxcf.rate_decimator[i];
lc->framerate = cpi->ref_framerate /
cpi->oxcf.rate_decimator[i];
}
}
else
vp8_new_frame_rate(cpi, cpi->ref_frame_rate);
vp8_new_framerate(cpi, cpi->ref_framerate);
}
cpi->last_time_stamp_seen = cpi->source->ts_start;
@ -5013,9 +5089,9 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
/* Restore layer specific context & set frame rate */
layer = cpi->oxcf.layer_id[
cm->current_video_frame % cpi->oxcf.periodicity];
cpi->temporal_pattern_counter % cpi->oxcf.periodicity];
restore_layer_context (cpi, layer);
vp8_new_frame_rate (cpi, cpi->layer_context[layer].frame_rate);
vp8_new_framerate(cpi, cpi->layer_context[layer].framerate);
}
if (cpi->compressor_speed == 2)
@ -5180,7 +5256,7 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
if (cm->show_frame)
{
cpi->common.show_frame_mi = cpi->common.mi;
cpi->count ++;
if (cpi->b_calculate_psnr)
@ -5361,6 +5437,7 @@ int vp8_get_preview_raw_frame(VP8_COMP *cpi, YV12_BUFFER_CONFIG *dest, vp8_ppfla
#endif
#if CONFIG_POSTPROC
cpi->common.show_frame_mi = cpi->common.mi;
ret = vp8_post_proc_frame(&cpi->common, dest, flags);
#else

View File

@ -232,7 +232,7 @@ enum
typedef struct
{
/* Layer configuration */
double frame_rate;
double framerate;
int target_bandwidth;
/* Layer specific coding parameters */
@ -282,17 +282,17 @@ typedef struct VP8_COMP
{
DECLARE_ALIGNED(16, short, Y1quant[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, unsigned char, Y1quant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y1quant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y1zbin[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y1round[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y2quant[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, unsigned char, Y2quant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y2quant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y2zbin[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, Y2round[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, UVquant[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, unsigned char, UVquant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, UVquant_shift[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, UVzbin[QINDEX_RANGE][16]);
DECLARE_ALIGNED(16, short, UVround[QINDEX_RANGE][16]);
@ -320,6 +320,7 @@ typedef struct VP8_COMP
YV12_BUFFER_CONFIG scaled_source;
YV12_BUFFER_CONFIG *last_frame_unscaled_source;
unsigned int frames_till_alt_ref_frame;
/* frame in src_buffers has been identified to be encoded as an alt ref */
int source_alt_ref_pending;
/* an alt ref frame has been encoded and is usable */
@ -349,7 +350,6 @@ typedef struct VP8_COMP
int ambient_err;
unsigned int mode_check_freq[MAX_MODES];
unsigned int mode_chosen_counts[MAX_MODES];
int rd_baseline_thresh[MAX_MODES];
@ -370,6 +370,7 @@ typedef struct VP8_COMP
double key_frame_rate_correction_factor;
double gf_rate_correction_factor;
unsigned int frames_since_golden;
/* Count down till next GF */
int frames_till_gf_update_due;
@ -402,7 +403,7 @@ typedef struct VP8_COMP
/* Minimum allocation that should be used for any frame */
int min_frame_bandwidth;
int inter_frame_target;
double output_frame_rate;
double output_framerate;
int64_t last_time_stamp_seen;
int64_t last_end_time_stamp_seen;
int64_t first_time_stamp_ever;
@ -416,8 +417,8 @@ typedef struct VP8_COMP
int buffered_mode;
double frame_rate;
double ref_frame_rate;
double framerate;
double ref_framerate;
int64_t buffer_level;
int64_t bits_off_target;
@ -510,6 +511,10 @@ typedef struct VP8_COMP
int cyclic_refresh_q;
signed char *cyclic_refresh_map;
// Frame counter for the temporal pattern. Counter is rest when the temporal
// layers are changed dynamically (run-time change).
unsigned int temporal_pattern_counter;
#if CONFIG_MULTITHREAD
/* multithread data */
int * mt_current_mb_col;
@ -587,7 +592,7 @@ typedef struct VP8_COMP
/* Error score of frames still to be coded in kf group */
int64_t kf_group_error_left;
/* Projected Bits available for a group including 1 GF or ARF */
int gf_group_bits;
int64_t gf_group_bits;
/* Bits for the golden frame or ARF */
int gf_bits;
int alt_extra_bits;

View File

@ -389,7 +389,7 @@ static void pick_intra_mbuv_mode(MACROBLOCK *mb)
}
static void update_mvcount(VP8_COMP *cpi, MACROBLOCK *x, int_mv *best_ref_mv)
static void update_mvcount(MACROBLOCK *x, int_mv *best_ref_mv)
{
MACROBLOCKD *xd = &x->e_mbd;
/* Split MV modes currently not supported when RD is nopt enabled,
@ -594,6 +594,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
unsigned int zero_mv_sse = INT_MAX, best_sse = INT_MAX;
#endif
int sf_improved_mv_pred = cpi->sf.improved_mv_pred;
int_mv mvp;
int near_sadidx[8] = {0, 1, 2, 3, 4, 5, 6, 7};
@ -882,7 +883,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
last frame motion info is not stored, then we can not
use improved_mv_pred. */
if (cpi->oxcf.mr_encoder_id && !parent_ref_valid)
cpi->sf.improved_mv_pred = 0;
sf_improved_mv_pred = 0;
if (parent_ref_valid && parent_ref_frame)
{
@ -899,7 +900,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
}else
#endif
{
if(cpi->sf.improved_mv_pred)
if(sf_improved_mv_pred)
{
if(!saddone)
{
@ -1241,7 +1242,7 @@ void vp8_pick_inter_mode(VP8_COMP *cpi, MACROBLOCK *x, int recon_yoffset,
!= cpi->common.ref_frame_sign_bias[xd->mode_info_context->mbmi.ref_frame])
best_ref_mv.as_int = best_ref_mv_sb[!sign_bias].as_int;
update_mvcount(cpi, x, &best_ref_mv);
update_mvcount(x, &best_ref_mv);
}

View File

@ -9,11 +9,12 @@
*/
#include "./vpx_scale_rtcd.h"
#include "vp8/common/onyxc_int.h"
#include "onyx_int.h"
#include "quantize.h"
#include "vpx_mem/vpx_mem.h"
#include "vpx_scale/vpxscale.h"
#include "vpx_scale/vpx_scale.h"
#include "vp8/common/alloccommon.h"
#include "vp8/common/loopfilter.h"
#if ARCH_ARM
@ -312,7 +313,7 @@ void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi)
/* Get baseline error score */
/* Copy the unfiltered / processed recon buffer to the new buffer */
vp8_yv12_copy_y(saved_frame, cm->frame_to_show);
vpx_yv12_copy_y(saved_frame, cm->frame_to_show);
vp8cx_set_alt_lf_level(cpi, filt_mid);
vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_mid);
@ -338,7 +339,7 @@ void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi)
if(ss_err[filt_low] == 0)
{
/* Get Low filter error score */
vp8_yv12_copy_y(saved_frame, cm->frame_to_show);
vpx_yv12_copy_y(saved_frame, cm->frame_to_show);
vp8cx_set_alt_lf_level(cpi, filt_low);
vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_low);
@ -366,7 +367,7 @@ void vp8cx_pick_filter_level(YV12_BUFFER_CONFIG *sd, VP8_COMP *cpi)
{
if(ss_err[filt_high] == 0)
{
vp8_yv12_copy_y(saved_frame, cm->frame_to_show);
vpx_yv12_copy_y(saved_frame, cm->frame_to_show);
vp8cx_set_alt_lf_level(cpi, filt_high);
vp8_loop_filter_frame_yonly(cm, &cpi->mb.e_mbd, filt_high);

View File

@ -13,7 +13,7 @@
#include "math.h"
#include "vp8/common/systemdependent.h" /* for vp8_clear_system_state() */
#define MAX_PSNR 60
#define MAX_PSNR 100
double vp8_mse2psnr(double Samples, double Peak, double Mse)
{

Some files were not shown because too many files have changed in this diff Show More