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

« back to all changes in this revision

Viewing changes to ffmpeg/libswscale/swscale_internal.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:
15
15
 *
16
16
 * You should have received a copy of the GNU Lesser General Public
17
17
 * License along with FFmpeg; if not, write to the Free Software
18
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
19
 */
20
20
 
21
 
#ifndef SWSCALE_INTERNAL_H
22
 
#define SWSCALE_INTERNAL_H
 
21
#ifndef FFMPEG_SWSCALE_INTERNAL_H
 
22
#define FFMPEG_SWSCALE_INTERNAL_H
 
23
 
 
24
#include "config.h"
23
25
 
24
26
#ifdef HAVE_ALTIVEC_H
25
27
#include <altivec.h>
27
29
 
28
30
#include "avutil.h"
29
31
 
30
 
#ifdef CONFIG_DARWIN
31
 
#define AVV(x...) (x)
32
 
#else
33
 
#define AVV(x...) {x}
34
 
#endif
35
 
 
36
32
#define MAX_FILTER_SIZE 256
37
33
 
 
34
#define VOFW 2048
 
35
#define VOF  (VOFW*2)
 
36
 
38
37
typedef int (*SwsFunc)(struct SwsContext *context, uint8_t* src[], int srcStride[], int srcSliceY,
39
38
             int srcSliceH, uint8_t* dst[], int dstStride[]);
40
39
 
43
42
    /**
44
43
     * info on struct for av_log
45
44
     */
46
 
    AVClass *av_class;
 
45
    const AVClass *av_class;
47
46
 
48
47
    /**
49
 
     *
50
 
     * Note the src,dst,srcStride,dstStride will be copied, in the sws_scale() warper so they can freely be modified here
 
48
     * Note that src, dst, srcStride, dstStride will be copied in the
 
49
     * sws_scale() wrapper so they can be freely modified here.
51
50
     */
52
51
    SwsFunc swScale;
53
52
    int srcW, srcH, dstH;
74
73
    int16_t *vChrFilter;
75
74
    int16_t *vChrFilterPos;
76
75
 
77
 
    uint8_t formatConvBuffer[4000]; //FIXME dynamic alloc, but we have to change a lot of code for this to be useful
 
76
    uint8_t formatConvBuffer[VOF]; //FIXME dynamic alloc, but we have to change a lot of code for this to be useful
78
77
 
79
78
    int hLumFilterSize;
80
79
    int hChrFilterSize;
123
122
#define V_OFFSET              "10*8"
124
123
#define LUM_MMX_FILTER_OFFSET "11*8"
125
124
#define CHR_MMX_FILTER_OFFSET "11*8+4*4*256"
126
 
#define DSTW_OFFSET           "11*8+4*4*256*2" //do not change, its hardcoded in the asm
 
125
#define DSTW_OFFSET           "11*8+4*4*256*2" //do not change, it is hardcoded in the asm
127
126
#define ESP_OFFSET            "11*8+4*4*256*2+8"
128
127
#define VROUNDER_OFFSET       "11*8+4*4*256*2+16"
129
128
#define U_TEMP                "11*8+4*4*256*2+24"
162
161
 
163
162
#endif
164
163
 
 
164
 
 
165
#ifdef ARCH_BFIN
 
166
    uint32_t oy           __attribute__((aligned(4)));
 
167
    uint32_t oc           __attribute__((aligned(4)));
 
168
    uint32_t zero         __attribute__((aligned(4)));
 
169
    uint32_t cy           __attribute__((aligned(4)));
 
170
    uint32_t crv          __attribute__((aligned(4)));
 
171
    uint32_t rmask        __attribute__((aligned(4)));
 
172
    uint32_t cbu          __attribute__((aligned(4)));
 
173
    uint32_t bmask        __attribute__((aligned(4)));
 
174
    uint32_t cgu          __attribute__((aligned(4)));
 
175
    uint32_t cgv          __attribute__((aligned(4)));
 
176
    uint32_t gmask        __attribute__((aligned(4)));
 
177
#endif
 
178
 
 
179
#ifdef HAVE_VIS
 
180
    uint64_t sparc_coeffs[10] __attribute__((aligned(8)));
 
181
#endif
 
182
 
165
183
} SwsContext;
166
184
//FIXME check init (where 0)
167
185
 
168
186
SwsFunc yuv2rgb_get_func_ptr (SwsContext *c);
169
187
int yuv2rgb_c_init_tables (SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation);
170
188
 
171
 
char *sws_format_name(int format);
 
189
void yuv2rgb_altivec_init_tables (SwsContext *c, const int inv_table[4],int brightness,int contrast, int saturation);
 
190
SwsFunc yuv2rgb_init_altivec (SwsContext *c);
 
191
void altivec_yuv2packedX (SwsContext *c,
 
192
                          int16_t *lumFilter, int16_t **lumSrc, int lumFilterSize,
 
193
                          int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
 
194
                          uint8_t *dest, int dstW, int dstY);
 
