Skip to content
Snippets Groups Projects
Commit 805078a1 authored by James Zern's avatar James Zern
Browse files

build: convert rtcd.sh to perl

significantly speeds up file generation.

the goal of this change is to convert rtcd.sh to perl as directly as
possible to allow for simple comparison. future changes can make it more
perl-like.

---
Linux
    [CREATE] vpx_scale_rtcd.h
real    0m0.485s ->    0m0.022s
    [CREATE] vp8_rtcd.h
real    0m4.619s ->    0m0.060s
    [CREATE] vp9_rtcd.h
real    0m10.102s ->    0m0.087s

Windows
    [CREATE] vpx_scale_rtcd.h
real    0m8.360s ->    0m0.080s
    [CREATE] vp8_rtcd.h
real    1m8.083s ->    0m0.160s
    [CREATE] vp9_rtcd.h
real    2m6.489s ->    0m0.233s

Change-Id: Idfb71188206c91237d6a3c3a81dfe00d103f11ee
parent 14be7ba6
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env perl
no strict 'refs';
use warnings;
use Getopt::Long;
Getopt::Long::Configure("auto_help");
my %ALL_FUNCS = ();
my @ALL_ARCHS;
my @ALL_FORWARD_DECLS;
my @REQUIRES;
my %opts = ();
my %disabled = ();
my %required = ();
my @argv;
foreach (@ARGV) {
$disabled{$1} = 1, next if /--disable-(.*)/;
$required{$1} = 1, next if /--require-(.*)/;
push @argv, $_;
}
# NB: use GetOptions() instead of GetOptionsFromArray() for compatibility.
@ARGV = @argv;
GetOptions(
\%opts,
'arch=s',
'sym=s',
'config=s',
);
foreach my $opt (qw/arch config/) {
if (!defined($opts{$opt})) {
warn "--$opt is required!\n";
Getopt::Long::HelpMessage('-exit' => 1);
}
}
foreach my $defs_file (@ARGV) {
if (!-f $defs_file) {
warn "$defs_file: $!\n";
Getopt::Long::HelpMessage('-exit' => 1);
}
}
open CONFIG_FILE, $opts{config} or
die "Error opening config file '$opts{config}': $!\n";
my %config = ();
while (<CONFIG_FILE>) {
next if !/^CONFIG_/;
chomp;
my @pair = split /=/;
$config{$pair[0]} = $pair[1];
}
close CONFIG_FILE;
#
# Routines for the RTCD DSL to call
#
sub vpx_config($) {
return (defined $config{$_[0]}) ? $config{$_[0]} : "";
}
sub specialize {
my $fn=$_[0];
shift;
foreach my $opt (@_) {
eval "\$${fn}_${opt}=${fn}_${opt}";
}
}
sub add_proto {
my $fn = splice(@_, -2, 1);
$ALL_FUNCS{$fn} = \@_;
specialize $fn, "c";
}
sub require {
foreach my $fn (keys %ALL_FUNCS) {
foreach my $opt (@_) {
my $ofn = eval "\$${fn}_${opt}";
next if !$ofn;
# if we already have a default, then we can disable it, as we know
# we can do better.
my $best = eval "\$${fn}_default";
if ($best) {
my $best_ofn = eval "\$${best}";
if ($best_ofn && "$best_ofn" ne "$ofn") {
eval "\$${best}_link = 'false'";
}
}
eval "\$${fn}_default=${fn}_${opt}";
eval "\$${fn}_${opt}_link='true'";
}
}
}
sub forward_decls {
push @ALL_FORWARD_DECLS, @_;
}
#
# Include the user's directives
#
foreach my $f (@ARGV) {
open FILE, "<", $f or die "cannot open $f: $!\n";
my $contents = join('', <FILE>);
close FILE;
eval $contents or warn "eval failed: $@\n";
}
#
# Process the directives according to the command line
#
sub process_forward_decls() {
foreach (@ALL_FORWARD_DECLS) {
$_->();
}
}
sub determine_indirection {
vpx_config("CONFIG_RUNTIME_CPU_DETECT") eq "yes" or &require(@ALL_ARCHS);
foreach my $fn (keys %ALL_FUNCS) {
my $n = "";
my @val = @{$ALL_FUNCS{$fn}};
my $args = pop @val;
my $rtyp = "@val";
my $dfn = eval "\$${fn}_default";
$dfn = eval "\$${dfn}";
foreach my $opt (@_) {
my $ofn = eval "\$${fn}_${opt}";
next if !$ofn;
my $link = eval "\$${fn}_${opt}_link";
next if $link && $link eq "false";
$n .= "x";
}
if ($n eq "x") {
eval "\$${fn}_indirect = 'false'";
} else {
eval "\$${fn}_indirect = 'true'";
}
}
}
sub declare_function_pointers {
foreach my $fn (sort keys %ALL_FUNCS) {
my @val = @{$ALL_FUNCS{$fn}};
my $args = pop @val;
my $rtyp = "@val";
my $dfn = eval "\$${fn}_default";
$dfn = eval "\$${dfn}";
foreach my $opt (@_) {
my $ofn = eval "\$${fn}_${opt}";
next if !$ofn;
print "$rtyp ${ofn}($args);\n";
}
if (eval "\$${fn}_indirect" eq "false") {
print "#define ${fn} ${dfn}\n";
} else {
print "RTCD_EXTERN $rtyp (*${fn})($args);\n";
}
print "\n";
}
}
sub set_function_pointers {
foreach my $fn (sort keys %ALL_FUNCS) {
my @val = @{$ALL_FUNCS{$fn}};
my $args = pop @val;
my $rtyp = "@val";
my $dfn = eval "\$${fn}_default";
$dfn = eval "\$${dfn}";
if (eval "\$${fn}_indirect" eq "true") {
print " $fn = $dfn;\n";
foreach my $opt (@_) {
my $ofn = eval "\$${fn}_${opt}";
next if !$ofn;
next if "$ofn" eq "$dfn";
my $link = eval "\$${fn}_${opt}_link";
next if $link && $link eq "false";
my $cond = eval "\$have_${opt}";
print " if (${cond}) $fn = $ofn;\n"
}
}
}
}
sub filter {
my @filtered;
foreach (@_) { push @filtered, $_ unless $disabled{$_}; }
return @filtered;
}
#
# Helper functions for generating the arch specific RTCD files
#
sub common_top() {
my $include_guard = uc($opts{sym})."_H_";
print <<EOF;
#ifndef ${include_guard}
#define ${include_guard}
#ifdef RTCD_C
#define RTCD_EXTERN
#else
#define RTCD_EXTERN extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
EOF
process_forward_decls();
print "\n";
declare_function_pointers("c", @ALL_ARCHS);
print <<EOF;
void $opts{sym}(void);
EOF
}
sub common_bottom() {
print <<EOF;
#ifdef __cplusplus
} // extern "C"
#endif
#endif
EOF
}
sub x86() {
determine_indirection("c", @ALL_ARCHS);
# Assign the helper variable for each enabled extension
foreach my $opt (@ALL_ARCHS) {
my $opt_uc = uc $opt;
eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
}
common_top;
print <<EOF;
#ifdef RTCD_C
#include "vpx_ports/x86.h"
static void setup_rtcd_internal(void)
{
int flags = x86_simd_caps();
(void)flags;
EOF
set_function_pointers("c", @ALL_ARCHS);
print <<EOF;
}
#endif
EOF
common_bottom;
}
sub arm() {
determine_indirection("c", @ALL_ARCHS);
# Assign the helper variable for each enabled extension
foreach my $opt (@ALL_ARCHS) {
my $opt_uc = uc $opt;
eval "\$have_${opt}=\"flags & HAS_${opt_uc}\"";
}
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
#include "vpx_ports/arm.h"
static void setup_rtcd_internal(void)
{
int flags = arm_cpu_caps();
(void)flags;
EOF
set_function_pointers("c", @ALL_ARCHS);
print <<EOF;
}
#endif
EOF
common_bottom;
}
sub mips() {
determine_indirection("c", @ALL_ARCHS);
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
static void setup_rtcd_internal(void)
{
EOF
set_function_pointers("c", @ALL_ARCHS);
print <<EOF;
#if HAVE_DSPR2
#if CONFIG_VP8
void dsputil_static_init();
dsputil_static_init();
#endif
#if CONFIG_VP9
void vp9_dsputil_static_init();
vp9_dsputil_static_init();
#endif
#endif
}
#endif
EOF
common_bottom;
}
sub unoptimized() {
determine_indirection "c";
common_top;
print <<EOF;
#include "vpx_config.h"
#ifdef RTCD_C
static void setup_rtcd_internal(void)
{
EOF
set_function_pointers "c";
print <<EOF;
}
#endif
EOF
common_bottom;
}
#
# Main Driver
#
&require("c");
if ($opts{arch} eq 'x86') {
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
x86;
} elsif ($opts{arch} eq 'x86_64') {
@ALL_ARCHS = filter(qw/mmx sse sse2 sse3 ssse3 sse4_1 avx avx2/);
@REQUIRES = filter(keys %required ? keys %required : qw/mmx sse sse2/);
&require(@REQUIRES);
x86;
} elsif ($opts{arch} eq 'mips32') {
@ALL_ARCHS = filter(qw/mips32/);
open CONFIG_FILE, $opts{config} or
die "Error opening config file '$opts{config}': $!\n";
while (<CONFIG_FILE>) {
if (/HAVE_DSPR2=yes/) {
@ALL_ARCHS = filter(qw/mips32 dspr2/);
last;
}
}
close CONFIG_FILE;
mips;
} elsif ($opts{arch} eq 'armv5te') {
@ALL_ARCHS = filter(qw/edsp/);
arm;
} elsif ($opts{arch} eq 'armv6') {
@ALL_ARCHS = filter(qw/edsp media/);
arm;
} elsif ($opts{arch} eq 'armv7') {
@ALL_ARCHS = filter(qw/edsp media neon/);
arm;
} else {
unoptimized;
}
__END__
=head1 NAME
rtcd -
=head1 SYNOPSIS
Usage: rtcd.pl [options] FILE
See 'perldoc rtcd.pl' for more details.
=head1 DESCRIPTION
Reads the Run Time CPU Detections definitions from FILE and generates a
C header file on stdout.
=head1 OPTIONS
Options:
--arch=ARCH Architecture to generate defs for (required)
--disable-EXT Disable support for EXT extensions
--require-EXT Require support for EXT extensions
--sym=SYMBOL Unique symbol to use for RTCD initialization function
--config=FILE File with CONFIG_FOO=yes lines to parse
#!/bin/sh
self=$0
usage() {
cat <<EOF >&2
Usage: $self [options] FILE
Reads the Run Time CPU Detections definitions from FILE and generates a
C header file on stdout.
Options:
--arch=ARCH Architecture to generate defs for (required)
--disable-EXT Disable support for EXT extensions
--require-EXT Require support for EXT extensions
--sym=SYMBOL Unique symbol to use for RTCD initialization function
--config=FILE File with CONFIG_FOO=yes lines to parse
EOF
exit 1
}
die() {
echo "$@" >&2
exit 1
}
die_argument_required() {
die "Option $opt requires argument"
}
for opt; do
optval="${opt#*=}"
case "$opt" in
--arch) die_argument_required;;
--arch=*) arch=${optval};;
--disable-*) eval "disable_${opt#--disable-}=true";;
--require-*) REQUIRES="${REQUIRES}${opt#--require-} ";;
--sym) die_argument_required;;
--sym=*) symbol=${optval};;
--config=*) config_file=${optval};;
-h|--help)
usage
;;
-*)
die "Unrecognized option: ${opt%%=*}"
;;
*)
defs_file="$defs_file $opt"
;;
esac
shift
done
for f in $defs_file; do [ -f "$f" ] || usage; done
[ -n "$arch" ] || usage
# Import the configuration
[ -f "$config_file" ] && eval $(grep CONFIG_ "$config_file")
#
# Routines for the RTCD DSL to call
#
prototype() {
rtyp=""
case "$1" in
unsigned) rtyp="$1 "; shift;;
esac
rtyp="${rtyp}$1"
fn="$2"
args="$3"
eval "${2}_rtyp='$rtyp'"
eval "${2}_args='$3'"
ALL_FUNCS="$ALL_FUNCS $fn"
specialize $fn c
}
specialize() {
fn="$1"
shift
for opt in "$@"; do
eval "${fn}_${opt}=${fn}_${opt}"
done
}
require() {
for fn in $ALL_FUNCS; do
for opt in "$@"; do
ofn=$(eval "echo \$${fn}_${opt}")
[ -z "$ofn" ] && continue
# if we already have a default, then we can disable it, as we know
# we can do better.
best=$(eval "echo \$${fn}_default")
best_ofn=$(eval "echo \$${best}")
[ -n "$best" ] && [ "$best_ofn" != "$ofn" ] && eval "${best}_link=false"
eval "${fn}_default=${fn}_${opt}"
eval "${fn}_${opt}_link=true"
done
done
}
forward_decls() {
ALL_FORWARD_DECLS="$ALL_FORWARD_DECLS $1"
}
#
# Include the user's directives
#
for f in $defs_file; do
. $f
done
#
# Process the directives according to the command line
#
process_forward_decls() {
for fn in $ALL_FORWARD_DECLS; do
eval $fn
done
}
determine_indirection() {
[ "$CONFIG_RUNTIME_CPU_DETECT" = "yes" ] || require $ALL_ARCHS
for fn in $ALL_FUNCS; do
n=""
rtyp="$(eval "echo \$${fn}_rtyp")"
args="$(eval "echo \"\$${fn}_args\"")"
dfn="$(eval "echo \$${fn}_default")"
dfn=$(eval "echo \$${dfn}")
for opt in "$@"; do
ofn=$(eval "echo \$${fn}_${opt}")
[ -z "$ofn" ] && continue
link=$(eval "echo \$${fn}_${opt}_link")
[ "$link" = "false" ] && continue
n="${n}x"
done
if [ "$n" = "x" ]; then
eval "${fn}_indirect=false"
else
eval "${fn}_indirect=true"
fi
done
}
declare_function_pointers() {
for fn in $ALL_FUNCS; do
rtyp="$(eval "echo \$${fn}_rtyp")"
args="$(eval "echo \"\$${fn}_args\"")"
dfn="$(eval "echo \$${fn}_default")"
dfn=$(eval "echo \$${dfn}")
for opt in "$@"; do
ofn=$(eval "echo \$${fn}_${opt}")
[ -z "$ofn" ] && continue
echo "$rtyp ${ofn}($args);"
done
if [ "$(eval "echo \$${fn}_indirect")" = "false" ]; then
echo "#define ${fn} ${dfn}"
else
echo "RTCD_EXTERN $rtyp (*${fn})($args);"
fi
echo
done
}
set_function_pointers() {
for fn in $ALL_FUNCS; do
n=""
rtyp="$(eval "echo \$${fn}_rtyp")"
args="$(eval "echo \"\$${fn}_args\"")"
dfn="$(eval "echo \$${fn}_default")"
dfn=$(eval "echo \$${dfn}")
if $(eval "echo \$${fn}_indirect"); then
echo " $fn = $dfn;"
for opt in "$@"; do
ofn=$(eval "echo \$${fn}_${opt}")
[ -z "$ofn" ] && continue
[ "$ofn" = "$dfn" ] && continue;
link=$(eval "echo \$${fn}_${opt}_link")
[ "$link" = "false" ] && continue
cond="$(eval "echo \$have_${opt}")"
echo " if (${cond}) $fn = $ofn;"
done
fi
echo
done
}
filter() {
filtered=""
for opt in "$@"; do
[ -z $(eval "echo \$disable_${opt}") ] && filtered="$filtered $opt"
done
echo $filtered
}
#
# Helper functions for generating the arch specific RTCD files
#
common_top() {
outfile_basename=$(basename ${symbol:-rtcd})
include_guard=$(echo $outfile_basename | tr '[a-z]' '[A-Z]' | \
tr -c '[A-Z0-9]' _)H_
cat <<EOF
#ifndef ${include_guard}
#define ${include_guard}
#ifdef RTCD_C
#define RTCD_EXTERN
#else
#define RTCD_EXTERN extern
#endif
#ifdef __cplusplus
extern "C" {
#endif
$(process_forward_decls)
$(declare_function_pointers c $ALL_ARCHS)
void ${symbol:-rtcd}(void);
EOF
}
common_bottom() {
cat <<EOF
#ifdef __cplusplus
} // extern "C"
#endif
#endif
EOF
}
x86() {
determine_indirection c $ALL_ARCHS
# Assign the helper variable for each enabled extension
for opt in $ALL_ARCHS; do
uc=$(echo $opt | tr '[a-z]' '[A-Z]')
eval "have_${opt}=\"flags & HAS_${uc}\""
done
cat <<EOF
$(common_top)
#ifdef RTCD_C
#include "vpx_ports/x86.h"
static void setup_rtcd_internal(void)
{
int flags = x86_simd_caps();
(void)flags;
$(set_function_pointers c $ALL_ARCHS)
}
#endif
$(common_bottom)
EOF
}
arm() {
determine_indirection c $ALL_ARCHS
# Assign the helper variable for each enabled extension
for opt in $ALL_ARCHS; do
uc=$(echo $opt | tr '[a-z]' '[A-Z]')
eval "have_${opt}=\"flags & HAS_${uc}\""
done
cat <<EOF
$(common_top)
#include "vpx_config.h"
#ifdef RTCD_C
#include "vpx_ports/arm.h"
static void setup_rtcd_internal(void)
{
int flags = arm_cpu_caps();
(void)flags;
$(set_function_pointers c $ALL_ARCHS)
}
#endif
$(common_bottom)
EOF
}
mips() {
determine_indirection c $ALL_ARCHS
cat <<EOF
$(common_top)
#include "vpx_config.h"
#ifdef RTCD_C
static void setup_rtcd_internal(void)
{
$(set_function_pointers c $ALL_ARCHS)
#if HAVE_DSPR2
#if CONFIG_VP8
void dsputil_static_init();
dsputil_static_init();
#endif
#if CONFIG_VP9
void vp9_dsputil_static_init();
vp9_dsputil_static_init();
#endif
#endif
}
#endif
$(common_bottom)
EOF
}
unoptimized() {
determine_indirection c
cat <<EOF
$(common_top)
#include "vpx_config.h"
#ifdef RTCD_C
static void setup_rtcd_internal(void)
{
$(set_function_pointers c)
}
#endif
$(common_bottom)
EOF
}
#
# Main Driver
#
ALL_FUNCS=$(export LC_ALL=C; echo $ALL_FUNCS | tr ' ' '\n' | sort |tr '\n' ' ')
require c
case $arch in
x86)
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
x86
;;
x86_64)
ALL_ARCHS=$(filter mmx sse sse2 sse3 ssse3 sse4_1 avx avx2)
REQUIRES=${REQUIRES:-mmx sse sse2}
require $(filter $REQUIRES)
x86
;;
mips32)
ALL_ARCHS=$(filter mips32)
dspr2=$([ -f "$config_file" ] && eval echo $(grep HAVE_DSPR2 "$config_file"))
HAVE_DSPR2="${dspr2#*=}"
if [ "$HAVE_DSPR2" = "yes" ]; then
ALL_ARCHS=$(filter mips32 dspr2)
fi
mips
;;
armv5te)
ALL_ARCHS=$(filter edsp)
arm
;;
armv6)
ALL_ARCHS=$(filter edsp media)
arm
;;
armv7)
ALL_ARCHS=$(filter edsp media neon)
arm
;;
*)
unoptimized
;;
esac
......@@ -49,7 +49,7 @@ endif # !gcc
define rtcd_h_template
$$(BUILD_PFX)$(1).h: $$(SRC_PATH_BARE)/$(2)
@echo " [CREATE] $$@"
$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.sh --arch=$$(TGT_ISA) \
$$(qexec)$$(SRC_PATH_BARE)/build/make/rtcd.pl --arch=$$(TGT_ISA) \
--sym=$(1) \
--config=$$(CONFIG_DIR)$$(target)$$(if $$(FAT_ARCHS),,-$$(TOOLCHAIN)).mk \
$$(RTCD_OPTIONS) $$^ > $$@
......@@ -162,7 +162,7 @@ INSTALL_MAPS += $(foreach p,$(VS_PLATFORMS),$(LIBSUBDIR)/$(p)/% $(p)/Debug/%)
endif
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/version.sh
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.sh
CODEC_SRCS-$(BUILD_LIBVPX) += build/make/rtcd.pl
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/emmintrin_compat.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops.h
CODEC_SRCS-$(BUILD_LIBVPX) += vpx_ports/mem_ops_aligned.h
......
This diff is collapsed.
This diff is collapsed.
......@@ -47,7 +47,7 @@ VP8_COMMON_SRCS-yes += common/quant_common.h
VP8_COMMON_SRCS-yes += common/reconinter.h
VP8_COMMON_SRCS-yes += common/reconintra4x4.h
VP8_COMMON_SRCS-yes += common/rtcd.c
VP8_COMMON_SRCS-yes += common/rtcd_defs.sh
VP8_COMMON_SRCS-yes += common/rtcd_defs.pl
VP8_COMMON_SRCS-yes += common/setupintrarecon.h
VP8_COMMON_SRCS-yes += common/swapyv12buffer.h
VP8_COMMON_SRCS-yes += common/systemdependent.h
......@@ -189,4 +189,4 @@ VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequant_idct_neon.c
VP8_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/dequantizeb_neon.c
$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.sh))
$(eval $(call rtcd_h_template,vp8_rtcd,vp8/common/rtcd_defs.pl))
This diff is collapsed.
This diff is collapsed.
......@@ -45,7 +45,7 @@ VP9_COMMON_SRCS-yes += common/vp9_quant_common.h
VP9_COMMON_SRCS-yes += common/vp9_reconinter.h
VP9_COMMON_SRCS-yes += common/vp9_reconintra.h
VP9_COMMON_SRCS-yes += common/vp9_rtcd.c
VP9_COMMON_SRCS-yes += common/vp9_rtcd_defs.sh
VP9_COMMON_SRCS-yes += common/vp9_rtcd_defs.pl
VP9_COMMON_SRCS-yes += common/vp9_scale.h
VP9_COMMON_SRCS-yes += common/vp9_scale.c
VP9_COMMON_SRCS-yes += common/vp9_seg_common.h
......@@ -145,4 +145,4 @@ VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_avg_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_save_reg_neon$(ASM)
VP9_COMMON_SRCS-$(HAVE_NEON) += common/arm/neon/vp9_reconintra_neon$(ASM)
$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.sh))
$(eval $(call rtcd_h_template,vp9_rtcd,vp9/common/vp9_rtcd_defs.pl))
......@@ -7,7 +7,7 @@ SCALE_SRCS-yes += generic/yv12extend.c
SCALE_SRCS-$(CONFIG_SPATIAL_RESAMPLING) += generic/gen_scalers.c
SCALE_SRCS-yes += vpx_scale_asm_offsets.c
SCALE_SRCS-yes += vpx_scale_rtcd.c
SCALE_SRCS-yes += vpx_scale_rtcd.sh
SCALE_SRCS-yes += vpx_scale_rtcd.pl
#neon
SCALE_SRCS-$(HAVE_NEON) += arm/neon/vp8_vpxyv12_copyframe_func_neon$(ASM)
......@@ -24,4 +24,4 @@ SCALE_SRCS-no += $(SCALE_SRCS_REMOVE-yes)
$(eval $(call asm_offsets_template,\
vpx_scale_asm_offsets.asm, vpx_scale/vpx_scale_asm_offsets.c))
$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.sh))
$(eval $(call rtcd_h_template,vpx_scale_rtcd,vpx_scale/vpx_scale_rtcd.pl))
sub vpx_scale_forward_decls() {
print <<EOF
struct yv12_buffer_config;
EOF
}
forward_decls qw/vpx_scale_forward_decls/;
# Scaler functions
if (vpx_config("CONFIG_SPATIAL_RESAMPLING") eq "yes") {
add_proto qw/void vp8_horizontal_line_5_4_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_5_4_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_horizontal_line_5_3_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_5_3_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_horizontal_line_2_1_scale/, "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_2_1_scale/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
add_proto qw/void vp8_vertical_band_2_1_scale_i/, "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width";
}
add_proto qw/void vp8_yv12_extend_frame_borders/, "struct yv12_buffer_config *ybf";
specialize qw/vp8_yv12_extend_frame_borders neon/;
add_proto qw/void vp8_yv12_copy_frame/, "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc";
specialize qw/vp8_yv12_copy_frame neon/;
add_proto qw/void vpx_yv12_copy_y/, "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc";
specialize qw/vpx_yv12_copy_y neon/;
if (vpx_config("CONFIG_VP9") eq "yes") {
add_proto qw/void vp9_extend_frame_borders/, "struct yv12_buffer_config *ybf";
specialize qw/vp9_extend_frame_borders dspr2/;
add_proto qw/void vp9_extend_frame_inner_borders/, "struct yv12_buffer_config *ybf";
specialize qw/vp9_extend_frame_inner_borders dspr2/;
}
1;
vpx_scale_forward_decls() {
cat <<EOF
struct yv12_buffer_config;
EOF
}
forward_decls vpx_scale_forward_decls
# Scaler functions
if [ "$CONFIG_SPATIAL_RESAMPLING" = "yes" ]; then
prototype void vp8_horizontal_line_5_4_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
prototype void vp8_vertical_band_5_4_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
prototype void vp8_horizontal_line_5_3_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
prototype void vp8_vertical_band_5_3_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
prototype void vp8_horizontal_line_2_1_scale "const unsigned char *source, unsigned int source_width, unsigned char *dest, unsigned int dest_width"
prototype void vp8_vertical_band_2_1_scale "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
prototype void vp8_vertical_band_2_1_scale_i "unsigned char *source, unsigned int src_pitch, unsigned char *dest, unsigned int dest_pitch, unsigned int dest_width"
fi
prototype void vp8_yv12_extend_frame_borders "struct yv12_buffer_config *ybf"
specialize vp8_yv12_extend_frame_borders neon
prototype void vp8_yv12_copy_frame "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
specialize vp8_yv12_copy_frame neon
prototype void vpx_yv12_copy_y "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
specialize vpx_yv12_copy_y neon
if [ "$CONFIG_VP9" = "yes" ]; then
prototype void vp9_extend_frame_borders "struct yv12_buffer_config *ybf"
specialize vp9_extend_frame_borders dspr2
prototype void vp9_extend_frame_inner_borders "struct yv12_buffer_config *ybf"
specialize vp9_extend_frame_inner_borders dspr2
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment