2
2
* RV30/40 decoder common data
3
3
* Copyright (c) 2007 Mike Melanson, Konstantin Shishkov
5
* This file is part of FFmpeg.
5
* This file is part of Libav.
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.
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.
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
105
105
int counts[17] = {0}, codes[17];
106
uint16_t cw[size], syms[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;
110
110
for(i = 0; i < size; i++){
718
718
uint8_t *uvbuf= s->edge_emu_buffer + 22 * s->linesize;
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);
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))
1455
1455
if((!s->last_picture_ptr || !s->last_picture_ptr->data[0]) && si.type == FF_B_TYPE)
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;
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;
1463
1466
/* skip everything if we are in a hurry>=5 */
1464
1467
if(avctx->hurry_up>=5)
1465
1468
return buf_size;
1467
1471
for(i=0; i<slice_count; i++){
1468
1472
int offset= get_slice_offset(avctx, slices_hdr, i);