00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef AVCODEC_SNOW_H
00023 #define AVCODEC_SNOW_H
00024
00025 #include "dsputil.h"
00026 #include "dwt.h"
00027
00028 #define MID_STATE 128
00029
00030 #define MAX_PLANES 4
00031 #define QSHIFT 5
00032 #define QROOT (1<<QSHIFT)
00033 #define LOSSLESS_QLOG -128
00034 #define FRAC_BITS 4
00035 #define MAX_REF_FRAMES 8
00036
00037 #define LOG2_OBMC_MAX 8
00038 #define OBMC_MAX (1<<(LOG2_OBMC_MAX))
00039
00040
00041
00042 static av_always_inline void snow_interleave_line_header(int * i, int width, IDWTELEM * low, IDWTELEM * high){
00043 (*i) = (width) - 2;
00044
00045 if (width & 1){
00046 low[(*i)+1] = low[((*i)+1)>>1];
00047 (*i)--;
00048 }
00049 }
00050
00051 static av_always_inline void snow_interleave_line_footer(int * i, IDWTELEM * low, IDWTELEM * high){
00052 for (; (*i)>=0; (*i)-=2){
00053 low[(*i)+1] = high[(*i)>>1];
00054 low[*i] = low[(*i)>>1];
00055 }
00056 }
00057
00058 static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){
00059 for(; i<w; i++){
00060 dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift);
00061 }
00062
00063 if((width^lift_high)&1){
00064 dst[w] = src[w] - ((mul * 2 * ref[w] + add) >> shift);
00065 }
00066 }
00067
00068 static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w){
00069 for(; i<w; i++){
00070 dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS);
00071 }
00072
00073 if(width&1){
00074 dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS);
00075 }
00076 }
00077
00078 #endif