195
 
 
196
const char *sws_format_name(int format);
172
197
 
173
198
//FIXME replace this with something faster
174
 
#define isPlanarYUV(x) ((x)==PIX_FMT_YUV410P  || (x)==PIX_FMT_YUV420P \
175
 
                     || (x)==PIX_FMT_YUV411P  || (x)==PIX_FMT_YUV422P \
176
 
                     || (x)==PIX_FMT_YUV444P  || (x)==PIX_FMT_NV12    \
177
 
                     || (x)==PIX_FMT_NV21)
178
 
#define isYUV(x)       ((x)==PIX_FMT_UYVY422  || (x)==PIX_FMT_YUYV422  || isPlanarYUV(x))
179
 
#define isGray(x)      ((x)==PIX_FMT_GRAY8    || (x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE)
180
 
#define isGray16(x)    ((x)==PIX_FMT_GRAY16BE || (x)==PIX_FMT_GRAY16LE)
181
 
#define isRGB(x)       ((x)==PIX_FMT_BGR32    || (x)==PIX_FMT_RGB24   \
182
 
                     || (x)==PIX_FMT_RGB565   || (x)==PIX_FMT_RGB555  \
183
 
                     || (x)==PIX_FMT_RGB8     || (x)==PIX_FMT_RGB4 || (x)==PIX_FMT_RGB4_BYTE \
184
 
                     || (x)==PIX_FMT_MONOBLACK)
185
 
#define isBGR(x)       ((x)==PIX_FMT_RGB32    || (x)==PIX_FMT_BGR24   \
186
 
                     || (x)==PIX_FMT_BGR565   || (x)==PIX_FMT_BGR555  \
187
 
                     || (x)==PIX_FMT_BGR8     || (x)==PIX_FMT_BGR4 || (x)==PIX_FMT_BGR4_BYTE \
188
 
                     || (x)==PIX_FMT_MONOBLACK)
 
199
#define isPlanarYUV(x)  (           \
 
200
           (x)==PIX_FMT_YUV410P     \
 
201
        || (x)==PIX_FMT_YUV420P     \
 
202
        || (x)==PIX_FMT_YUV411P     \
 
203
        || (x)==PIX_FMT_YUV422P     \
 
204
        || (x)==PIX_FMT_YUV444P     \
 
205
        || (x)==PIX_FMT_YUV440P     \
 
206
        || (x)==PIX_FMT_NV12        \
 
207
        || (x)==PIX_FMT_NV21        \
 
208
    )
 
209
#define isYUV(x)        (           \
 
210
           (x)==PIX_FMT_UYVY422     \
 
211
        || (x)==PIX_FMT_YUYV422     \
 
212
        || isPlanarYUV(x)           \
 
213
    )
 
214
#define isGray(x)       (           \
 
215
           (x)==PIX_FMT_GRAY8       \
 
216
        || (x)==PIX_FMT_GRAY16BE    \
 
217
        || (x)==PIX_FMT_GRAY16LE    \
 
218
    )
 
219
#define isGray16(x)     (           \
 
220
           (x)==PIX_FMT_GRAY16BE    \
 
221
        || (x)==PIX_FMT_GRAY16LE    \
 
222
    )
 
223
#define isRGB(x)        (           \
 
224
           (x)==PIX_FMT_BGR32       \
 
225
        || (x)==PIX_FMT_RGB24       \
 
226
        || (x)==PIX_FMT_RGB565      \
 
227
        || (x)==PIX_FMT_RGB555      \
 
228
        || (x)==PIX_FMT_RGB8        \
 
229
        || (x)==PIX_FMT_RGB4        \
 
230
        || (x)==PIX_FMT_RGB4_BYTE   \
 
231
        || (x)==PIX_FMT_MONOBLACK   \
 
232
    )
 
233
#define isBGR(x)        (           \
 
234
           (x)==PIX_FMT_RGB32       \
 
235
        || (x)==PIX_FMT_BGR24       \
 
236
        || (x)==PIX_FMT_BGR565      \
 
237
        || (x)==PIX_FMT_BGR555      \
 
238
        || (x)==PIX_FMT_BGR8        \
 
239
        || (x)==PIX_FMT_BGR4        \
 
240
        || (x)==PIX_FMT_BGR4_BYTE   \
 
241
        || (x)==PIX_FMT_MONOBLACK   \
 
242
    )
189
243
 
190
244
static inline int fmt_depth(int fmt)
191
245
{
221
275
    }
222
276
}
223
277
 
224
 
#endif
 
278
extern const DECLARE_ALIGNED(8, uint64_t, ff_dither4[2]);
 
279
extern const DECLARE_ALIGNED(8, uint64_t, ff_dither8[2]);
 
280
 
 
281
#endif /* FFMPEG_SWSCALE_INTERNAL_H */