~phatforge/libav/fixup

« back to all changes in this revision

Viewing changes to libavcodec/jpeglsdec.c

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2011-04-30 14:27:42 UTC
  • mfrom: (1.1.2 experimental)
  • Revision ID: james.westby@ubuntu.com-20110430142742-quvblxk1tj6adlh5
Tags: 4:0.7~b1-1ubuntu1
* Merge from debian. Remaining changes:
  - don't build against libfaad, libdirac, librtmp and libopenjpeg
    (all in universe)
  - explicitly --enable-pic on powerpc, cf. LP #654666
  - different arm configure bits that should probably better be
    merged into debian
* Cherry-picked from git: 
  - install doc/APIChanges and refer to them in NEWS.Debian (Closes: #623682)
  - don't try to install non-existing documentation, fixes FTBFS on powerpc

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 * Copyright (c) 2003 Michael Niedermayer
4
4
 * Copyright (c) 2006 Konstantin Shishkov
5
5
 *
6
 
 * This file is part of FFmpeg.
 
6
 * This file is part of Libav.
7
7
 *
8
 
 * FFmpeg is free software; you can redistribute it and/or
 
8
 * Libav is free software; you can redistribute it and/or
9
9
 * modify it under the terms of the GNU Lesser General Public
10
10
 * License as published by the Free Software Foundation; either
11
11
 * version 2.1 of the License, or (at your option) any later version.
12
12
 *
13
 
 * FFmpeg is distributed in the hope that it will be useful,
 
13
 * Libav is distributed in the hope that it will be useful,
14
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16
16
 * Lesser General Public License for more details.
17
17
 *
18
18
 * You should have received a copy of the GNU Lesser General Public
19
 
 * License along with FFmpeg; if not, write to the Free Software
 
19
 * License along with Libav; if not, write to the Free Software
20
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
21
 */
22
22
 
40
40
* (or test broken JPEG-LS decoder) and slow down ordinary decoding a bit.
41
41
*
42
42
* There is no Golomb code with length >= 32 bits possible, so check and
43
 
* avoid situation of 32 zeros, FFmpeg Golomb decoder is painfully slow
 
43
* avoid situation of 32 zeros, Libav Golomb decoder is painfully slow
44
44
* on this errors.
45
45
*/
46
46
//#define JLS_BROKEN
262
262
    JLSState *state;
263
263
    int off = 0, stride = 1, width, shift;
264
264
 
265
 
    zero = av_mallocz(s->picture.linesize[0]);
 
265
    zero = av_mallocz(s->picture_ptr->linesize[0]);
266
266
    last = zero;
267
 
    cur = s->picture.data[0];
 
267
    cur = s->picture_ptr->data[0];
268
268
 
269
269
    state = av_mallocz(sizeof(JLSState));
270
270
    /* initialize JPEG-LS state from JPEG parameters */
299
299
                t = *((uint16_t*)last);
300
300
            }
301
301
            last = cur;
302
 
            cur += s->picture.linesize[0];
 
302
            cur += s->picture_ptr->linesize[0];
303
303
 
304
304
            if (s->restart_interval && !--s->restart_count) {
305
305
                align_get_bits(&s->gb);
309
309
    } else if(ilv == 1) { /* line interleaving */
310
310
        int j;
311
311
        int Rc[3] = {0, 0, 0};
312
 
        memset(cur, 0, s->picture.linesize[0]);
 
312
        memset(cur, 0, s->picture_ptr->linesize[0]);
313
313
        width = s->width * 3;
314
314
        for(i = 0; i < s->height; i++) {
315
315
            for(j = 0; j < 3; j++) {
322
322
                }
323
323
            }
324
324
            last = cur;
325
 
            cur += s->picture.linesize[0];
 
325
            cur += s->picture_ptr->linesize[0];
326
326
        }
327
327
    } else if(ilv == 2) { /* sample interleaving */
328
328
        av_log(s->avctx, AV_LOG_ERROR, "Sample interleaved images are not supported.\n");
337
337
        w = s->width * s->nb_components;
338
338
 
339
339
        if(s->bits <= 8){
340
 
            uint8_t *src = s->picture.data[0];
 
340
            uint8_t *src = s->picture_ptr->data[0];
341
341
 
342
342
            for(i = 0; i < s->height; i++){
343
343
                for(x = off; x < w; x+= stride){
344
344
                    src[x] <<= shift;
345
345
                }
346
 
                src += s->picture.linesize[0];
 
346
                src += s->picture_ptr->linesize[0];
347
347
            }
348
348
        }else{
349
 
            uint16_t *src = (uint16_t*) s->picture.data[0];
 
349
            uint16_t *src = (uint16_t*) s->picture_ptr->data[0];
350
350
 
351
351
            for(i = 0; i < s->height; i++){
352
352
                for(x = 0; x < w; x++){
353
353
                    src[x] <<= shift;
354
354
                }
355
 
                src += s->picture.linesize[0]/2;
 
355
                src += s->picture_ptr->linesize[0]/2;
356
356
            }
357
357
        }
358
358
    }
363
363
}
364
364
 
365
365
 
366
 
AVCodec jpegls_decoder = {
 
366
AVCodec ff_jpegls_decoder = {
367
367
    "jpegls",
368
368
    AVMEDIA_TYPE_VIDEO,
369
369
    CODEC_ID_JPEGLS,