~phatforge/libav/fixup

« back to all changes in this revision

Viewing changes to libavcodec/rv34.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:
2
2
 * RV30/40 decoder common data
3
3
 * Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
4
4
 *
5
 
 * This file is part of FFmpeg.
 
5
 * This file is part of Libav.
6
6
 *
7
 
 * FFmpeg is free software; you can redistribute it and/or
 
7
 * Libav is free software; you can redistribute it and/or
8
8
 * modify it under the terms of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation; either
10
10
 * version 2.1 of the License, or (at your option) any later version.
11
11
 *
12
 
 * FFmpeg is distributed in the hope that it will be useful,
 
12
 * Libav is distributed in the hope that it will be useful,
13
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15
15
 * Lesser General Public License for more details.
16
16
 *
17
17
 * You should have received a copy of the GNU Lesser General Public
18
 
 * License along with FFmpeg; if not, write to the Free Software
 
18
 * License along with Libav; if not, write to the Free Software
19
19
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
20
 */
21
21
 
103
103
{
104
104
    int i;
105
105
    int counts[17] = {0}, codes[17];
106
 
    uint16_t cw[size], syms[size];
107
 
    uint8_t bits2[size];
 
106
    uint16_t cw[MAX_VLC_SIZE], syms[MAX_VLC_SIZE];
 
107
    uint8_t bits2[MAX_VLC_SIZE];
108
108
    int maxbits = 0, realsize = 0;
109
109
 
110
110
    for(i = 0; i < size; i++){
393
393
 
394
394
 
395
395
/**
396
 
 * @defgroup bitstream RV30/40 bitstream parsing
 
396
 * @defgroup rv3040_bitstream RV30/40 bitstream parsing
397
397
 * @{
398
398
 */
399
399
 
718
718
        uint8_t *uvbuf= s->edge_emu_buffer + 22 * s->linesize;
719
719
 
720
720
        srcY -= 2 + 2*s->linesize;
721
 
        ff_emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize, (width<<3)+6, (height<<3)+6,
 
721
        s->dsp.emulated_edge_mc(s->edge_emu_buffer, srcY, s->linesize, (width<<3)+6, (height<<3)+6,
722
722
                            src_x - 2, src_y - 2, s->h_edge_pos, s->v_edge_pos);
723
723
        srcY = s->edge_emu_buffer + 2 + 2*s->linesize;
724
 
        ff_emulated_edge_mc(uvbuf     , srcU, s->uvlinesize, (width<<2)+1, (height<<2)+1,
 
724
        s->dsp.emulated_edge_mc(uvbuf     , srcU, s->uvlinesize, (width<<2)+1, (height<<2)+1,
725
725
                            uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
726
 
        ff_emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, (width<<2)+1, (height<<2)+1,
 
726
        s->dsp.emulated_edge_mc(uvbuf + 16, srcV, s->uvlinesize, (width<<2)+1, (height<<2)+1,
727
727
                            uvsrc_x, uvsrc_y, s->h_edge_pos >> 1, s->v_edge_pos >> 1);
728
728
        srcU = uvbuf;
729
729
        srcV = uvbuf + 16;
1142
1142
    MpegEncContext *s = &r->s;
1143
1143
    int hmvmask = 0, vmvmask = 0, i, j;
1144
1144
    int midx = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
1145
 
    int16_t (*motion_val)[2] = s->current_picture_ptr->motion_val[0][midx];
 
1145
    int16_t (*motion_val)[2] = &s->current_picture_ptr->motion_val[0][midx];
1146
1146
    for(j = 0; j < 16; j += 8){
1147
1147
        for(i = 0; i < 2; i++){
1148
1148
            if(is_mv_diff_gt_3(motion_val + i, 1))
1454
1454
    }
1455
1455
    if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
1456
1456
        return -1;
 
1457
#if FF_API_HURRY_UP
1457
1458
    /* skip b frames if we are in a hurry */
1458
1459
    if(avctx->hurry_up && si.type==FF_B_TYPE) return buf_size;
 
1460
#endif
1459
1461
    if(   (avctx->skip_frame >= AVDISCARD_NONREF && si.type==FF_B_TYPE)
1460
1462
       || (avctx->skip_frame >= AVDISCARD_NONKEY && si.type!=FF_I_TYPE)
1461
1463
       ||  avctx->skip_frame >= AVDISCARD_ALL)
1462
1464
        return buf_size;
 
1465
#if FF_API_HURRY_UP
1463
1466
    /* skip everything if we are in a hurry>=5 */
1464
1467
    if(avctx->hurry_up>=5)
1465
1468
        return buf_size;
 
1469
#endif
1466
1470
 
1467
1471
    for(i=0; i<slice_count; i++){
1468
1472
        int offset= get_slice_offset(avctx, slices_hdr, i);