1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Merge commit 'bf6b3ec924b4fb64d14df33077f4d4541d525dbf'

* commit 'bf6b3ec924b4fb64d14df33077f4d4541d525dbf':
  dsputil: Move rnd_avg inline functions to a separate header

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-09 14:01:40 +01:00
commit 81a11452f8
7 changed files with 52 additions and 23 deletions

View File

@ -17,6 +17,7 @@
*/ */
#include "dsputil.h" #include "dsputil.h"
#include "rnd_avg.h"
#ifndef BIT_DEPTH #ifndef BIT_DEPTH
#define BIT_DEPTH 8 #define BIT_DEPTH 8

View File

@ -420,29 +420,6 @@ int ff_check_alignment(void);
void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type); void ff_set_cmp(DSPContext* c, me_cmp_func *cmp, int type);
#define BYTE_VEC32(c) ((c)*0x01010101UL)
#define BYTE_VEC64(c) ((c)*0x0001000100010001UL)
static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
{
return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
}
static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
{
return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
}
static inline uint64_t rnd_avg64(uint64_t a, uint64_t b)
{
return (a | b) - (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
}
static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b)
{
return (a & b) + (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
}
void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_alpha(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx);
void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx); void ff_dsputil_init_bfin(DSPContext* c, AVCodecContext *avctx);

47
libavcodec/rnd_avg.h Normal file
View File

@ -0,0 +1,47 @@
/*
* This file is part of Libav.
*
* Libav 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.
*
* Libav 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 Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef AVCODEC_RND_AVG_H
#define AVCODEC_RND_AVG_H
#include <stdint.h>
#define BYTE_VEC32(c) ((c)*0x01010101UL)
#define BYTE_VEC64(c) ((c)*0x0001000100010001UL)
static inline uint32_t rnd_avg32(uint32_t a, uint32_t b)
{
return (a | b) - (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
}
static inline uint32_t no_rnd_avg32(uint32_t a, uint32_t b)
{
return (a & b) + (((a ^ b) & ~BYTE_VEC32(0x01)) >> 1);
}
static inline uint64_t rnd_avg64(uint64_t a, uint64_t b)
{
return (a | b) - (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
}
static inline uint64_t no_rnd_avg64(uint64_t a, uint64_t b)
{
return (a & b) + (((a ^ b) & ~BYTE_VEC64(0x01)) >> 1);
}
#endif /* AVCODEC_RND_AVG_H */

View File

@ -23,6 +23,7 @@
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavcodec/avcodec.h" #include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h" #include "libavcodec/dsputil.h"
#include "libavcodec/rnd_avg.h"
#include "dsputil_sh4.h" #include "dsputil_sh4.h"

View File

@ -23,6 +23,7 @@
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavcodec/copy_block.h" #include "libavcodec/copy_block.h"
#include "libavcodec/rnd_avg.h"
#define PIXOP2(OPNAME, OP) \ #define PIXOP2(OPNAME, OP) \
\ \

View File

@ -28,6 +28,7 @@
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "h264chroma.h" #include "h264chroma.h"
#include "rnd_avg.h"
#include "vc1dsp.h" #include "vc1dsp.h"

View File

@ -28,6 +28,7 @@
#include "libavutil/common.h" #include "libavutil/common.h"
#include "avcodec.h" #include "avcodec.h"
#include "dsputil.h" #include "dsputil.h"
#include "rnd_avg.h"
#include "vp3dsp.h" #include "vp3dsp.h"
#define IdctAdjustBeforeShift 8 #define IdctAdjustBeforeShift 8