~ubuntu-branches/ubuntu/maverick/vlc/maverick

« back to all changes in this revision

Viewing changes to modules/video_filter/swscale/yuv2rgb_mlib.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2008-09-17 21:56:14 UTC
  • mfrom: (1.1.17 upstream)
  • Revision ID: james.westby@ubuntu.com-20080917215614-tj0vx8xzd57e52t8
Tags: 0.9.2-1ubuntu1
* New Upstream Release, exception granted by
    - dktrkranz, norsetto, Hobbsee (via irc). LP: #270404

Changes done in ubuntu:

* add libxul-dev to build-depends
* make sure that vlc is build against libxul in configure. This doesn't
  change anything in the package, but makes it more robust if building
  in an 'unclean' chroot or when modifying the package.
* debian/control: make Vcs-* fields point to the motumedia branch
* add libx264-dev and libass-dev to build-depends
  LP: #210354, #199870
* actually enable libass support by passing --enable-libass to configure
* enable libdca: add libdca-dev to build depends and --enable-libdca
* install the x264 plugin.

Changes already in the pkg-multimedia branch in debian:

* don't install usr/share/vlc/mozilla in debian/mozilla-plugin-vlc.install  
* new upstream .desktop file now registers flash video mimetype LP: #261567
* add Xb-Npp-Applications to mozilla-plugin-vlc
* remove duplicate entries in debian/vlc-nox.install

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* 
2
 
 * yuv2rgb_mlib.c, Software YUV to RGB coverter using mediaLib
3
 
 *
4
 
 *  Copyright (C) 2000, Håkan Hjort <d95hjort@dtek.chalmers.se>
5
 
 *  All Rights Reserved.
6
 
 *
7
 
 *  This file is part of mpeg2dec, a free MPEG-2 video decoder
8
 
 *
9
 
 *  mpeg2dec is free software; you can redistribute it and/or modify
10
 
 *  it under the terms of the GNU General Public License as published by
11
 
 *  the Free Software Foundation; either version 2, or (at your option)
12
 
 *  any later version.
13
 
 *
14
 
 *  mpeg2dec is distributed in the hope that it will be useful,
15
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 
 *  GNU General Public License for more details.
18
 
 *
19
 
 *  You should have received a copy of the GNU General Public License
20
 
 *  along with GNU Make; see the file COPYING.  If not, write to
21
 
 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22
 
 *
23
 
 */
24
 
 
25
 
#include <mlib_types.h>
26
 
#include <mlib_status.h>
27
 
#include <mlib_sys.h>
28
 
#include <mlib_video.h>
29
 
#include <inttypes.h>
30
 
#include <stdlib.h>
31
 
#include <assert.h>
32
 
 
33
 
#include "img_format.h" //FIXME try to reduce dependency of such stuff
34
 
#include "swscale.h"
35
 
 
36
 
static int mlib_YUV2ARGB420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, 
37
 
             int srcSliceH, uint8_t* dst[], int dstStride[]){
38
 
    if(c->srcFormat == IMGFMT_422P){
39
 
        srcStride[1] *= 2;
40
 
        srcStride[2] *= 2;
41
 
    }
42
 
    
43
 
    assert(srcStride[1] == srcStride[2]);
44
 
 
45
 
    mlib_VideoColorYUV2ARGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW,
46
 
                             srcSliceH, dstStride[0], srcStride[0], srcStride[1]);
47
 
    return srcSliceH;
48
 
}
49
 
 
50
 
static int mlib_YUV2ABGR420_32(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, 
51
 
             int srcSliceH, uint8_t* dst[], int dstStride[]){
52
 
    if(c->srcFormat == IMGFMT_422P){
53
 
        srcStride[1] *= 2;
54
 
        srcStride[2] *= 2;
55
 
    }
56
 
    
57
 
    assert(srcStride[1] == srcStride[2]);
58
 
 
59
 
    mlib_VideoColorYUV2ABGR420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW,
60
 
                             srcSliceH, dstStride[0], srcStride[0], srcStride[1]);
61
 
    return srcSliceH;
62
 
}
63
 
 
64
 
static int mlib_YUV2RGB420_24(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY, 
65
 
             int srcSliceH, uint8_t* dst[], int dstStride[]){
66
 
    if(c->srcFormat == IMGFMT_422P){
67
 
        srcStride[1] *= 2;
68
 
        srcStride[2] *= 2;
69
 
    }
70
 
    
71
 
    assert(srcStride[1] == srcStride[2]);
72
 
 
73
 
    mlib_VideoColorYUV2RGB420(dst[0]+srcSliceY*dstStride[0], src[0], src[1], src[2], c->dstW,
74
 
                             srcSliceH, dstStride[0], srcStride[0], srcStride[1]);
75
 
    return srcSliceH;
76
 
}
77
 
 
78
 
 
79
 
SwsFunc yuv2rgb_init_mlib(SwsContext *c) 
80
 
{
81
 
        switch(c->dstFormat){
82
 
        case IMGFMT_RGB24: return mlib_YUV2RGB420_24;
83
 
        case IMGFMT_RGB32: return mlib_YUV2ARGB420_32;
84
 
        case IMGFMT_BGR32: return mlib_YUV2ABGR420_32;
85
 
        default: return NULL;
86
 
        }
87
 
}
88