1cabdff1aSopenharmony_ci/* 2cabdff1aSopenharmony_ci * Format Conversion Utils 3cabdff1aSopenharmony_ci * Copyright (c) 2000, 2001 Fabrice Bellard 4cabdff1aSopenharmony_ci * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> 5cabdff1aSopenharmony_ci * 6cabdff1aSopenharmony_ci * This file is part of FFmpeg. 7cabdff1aSopenharmony_ci * 8cabdff1aSopenharmony_ci * FFmpeg is free software; you can redistribute it and/or 9cabdff1aSopenharmony_ci * modify it under the terms of the GNU Lesser General Public 10cabdff1aSopenharmony_ci * License as published by the Free Software Foundation; either 11cabdff1aSopenharmony_ci * version 2.1 of the License, or (at your option) any later version. 12cabdff1aSopenharmony_ci * 13cabdff1aSopenharmony_ci * FFmpeg is distributed in the hope that it will be useful, 14cabdff1aSopenharmony_ci * but WITHOUT ANY WARRANTY; without even the implied warranty of 15cabdff1aSopenharmony_ci * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16cabdff1aSopenharmony_ci * Lesser General Public License for more details. 17cabdff1aSopenharmony_ci * 18cabdff1aSopenharmony_ci * You should have received a copy of the GNU Lesser General Public 19cabdff1aSopenharmony_ci * License along with FFmpeg; if not, write to the Free Software 20cabdff1aSopenharmony_ci * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 21cabdff1aSopenharmony_ci */ 22cabdff1aSopenharmony_ci 23cabdff1aSopenharmony_ci#ifndef AVCODEC_FMTCONVERT_H 24cabdff1aSopenharmony_ci#define AVCODEC_FMTCONVERT_H 25cabdff1aSopenharmony_ci 26cabdff1aSopenharmony_ci#include "avcodec.h" 27cabdff1aSopenharmony_ci 28cabdff1aSopenharmony_citypedef struct FmtConvertContext { 29cabdff1aSopenharmony_ci /** 30cabdff1aSopenharmony_ci * Convert an array of int32_t to float and multiply by a float value. 31cabdff1aSopenharmony_ci * @param dst destination array of float. 32cabdff1aSopenharmony_ci * constraints: 16-byte aligned 33cabdff1aSopenharmony_ci * @param src source array of int32_t. 34cabdff1aSopenharmony_ci * constraints: 16-byte aligned 35cabdff1aSopenharmony_ci * @param len number of elements to convert. 36cabdff1aSopenharmony_ci * constraints: multiple of 8 37cabdff1aSopenharmony_ci */ 38cabdff1aSopenharmony_ci void (*int32_to_float_fmul_scalar)(float *dst, const int32_t *src, 39cabdff1aSopenharmony_ci float mul, int len); 40cabdff1aSopenharmony_ci /** 41cabdff1aSopenharmony_ci * Convert an array of int32_t to float. 42cabdff1aSopenharmony_ci * @param dst destination array of float. 43cabdff1aSopenharmony_ci * constraints: 32-byte aligned 44cabdff1aSopenharmony_ci * @param src source array of int32_t. 45cabdff1aSopenharmony_ci * constraints: 32-byte aligned 46cabdff1aSopenharmony_ci * @param len number of elements to convert. 47cabdff1aSopenharmony_ci * constraints: multiple of 8 48cabdff1aSopenharmony_ci */ 49cabdff1aSopenharmony_ci void (*int32_to_float)(float *dst, const int32_t *src, intptr_t len); 50cabdff1aSopenharmony_ci 51cabdff1aSopenharmony_ci /** 52cabdff1aSopenharmony_ci * Convert an array of int32_t to float and multiply by a float value from another array, 53cabdff1aSopenharmony_ci * stepping along the float array once for each 8 integers. 54cabdff1aSopenharmony_ci * @param c pointer to FmtConvertContext. 55cabdff1aSopenharmony_ci * @param dst destination array of float. 56cabdff1aSopenharmony_ci * constraints: 16-byte aligned 57cabdff1aSopenharmony_ci * @param src source array of int32_t. 58cabdff1aSopenharmony_ci * constraints: 16-byte aligned 59cabdff1aSopenharmony_ci * @param mul source array of float multipliers. 60cabdff1aSopenharmony_ci * @param len number of elements to convert. 61cabdff1aSopenharmony_ci * constraints: multiple of 8 62cabdff1aSopenharmony_ci */ 63cabdff1aSopenharmony_ci void (*int32_to_float_fmul_array8)(struct FmtConvertContext *c, 64cabdff1aSopenharmony_ci float *dst, const int32_t *src, 65cabdff1aSopenharmony_ci const float *mul, int len); 66cabdff1aSopenharmony_ci 67cabdff1aSopenharmony_ci} FmtConvertContext; 68cabdff1aSopenharmony_ci 69cabdff1aSopenharmony_civoid ff_fmt_convert_init(FmtConvertContext *c, AVCodecContext *avctx); 70cabdff1aSopenharmony_ci 71cabdff1aSopenharmony_civoid ff_fmt_convert_init_aarch64(FmtConvertContext *c, AVCodecContext *avctx); 72cabdff1aSopenharmony_civoid ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx); 73cabdff1aSopenharmony_civoid ff_fmt_convert_init_ppc(FmtConvertContext *c, AVCodecContext *avctx); 74cabdff1aSopenharmony_civoid ff_fmt_convert_init_x86(FmtConvertContext *c, AVCodecContext *avctx); 75cabdff1aSopenharmony_civoid ff_fmt_convert_init_mips(FmtConvertContext *c); 76cabdff1aSopenharmony_ci 77cabdff1aSopenharmony_ci#endif /* AVCODEC_FMTCONVERT_H */ 78