Commit 3caefbda authored by Kyle Siefring's avatar Kyle Siefring Committed by GitHub

Hookup avx2 subpel code (#851)

parent 07032e6b
......@@ -48,7 +48,16 @@ fn main() {
let mut config_include_arg = String::from("-I");
config_include_arg.push_str(&out_dir);
config_include_arg.push('/');
nasm_rs::compile_library_args("rav1easm", &["src/x86/ipred.asm", "src/x86/me.asm"], &[&config_include_arg, "-Isrc/"]);
nasm_rs::compile_library_args(
"rav1easm",
&[
"src/x86/data.asm",
"src/x86/ipred.asm",
"src/x86/mc.asm",
"src/x86/me.asm"
],
&[&config_include_arg, "-Isrc/"]
);
println!("cargo:rustc-link-lib=static=rav1easm");
rerun_dir("src/x86");
rerun_dir("src/ext/x86");
......
This diff is collapsed.
......@@ -1142,8 +1142,9 @@ impl PredictionMode {
height,
col_frac,
row_frac,
fi.sequence.bit_depth,
mode
mode,
mode,
fi.sequence.bit_depth
);
}
None => ()
......@@ -1165,8 +1166,9 @@ impl PredictionMode {
height,
col_frac,
row_frac,
fi.sequence.bit_depth,
mode
mode,
mode,
fi.sequence.bit_depth
);
}
None => ()
......
......@@ -230,3 +230,17 @@ pub fn msb(x: i32) -> i32 {
pub fn round_shift(value: i32, bit: usize) -> i32 {
(value + (1 << bit >> 1)) >> bit
}
pub fn convert_slice_2d<NEW: 'static + Copy, OLD: AsPrimitive<NEW>>(
dst: &mut [NEW], dst_stride: usize, src: &[OLD], src_stride: usize,
width: usize, height: usize
) {
for r in 0..height {
for (a, b) in dst[r * dst_stride..r * dst_stride + width]
.iter_mut()
.zip(src[r * src_stride..r * src_stride + width].iter())
{
*a = (*b).as_();
}
}
}
; Copyright (c) 2018, The rav1e contributors. All rights reserved
;
; This source code is subject to the terms of the BSD 2 Clause License and
; the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
; was not distributed with this source code in the LICENSE file, you can
; obtain it at www.aomedia.org/license/software. If the Alliance for Open
; Media Patent License 1.0 was not distributed with this source code in the
; PATENTS file, you can obtain it at www.aomedia.org/license/patent.
; Copyright © 2018, VideoLAN and dav1d authors
; Copyright © 2018, Two Orioles, LLC
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice, this
; list of conditions and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
; this list of conditions and the following disclaimer in the documentation
; and/or other materials provided with the distribution.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
; WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
; DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
; ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
; (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
; ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
%include "config.asm"
%include "ext/x86/x86inc.asm"
SECTION_RODATA 8
const mc_subpel_filters, db 0, 1, -3, 63, 4, -1, 0, 0, ; REGULAR
db 0, 1, -5, 61, 9, -2, 0, 0,
db 0, 1, -6, 58, 14, -4, 1, 0,
db 0, 1, -7, 55, 19, -5, 1, 0,
db 0, 1, -7, 51, 24, -6, 1, 0,
db 0, 1, -8, 47, 29, -6, 1, 0,
db 0, 1, -7, 42, 33, -6, 1, 0,
db 0, 1, -7, 38, 38, -7, 1, 0,
db 0, 1, -6, 33, 42, -7, 1, 0,
db 0, 1, -6, 29, 47, -8, 1, 0,
db 0, 1, -6, 24, 51, -7, 1, 0,
db 0, 1, -5, 19, 55, -7, 1, 0,
db 0, 1, -4, 14, 58, -6, 1, 0,
db 0, 0, -2, 9, 61, -5, 1, 0,
db 0, 0, -1, 4, 63, -3, 1, 0,
db 0, 1, 14, 31, 17, 1, 0, 0, ; SMOOTH
db 0, 0, 13, 31, 18, 2, 0, 0,
db 0, 0, 11, 31, 20, 2, 0, 0,
db 0, 0, 10, 30, 21, 3, 0, 0,
db 0, 0, 9, 29, 22, 4, 0, 0,
db 0, 0, 8, 28, 23, 5, 0, 0,
db 0, -1, 8, 27, 24, 6, 0, 0,
db 0, -1, 7, 26, 26, 7, -1, 0,
db 0, 0, 6, 24, 27, 8, -1, 0,
db 0, 0, 5, 23, 28, 8, 0, 0,
db 0, 0, 4, 22, 29, 9, 0, 0,
db 0, 0, 3, 21, 30, 10, 0, 0,
db 0, 0, 2, 20, 31, 11, 0, 0,
db 0, 0, 2, 18, 31, 13, 0, 0,
db 0, 0, 1, 17, 31, 14, 1, 0,
db -1, 1, -3, 63, 4, -1, 1, 0, ; SHARP
db -1, 3, -6, 62, 8, -3, 2, -1,
db -1, 4, -9, 60, 13, -5, 3, -1,
db -2, 5, -11, 58, 19, -7, 3, -1,
db -2, 5, -11, 54, 24, -9, 4, -1,
db -2, 5, -12, 50, 30, -10, 4, -1,
db -2, 5, -12, 45, 35, -11, 5, -1,
db -2, 6, -12, 40, 40, -12, 6, -2,
db -1, 5, -11, 35, 45, -12, 5, -2,
db -1, 4, -10, 30, 50, -12, 5, -2,
db -1, 4, -9, 24, 54, -11, 5, -2,
db -1, 3, -7, 19, 58, -11, 5, -2,
db -1, 3, -5, 13, 60, -9, 4, -1,
db -1, 2, -3, 8, 62, -6, 3, -1,
db 0, 1, -1, 4, 63, -3, 1, -1,
db 0, 0, -2, 63, 4, -1, 0, 0, ; REGULAR 4
db 0, 0, -4, 61, 9, -2, 0, 0,
db 0, 0, -5, 58, 14, -3, 0, 0,
db 0, 0, -6, 55, 19, -4, 0, 0,
db 0, 0, -6, 51, 24, -5, 0, 0,
db 0, 0, -7, 47, 29, -5, 0, 0,
db 0, 0, -6, 42, 33, -5, 0, 0,
db 0, 0, -6, 38, 38, -6, 0, 0,
db 0, 0, -5, 33, 42, -6, 0, 0,
db 0, 0, -5, 29, 47, -7, 0, 0,
db 0, 0, -5, 24, 51, -6, 0, 0,
db 0, 0, -4, 19, 55, -6, 0, 0,
db 0, 0, -3, 14, 58, -5, 0, 0,
db 0, 0, -2, 9, 61, -4, 0, 0,
db 0, 0, -1, 4, 63, -2, 0, 0,
db 0, 0, 15, 31, 17, 1, 0, 0, ; SMOOTH 4
db 0, 0, 13, 31, 18, 2, 0, 0,
db 0, 0, 11, 31, 20, 2, 0, 0,
db 0, 0, 10, 30, 21, 3, 0, 0,
db 0, 0, 9, 29, 22, 4, 0, 0,
db 0, 0, 8, 28, 23, 5, 0, 0,
db 0, 0, 7, 27, 24, 6, 0, 0,
db 0, 0, 6, 26, 26, 6, 0, 0,
db 0, 0, 6, 24, 27, 7, 0, 0,
db 0, 0, 5, 23, 28, 8, 0, 0,
db 0, 0, 4, 22, 29, 9, 0, 0,
db 0, 0, 3, 21, 30, 10, 0, 0,
db 0, 0, 2, 20, 31, 11, 0, 0,
db 0, 0, 2, 18, 31, 13, 0, 0,
db 0, 0, 1, 17, 31, 15, 0, 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment