~ubuntu-branches/ubuntu/jaunty/xvidcap/jaunty-proposed

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/snow.h

  • Committer: Bazaar Package Importer
  • Author(s): Lionel Le Folgoc, Andrew Starr-Bochicchio, Lionel Le Folgoc
  • Date: 2008-12-26 00:10:06 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20081226001006-2040ls9680bd1blt
Tags: 1.1.7-0.2ubuntu1
[ Andrew Starr-Bochicchio ]
* Merge from debian-multimedia (LP: #298547), Ubuntu Changes:
 - For ffmpeg-related build-deps, fix versionized dependencies
   as the ubuntu versioning is different than debian-multimedia's.

[ Lionel Le Folgoc ]
* LP: #311412 is fixed since the 1.1.7~rc1-0.1 revision.
* debian/patches/03_ffmpeg.diff: updated to fix FTBFS due to libswscale API
  change (cherry-pick from Gentoo #234383).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
22
 
#ifndef _SNOW_H
23
 
#define _SNOW_H
 
22
#ifndef FFMPEG_SNOW_H
 
23
#define FFMPEG_SNOW_H
24
24
 
25
25
#include "dsputil.h"
26
26
 
31
31
#define QSHIFT 5
32
32
#define QROOT (1<<QSHIFT)
33
33
#define LOSSLESS_QLOG -128
34
 
#define FRAC_BITS 8
 
34
#define FRAC_BITS 4
35
35
#define MAX_REF_FRAMES 8
36
36
 
37
37
#define LOG2_OBMC_MAX 8
39
39
 
40
40
#define DWT_97 0
41
41
#define DWT_53 1
42
 
#define DWT_X  2
43
42
 
44
43
/** Used to minimize the amount of memory used in order to optimize cache performance. **/
45
44
struct slice_buffer_s {
46
 
    DWTELEM * * line; ///< For use by idwt and predict_slices.
47
 
    DWTELEM * * data_stack; ///< Used for internal purposes.
 
45
    IDWTELEM * * line; ///< For use by idwt and predict_slices.
 
46
    IDWTELEM * * data_stack; ///< Used for internal purposes.
48
47
    int data_stack_top;
49
48
    int line_count;
50
49
    int line_width;
51
50
    int data_count;
52
 
    DWTELEM * base_buffer; ///< Buffer that this structure is caching.
 
51
    IDWTELEM * base_buffer; ///< Buffer that this structure is caching.
53
52
};
54
53
 
55
54
#define liftS lift
56
 
#define lift5 lift
57
55
#if 1
58
56
#define W_AM 3
59
57
#define W_AO 0
123
121
#define W_DS 9
124
122
#endif
125
123
 
126
 
extern void ff_snow_vertical_compose97i(DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, DWTELEM *b3, DWTELEM *b4, DWTELEM *b5, int width);
127
 
extern void ff_snow_horizontal_compose97i(DWTELEM *b, int width);
 
124
extern void ff_snow_vertical_compose97i(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width);
 
125
extern void ff_snow_horizontal_compose97i(IDWTELEM *b, int width);
128
126
extern void ff_snow_inner_add_yblock(const uint8_t *obmc, const int obmc_stride, uint8_t * * block, int b_w, int b_h, int src_x, int src_y, int src_stride, slice_buffer * sb, int add, uint8_t * dst8);
129
127
 
130
128
#ifdef CONFIG_SNOW_ENCODER
137
135
 
138
136
/* C bits used by mmx/sse2/altivec */
139
137
 
140
 
static av_always_inline void snow_interleave_line_header(int * i, int width, DWTELEM * low, DWTELEM * high){
 
138
static av_always_inline void snow_interleave_line_header(int * i, int width, IDWTELEM * low, IDWTELEM * high){
141
139
    (*i) = (width) - 2;
142
140
 
143
141
    if (width & 1){
146
144
    }
147
145
}
148
146
 
149
 
static av_always_inline void snow_interleave_line_footer(int * i, DWTELEM * low, DWTELEM * high){
 
147
static av_always_inline void snow_interleave_line_footer(int * i, IDWTELEM * low, IDWTELEM * high){
150
148
    for (; (*i)>=0; (*i)-=2){
151
149
        low[(*i)+1] = high[(*i)>>1];
152
150
        low[*i] = low[(*i)>>1];
153
151
    }
154
152
}
155
153
 
156
 
static av_always_inline void snow_horizontal_compose_lift_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w, int lift_high, int mul, int add, int shift){
 
154
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){
157
155
    for(; i<w; i++){
158
156
        dst[i] = src[i] - ((mul * (ref[i] + ref[i + 1]) + add) >> shift);
159
157
    }
163
161
    }
164
162
}
165
163
 
166
 
static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, DWTELEM * dst, DWTELEM * src, DWTELEM * ref, int width, int w){
 
164
static av_always_inline void snow_horizontal_compose_liftS_lead_out(int i, IDWTELEM * dst, IDWTELEM * src, IDWTELEM * ref, int width, int w){
167
165
        for(; i<w; i++){
168
 
            dst[i] = src[i] - (((-(ref[i] + ref[(i+1)])+W_BO) - 4 * src[i]) >> W_BS);
 
166
            dst[i] = src[i] + ((ref[i] + ref[(i+1)]+W_BO + 4 * src[i]) >> W_BS);
169
167
        }
170
168
 
171
169
        if(width&1){
172
 
            dst[w] = src[w] - (((-2 * ref[w] + W_BO) - 4 * src[w]) >> W_BS);
 
170
            dst[w] = src[w] + ((2 * ref[w] + W_BO + 4 * src[w]) >> W_BS);
173
171
        }
174
172
}
175
173
 
176
 
#endif
 
174
#endif /* FFMPEG_SNOW_H */