2011-02-17 21:45:03 +02:00
|
|
|
/*
|
|
|
|
* VC-1 and WMV3 decoder - DSP functions
|
|
|
|
* Copyright (c) 2006 Konstantin Shishkov
|
|
|
|
*
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* VC-1 and WMV3 decoder
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AVCODEC_VC1DSP_H
|
|
|
|
#define AVCODEC_VC1DSP_H
|
|
|
|
|
2013-03-11 00:23:46 +03:00
|
|
|
#include "hpeldsp.h"
|
2013-01-19 05:34:47 +03:00
|
|
|
#include "h264chroma.h"
|
2011-02-17 21:45:03 +02:00
|
|
|
|
2013-03-13 16:31:39 +03:00
|
|
|
typedef void (*vc1op_pixels_func)(uint8_t *block/*align width (8 or 16)*/, const uint8_t *pixels/*align 1*/, ptrdiff_t line_size, int h);
|
2013-02-06 15:16:31 +03:00
|
|
|
|
2011-02-17 21:45:03 +02:00
|
|
|
typedef struct VC1DSPContext {
|
|
|
|
/* vc1 functions */
|
2013-01-20 03:02:29 +03:00
|
|
|
void (*vc1_inv_trans_8x8)(int16_t *b);
|
2016-09-07 17:02:06 +02:00
|
|
|
void (*vc1_inv_trans_8x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_4x8)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_4x4)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_8x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_8x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_4x8_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
|
|
|
void (*vc1_inv_trans_4x4_dc)(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
2022-03-29 14:34:19 +02:00
|
|
|
void (*vc1_v_overlap)(uint8_t *src, ptrdiff_t stride);
|
|
|
|
void (*vc1_h_overlap)(uint8_t *src, ptrdiff_t stride);
|
2013-01-20 03:02:29 +03:00
|
|
|
void (*vc1_v_s_overlap)(int16_t *top, int16_t *bottom);
|
2022-03-29 14:34:19 +02:00
|
|
|
void (*vc1_h_s_overlap)(int16_t *left, int16_t *right, ptrdiff_t left_stride, ptrdiff_t right_stride, int flags);
|
|
|
|
void (*vc1_v_loop_filter4)(uint8_t *src, ptrdiff_t stride, int pq);
|
|
|
|
void (*vc1_h_loop_filter4)(uint8_t *src, ptrdiff_t stride, int pq);
|
|
|
|
void (*vc1_v_loop_filter8)(uint8_t *src, ptrdiff_t stride, int pq);
|
|
|
|
void (*vc1_h_loop_filter8)(uint8_t *src, ptrdiff_t stride, int pq);
|
|
|
|
void (*vc1_v_loop_filter16)(uint8_t *src, ptrdiff_t stride, int pq);
|
|
|
|
void (*vc1_h_loop_filter16)(uint8_t *src, ptrdiff_t stride, int pq);
|
2011-02-17 21:45:03 +02:00
|
|
|
|
|
|
|
/* put 8x8 block with bicubic interpolation and quarterpel precision
|
|
|
|
* last argument is actually round value instead of height
|
|
|
|
*/
|
2014-04-11 22:02:08 +03:00
|
|
|
vc1op_pixels_func put_vc1_mspel_pixels_tab[2][16];
|
|
|
|
vc1op_pixels_func avg_vc1_mspel_pixels_tab[2][16];
|
2011-02-17 21:45:03 +02:00
|
|
|
|
|
|
|
/* This is really one func used in VC-1 decoding */
|
|
|
|
h264_chroma_mc_func put_no_rnd_vc1_chroma_pixels_tab[3];
|
|
|
|
h264_chroma_mc_func avg_no_rnd_vc1_chroma_pixels_tab[3];
|
2011-08-17 15:24:42 +03:00
|
|
|
|
|
|
|
/* Windows Media Image functions */
|
|
|
|
void (*sprite_h)(uint8_t *dst, const uint8_t *src, int offset, int advance, int count);
|
|
|
|
void (*sprite_v_single)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset, int width);
|
|
|
|
void (*sprite_v_double_noscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src2a, int alpha, int width);
|
|
|
|
void (*sprite_v_double_onescale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
|
|
|
|
const uint8_t *src2a, int alpha, int width);
|
|
|
|
void (*sprite_v_double_twoscale)(uint8_t *dst, const uint8_t *src1a, const uint8_t *src1b, int offset1,
|
|
|
|
const uint8_t *src2a, const uint8_t *src2b, int offset2,
|
|
|
|
int alpha, int width);
|
2014-04-16 03:51:32 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Search buf from the start for up to size bytes. Return the index
|
|
|
|
* of a zero byte, or >= size if not found. Ideally, use lookahead
|
|
|
|
* to filter out any zero bytes that are known to not be followed by
|
|
|
|
* one or more further zero bytes and a one byte.
|
|
|
|
*/
|
2014-07-21 16:53:08 +03:00
|
|
|
int (*startcode_find_candidate)(const uint8_t *buf, int size);
|
2022-03-31 19:23:45 +02:00
|
|
|
|
|
|
|
/* Copy a buffer, removing startcode emulation escape bytes as we go */
|
|
|
|
int (*vc1_unescape_buffer)(const uint8_t *src, int size, uint8_t *dst);
|
2011-02-17 21:45:03 +02:00
|
|
|
} VC1DSPContext;
|
|
|
|
|
|
|
|
void ff_vc1dsp_init(VC1DSPContext* c);
|
2013-12-10 22:16:08 +03:00
|
|
|
void ff_vc1dsp_init_aarch64(VC1DSPContext* dsp);
|
2013-12-15 04:32:56 +03:00
|
|
|
void ff_vc1dsp_init_arm(VC1DSPContext* dsp);
|
2013-04-14 15:47:30 +03:00
|
|
|
void ff_vc1dsp_init_ppc(VC1DSPContext *c);
|
2023-12-01 04:07:40 +02:00
|
|
|
void ff_vc1dsp_init_riscv(VC1DSPContext *c);
|
2012-10-07 18:41:10 +03:00
|
|
|
void ff_vc1dsp_init_x86(VC1DSPContext* dsp);
|
2016-10-10 10:11:37 +02:00
|
|
|
void ff_vc1dsp_init_mips(VC1DSPContext* dsp);
|
2021-12-18 16:27:57 +02:00
|
|
|
void ff_vc1dsp_init_loongarch(VC1DSPContext* dsp);
|
2011-02-17 21:45:03 +02:00
|
|
|
|
|
|
|
#endif /* AVCODEC_VC1DSP_H */
|