2014-12-23 22:24:37 +05:30
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2003 Michael Niedermayer <michaelni@gmx.at>
|
|
|
|
|
* Copyright (C) 2005 Nikolaj Poroshin <porosh3@psu.ru>
|
|
|
|
|
* Copyright (c) 2014 Arwa Arif <arwaarif1994@gmail.com>
|
|
|
|
|
*
|
|
|
|
|
* This file is part of FFmpeg.
|
|
|
|
|
*
|
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 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 General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2025-11-09 17:06:46 +01:00
|
|
|
#ifndef AVFILTER_FSPPDSP_H
|
|
|
|
|
#define AVFILTER_FSPPDSP_H
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-09 17:06:46 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
#include <stdint.h>
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-09 17:06:46 +01:00
|
|
|
#include "config.h"
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-09 17:06:46 +01:00
|
|
|
#include "libavutil/attributes_internal.h"
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-09 17:06:46 +01:00
|
|
|
typedef struct FSPPDSPContext {
|
2025-11-10 23:03:23 +01:00
|
|
|
void (*store_slice)(uint8_t *restrict dst, int16_t *restrict src /* align 16 */,
|
2014-12-23 22:24:37 +05:30
|
|
|
ptrdiff_t dst_stride, ptrdiff_t src_stride,
|
|
|
|
|
ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
|
|
|
|
|
|
2025-11-10 23:03:23 +01:00
|
|
|
void (*store_slice2)(uint8_t *restrict dst, int16_t *restrict src /* align 16 */,
|
2014-12-23 22:24:37 +05:30
|
|
|
ptrdiff_t dst_stride, ptrdiff_t src_stride,
|
|
|
|
|
ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
|
|
|
|
|
|
2025-11-12 23:15:24 +01:00
|
|
|
void (*mul_thrmat)(const int16_t *restrict thr_adr_noq /* align 16 */,
|
2025-11-10 23:03:23 +01:00
|
|
|
int16_t *restrict thr_adr /* align 16 */, int q);
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-12 23:15:24 +01:00
|
|
|
void (*column_fidct)(const int16_t *restrict thr_adr, const int16_t *restrict data,
|
2025-11-10 23:03:23 +01:00
|
|
|
int16_t *restrict output, int cnt);
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-12 23:15:24 +01:00
|
|
|
void (*row_idct)(const int16_t *restrict workspace, int16_t *restrict output_adr,
|
2014-12-26 15:37:54 -03:00
|
|
|
ptrdiff_t output_stride, int cnt);
|
2014-12-23 22:24:37 +05:30
|
|
|
|
2025-11-10 23:03:23 +01:00
|
|
|
void (*row_fdct)(int16_t *restrict data, const uint8_t *restrict pixels,
|
2014-12-26 15:37:54 -03:00
|
|
|
ptrdiff_t line_size, int cnt);
|
2025-11-09 17:06:46 +01:00
|
|
|
} FSPPDSPContext;
|
|
|
|
|
|
|
|
|
|
FF_VISIBILITY_PUSH_HIDDEN
|
2025-11-09 17:27:16 +01:00
|
|
|
extern const uint8_t ff_fspp_dither[8][8];
|
|
|
|
|
|
2025-11-10 23:03:23 +01:00
|
|
|
void ff_store_slice_c(uint8_t *restrict dst, int16_t *restrict src,
|
2025-11-09 17:06:46 +01:00
|
|
|
ptrdiff_t dst_stride, ptrdiff_t src_stride,
|
|
|
|
|
ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
|
2025-11-10 23:03:23 +01:00
|
|
|
void ff_store_slice2_c(uint8_t *restrict dst, int16_t *restrict src,
|
2025-11-09 17:06:46 +01:00
|
|
|
ptrdiff_t dst_stride, ptrdiff_t src_stride,
|
|
|
|
|
ptrdiff_t width, ptrdiff_t height, ptrdiff_t log2_scale);
|
2025-11-12 23:15:24 +01:00
|
|
|
void ff_mul_thrmat_c(const int16_t *restrict thr_adr_noq, int16_t *restrict thr_adr, int q);
|
|
|
|
|
void ff_column_fidct_c(const int16_t *restrict thr_adr, const int16_t *restrict data,
|
2025-11-10 23:03:23 +01:00
|
|
|
int16_t *restrict output, int cnt);
|
2025-11-12 23:15:24 +01:00
|
|
|
void ff_row_idct_c(const int16_t *restrict workspace, int16_t *restrict output_adr,
|
2025-11-10 23:03:23 +01:00
|
|
|
ptrdiff_t output_stride, int cnt);
|
|
|
|
|
void ff_row_fdct_c(int16_t *restrict data, const uint8_t *restrict pixels,
|
|
|
|
|
ptrdiff_t line_size, int cnt);
|
2025-11-09 17:06:46 +01:00
|
|
|
|
|
|
|
|
void ff_fsppdsp_init_x86(FSPPDSPContext *fspp);
|
|
|
|
|
FF_VISIBILITY_POP_HIDDEN
|
|
|
|
|
|
|
|
|
|
static inline void ff_fsppdsp_init(FSPPDSPContext *fspp)
|
|
|
|
|
{
|
|
|
|
|
fspp->store_slice = ff_store_slice_c;
|
|
|
|
|
fspp->store_slice2 = ff_store_slice2_c;
|
|
|
|
|
fspp->mul_thrmat = ff_mul_thrmat_c;
|
|
|
|
|
fspp->column_fidct = ff_column_fidct_c;
|
|
|
|
|
fspp->row_idct = ff_row_idct_c;
|
|
|
|
|
fspp->row_fdct = ff_row_fdct_c;
|
|
|
|
|
|
|
|
|
|
#if ARCH_X86
|
|
|
|
|
ff_fsppdsp_init_x86(fspp);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif /* AVFILTER_FSPPDSP_H */
|