• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • Examples
  • File List
  • Globals

libavcodec/bit_depth_template.c

Go to the documentation of this file.
00001 /*
00002  * This file is part of Libav.
00003  *
00004  * Libav is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * Libav is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with Libav; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00017  */
00018 
00019 #include "dsputil.h"
00020 
00021 #ifndef BIT_DEPTH
00022 #define BIT_DEPTH 8
00023 #endif
00024 
00025 #ifdef AVCODEC_H264_HIGH_DEPTH_H
00026 #   undef pixel
00027 #   undef pixel2
00028 #   undef pixel4
00029 #   undef dctcoef
00030 #   undef INIT_CLIP
00031 #   undef no_rnd_avg_pixel4
00032 #   undef rnd_avg_pixel4
00033 #   undef AV_RN2P
00034 #   undef AV_RN4P
00035 #   undef AV_RN4PA
00036 #   undef AV_WN2P
00037 #   undef AV_WN4P
00038 #   undef AV_WN4PA
00039 #   undef CLIP
00040 #   undef FUNC
00041 #   undef FUNCC
00042 #   undef av_clip_pixel
00043 #   undef PIXEL_SPLAT_X4
00044 #else
00045 #   define AVCODEC_H264_HIGH_DEPTH_H
00046 #endif
00047 
00048 #if BIT_DEPTH > 8
00049 #   define pixel  uint16_t
00050 #   define pixel2 uint32_t
00051 #   define pixel4 uint64_t
00052 #   define dctcoef int32_t
00053 
00054 #   define INIT_CLIP
00055 #   define no_rnd_avg_pixel4 no_rnd_avg64
00056 #   define    rnd_avg_pixel4    rnd_avg64
00057 #   define AV_RN2P  AV_RN32
00058 #   define AV_RN4P  AV_RN64
00059 #   define AV_RN4PA AV_RN64A
00060 #   define AV_WN2P  AV_WN32
00061 #   define AV_WN4P  AV_WN64
00062 #   define AV_WN4PA AV_WN64A
00063 #   define PIXEL_SPLAT_X4(x) ((x)*0x0001000100010001ULL)
00064 
00065 #   define av_clip_pixel(a) av_clip_uintp2(a, BIT_DEPTH)
00066 #   define CLIP(a)          av_clip_uintp2(a, BIT_DEPTH)
00067 #else
00068 #   define pixel  uint8_t
00069 #   define pixel2 uint16_t
00070 #   define pixel4 uint32_t
00071 #   define dctcoef int16_t
00072 
00073 #   define INIT_CLIP uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
00074 #   define no_rnd_avg_pixel4 no_rnd_avg32
00075 #   define    rnd_avg_pixel4    rnd_avg32
00076 #   define AV_RN2P  AV_RN16
00077 #   define AV_RN4P  AV_RN32
00078 #   define AV_RN4PA AV_RN32A
00079 #   define AV_WN2P  AV_WN16
00080 #   define AV_WN4P  AV_WN32
00081 #   define AV_WN4PA AV_WN32A
00082 #   define PIXEL_SPLAT_X4(x) ((x)*0x01010101U)
00083 
00084 #   define av_clip_pixel(a) av_clip_uint8(a)
00085 #   define CLIP(a) cm[a]
00086 #endif
00087 
00088 #define FUNC3(a, b, c)  a ## _ ## b ## c
00089 #define FUNC2(a, b, c)  FUNC3(a, b, c)
00090 #define FUNC(a)  FUNC2(a, BIT_DEPTH,)
00091 #define FUNCC(a) FUNC2(a, BIT_DEPTH, _c)
Generated on Thu Jan 24 2013 17:08:50 for Libav by doxygen 1.7.1