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

« back to all changes in this revision

Viewing changes to ffmpeg/libavcodec/8bps.c

  • 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:
17
17
 * You should have received a copy of the GNU Lesser General Public
18
18
 * License along with FFmpeg; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
 
 *
21
20
 */
22
21
 
23
22
/**
35
34
#include <stdio.h>
36
35
#include <stdlib.h>
37
36
 
38
 
#include "common.h"
39
37
#include "avcodec.h"
40
38
 
41
39
 
59
57
 * Decode a frame
60
58
 *
61
59
 */
62
 
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
 
60
static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
63
61
{
64
 
        EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
65
 
        unsigned char *encoded = (unsigned char *)buf;
 
62
        EightBpsContext * const c = avctx->priv_data;
 
63
        const unsigned char *encoded = buf;
66
64
        unsigned char *pixptr, *pixptr_end;
67
65
        unsigned int height = avctx->height; // Real image height
68
66
        unsigned int dlen, p, row;
69
 
        unsigned char *lp, *dp;
 
67
        const unsigned char *lp, *dp;
70
68
        unsigned char count;
71
69
        unsigned int px_inc;
72
70
        unsigned int planes = c->planes;
99
97
                for(row = 0; row < height; row++) {
100
98
                        pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p];
101
99
                        pixptr_end = pixptr + c->pic.linesize[0];
102
 
                        dlen = be2me_16(*(unsigned short *)(lp+row*2));
 
100
                        dlen = be2me_16(*(const unsigned short *)(lp+row*2));
103
101
                        /* Decode a row of this plane */
104
102
                        while(dlen > 0) {
105
103
                                if(dp + 1 >= buf+buf_size) return -1;
150
148
 * Init 8BPS decoder
151
149
 *
152
150
 */
153
 
static int decode_init(AVCodecContext *avctx)
 
151
static av_cold int decode_init(AVCodecContext *avctx)
154
152
{
155
 
        EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
 
153
        EightBpsContext * const c = avctx->priv_data;
156
154
 
157
155
        c->avctx = avctx;
158
 
        avctx->has_b_frames = 0;
159
156
 
160
157
        c->pic.data[0] = NULL;
161
158
 
211
208
 * Uninit 8BPS decoder
212
209
 *
213
210
 */
214
 
static int decode_end(AVCodecContext *avctx)
 
211
static av_cold int decode_end(AVCodecContext *avctx)
215
212
{
216
 
        EightBpsContext * const c = (EightBpsContext *)avctx->priv_data;
 
213
        EightBpsContext * const c = avctx->priv_data;
217
214
 
218
215
        if (c->pic.data[0])
219
216
                avctx->release_buffer(avctx, &c->pic);
233
230
        decode_end,
234
231
        decode_frame,
235
232
        CODEC_CAP_DR1,
 
233
        .long_name = "QuickTime 8BPS video",
236
234
};