yading@10: /* yading@10: * DSP functions for Indeo Video Interactive codecs (Indeo4 and Indeo5) yading@10: * yading@10: * Copyright (c) 2009-2011 Maxim Poliakovski yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: /** yading@10: * @file yading@10: * DSP functions (inverse transforms, motion compensations, wavelet recompostion) yading@10: * for Indeo Video Interactive codecs. yading@10: */ yading@10: yading@10: #ifndef AVCODEC_IVI_DSP_H yading@10: #define AVCODEC_IVI_DSP_H yading@10: yading@10: #include "avcodec.h" yading@10: #include "ivi_common.h" yading@10: yading@10: /** yading@10: * 5/3 wavelet recomposition filter for Indeo5 yading@10: * yading@10: * @param[in] plane pointer to the descriptor of the plane being processed yading@10: * @param[out] dst pointer to the destination buffer yading@10: * @param[in] dst_pitch pitch of the destination buffer yading@10: */ yading@10: void ff_ivi_recompose53(const IVIPlaneDesc *plane, uint8_t *dst, yading@10: const int dst_pitch); yading@10: yading@10: /** yading@10: * Haar wavelet recomposition filter for Indeo 4 yading@10: * yading@10: * @param[in] plane pointer to the descriptor of the plane being processed yading@10: * @param[out] dst pointer to the destination buffer yading@10: * @param[in] dst_pitch pitch of the destination buffer yading@10: */ yading@10: void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst, yading@10: const int dst_pitch); yading@10: yading@10: /** yading@10: * two-dimensional inverse Haar 8x8 transform for Indeo 4 yading@10: * yading@10: * @param[in] in pointer to the vector of transform coefficients yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] flags pointer to the array of column flags: yading@10: * != 0 - non_empty column, 0 - empty one yading@10: * (this array must be filled by caller) yading@10: */ yading@10: void ff_ivi_inverse_haar_8x8(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: const uint8_t *flags); yading@10: yading@10: /** yading@10: * DC-only two-dimensional inverse Haar transform for Indeo 4. yading@10: * Performing the inverse transform in this case is equivalent to yading@10: * spreading DC_coeff >> 3 over the whole block. yading@10: * yading@10: * @param[in] in pointer to the dc coefficient yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] blk_size transform block size yading@10: */ yading@10: void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: int blk_size); yading@10: yading@10: /** yading@10: * two-dimensional inverse slant 8x8 transform yading@10: * yading@10: * @param[in] in pointer to the vector of transform coefficients yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] flags pointer to the array of column flags: yading@10: * != 0 - non_empty column, 0 - empty one yading@10: * (this array must be filled by caller) yading@10: */ yading@10: void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: const uint8_t *flags); yading@10: yading@10: /** yading@10: * two-dimensional inverse slant 4x4 transform yading@10: * yading@10: * @param[in] in pointer to the vector of transform coefficients yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] flags pointer to the array of column flags: yading@10: * != 0 - non_empty column, 0 - empty one yading@10: * (this array must be filled by caller) yading@10: */ yading@10: void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: const uint8_t *flags); yading@10: yading@10: /** yading@10: * DC-only two-dimensional inverse slant transform. yading@10: * Performing the inverse slant transform in this case is equivalent to yading@10: * spreading (DC_coeff + 1)/2 over the whole block. yading@10: * It works much faster than performing the slant transform on a vector of zeroes. yading@10: * yading@10: * @param[in] in pointer to the dc coefficient yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] blk_size transform block size yading@10: */ yading@10: void ff_ivi_dc_slant_2d(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); yading@10: yading@10: /** yading@10: * inverse 1D row slant transform yading@10: * yading@10: * @param[in] in pointer to the vector of transform coefficients yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] flags pointer to the array of column flags (unused here) yading@10: */ yading@10: void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: const uint8_t *flags); yading@10: yading@10: /** yading@10: * inverse 1D column slant transform yading@10: * yading@10: * @param[in] in pointer to the vector of transform coefficients yading@10: * @param[out] out pointer to the output buffer (frame) yading@10: * @param[in] pitch pitch to move to the next y line yading@10: * @param[in] flags pointer to the array of column flags: yading@10: * != 0 - non_empty column, 0 - empty one yading@10: * (this array must be filled by caller) yading@10: */ yading@10: void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, yading@10: const uint8_t *flags); yading@10: yading@10: /** yading@10: * DC-only inverse row slant transform yading@10: */ yading@10: void ff_ivi_dc_row_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); yading@10: yading@10: /** yading@10: * DC-only inverse column slant transform yading@10: */ yading@10: void ff_ivi_dc_col_slant(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); yading@10: yading@10: /** yading@10: * Copy the pixels into the frame buffer. yading@10: */ yading@10: void ff_ivi_put_pixels_8x8(const int32_t *in, int16_t *out, uint32_t pitch, const uint8_t *flags); yading@10: yading@10: /** yading@10: * Copy the DC coefficient into the first pixel of the block and yading@10: * zero all others. yading@10: */ yading@10: void ff_ivi_put_dc_pixel_8x8(const int32_t *in, int16_t *out, uint32_t pitch, int blk_size); yading@10: yading@10: /** yading@10: * 8x8 block motion compensation with adding delta yading@10: * yading@10: * @param[in,out] buf pointer to the block in the current frame buffer containing delta yading@10: * @param[in] ref_buf pointer to the corresponding block in the reference frame yading@10: * @param[in] pitch pitch for moving to the next y line yading@10: * @param[in] mc_type interpolation type yading@10: */ yading@10: void ff_ivi_mc_8x8_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); yading@10: yading@10: /** yading@10: * 4x4 block motion compensation with adding delta yading@10: * yading@10: * @param[in,out] buf pointer to the block in the current frame buffer containing delta yading@10: * @param[in] ref_buf pointer to the corresponding block in the reference frame yading@10: * @param[in] pitch pitch for moving to the next y line yading@10: * @param[in] mc_type interpolation type yading@10: */ yading@10: void ff_ivi_mc_4x4_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); yading@10: yading@10: /** yading@10: * motion compensation without adding delta yading@10: * yading@10: * @param[in,out] buf pointer to the block in the current frame receiving the result yading@10: * @param[in] ref_buf pointer to the corresponding block in the reference frame yading@10: * @param[in] pitch pitch for moving to the next y line yading@10: * @param[in] mc_type interpolation type yading@10: */ yading@10: void ff_ivi_mc_8x8_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); yading@10: yading@10: /** yading@10: * 4x4 block motion compensation without adding delta yading@10: * yading@10: * @param[in,out] buf pointer to the block in the current frame receiving the result yading@10: * @param[in] ref_buf pointer to the corresponding block in the reference frame yading@10: * @param[in] pitch pitch for moving to the next y line yading@10: * @param[in] mc_type interpolation type yading@10: */ yading@10: void ff_ivi_mc_4x4_no_delta(int16_t *buf, const int16_t *ref_buf, uint32_t pitch, int mc_type); yading@10: yading@10: #endif /* AVCODEC_IVI_DSP_H */