annotate mpegvideo_common.h @ 9528:dad1c3ed61f1 libavcodec

Implement a write_line() function.
author stefano
date Tue, 21 Apr 2009 19:15:21 +0000
parents 1ff6eb1d7d14
children f2fa6cbb01ce
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
1 /*
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
2 * The simplest mpeg encoder (well, it was the simplest!)
8629
04423b2f6e0b cosmetics: Remove pointless period after copyright statement non-sentences.
diego
parents: 8596
diff changeset
3 * Copyright (c) 2000,2001 Fabrice Bellard
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
5 *
5214
470601203f44 Group all copyright and author notices together.
diego
parents: 5204
diff changeset
6 * 4MV & hq & B-frame encoding stuff by Michael Niedermayer <michaelni@gmx.at>
470601203f44 Group all copyright and author notices together.
diego
parents: 5204
diff changeset
7 *
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
8 * This file is part of FFmpeg.
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
9 *
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
10 * FFmpeg is free software; you can redistribute it and/or
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
11 * modify it under the terms of the GNU Lesser General Public
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
12 * License as published by the Free Software Foundation; either
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
13 * version 2.1 of the License, or (at your option) any later version.
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
14 *
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
15 * FFmpeg is distributed in the hope that it will be useful,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
18 * Lesser General Public License for more details.
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
19 *
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
20 * You should have received a copy of the GNU Lesser General Public
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
21 * License along with FFmpeg; if not, write to the Free Software
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
23 */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
24
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
25 /**
8718
e9d9d946f213 Use full internal pathname in doxygen @file directives.
diego
parents: 8667
diff changeset
26 * @file libavcodec/mpegvideo_common.h
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
27 * The simplest mpeg encoder (well, it was the simplest!).
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
28 */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
29
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6659
diff changeset
30 #ifndef AVCODEC_MPEGVIDEO_COMMON_H
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6659
diff changeset
31 #define AVCODEC_MPEGVIDEO_COMMON_H
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
32
8667
5690a6211e8c Directly #include some required headers.
diego
parents: 8629
diff changeset
33 #include <string.h>
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
34 #include "avcodec.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
35 #include "dsputil.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
36 #include "mpegvideo.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
37 #include "mjpegenc.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
38 #include "msmpeg4.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
39 #include "faandct.h"
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
40 #include <limits.h>
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
41
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
42 int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
43 int dct_quantize_trellis_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *overflow);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
44 void denoise_dct_c(MpegEncContext *s, DCTELEM *block);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
45
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
46 /**
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
47 * allocates a Picture
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
48 * The pixels are allocated/set by calling get_buffer() if shared=0
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
49 */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
50 int alloc_picture(MpegEncContext *s, Picture *pic, int shared);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
51
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
52 /**
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
53 * sets the given MpegEncContext to common defaults (same for encoding and decoding).
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
54 * the changed fields will not depend upon the prior state of the MpegEncContext.
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
55 */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
56 void MPV_common_defaults(MpegEncContext *s);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
57
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
58 static inline void gmc1_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
59 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
60 uint8_t **ref_picture)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
61 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
62 uint8_t *ptr;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
63 int offset, src_x, src_y, linesize, uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
64 int motion_x, motion_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
65 int emu=0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
66
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
67 motion_x= s->sprite_offset[0][0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
68 motion_y= s->sprite_offset[0][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
69 src_x = s->mb_x * 16 + (motion_x >> (s->sprite_warping_accuracy+1));
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
70 src_y = s->mb_y * 16 + (motion_y >> (s->sprite_warping_accuracy+1));
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
71 motion_x<<=(3-s->sprite_warping_accuracy);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
72 motion_y<<=(3-s->sprite_warping_accuracy);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
73 src_x = av_clip(src_x, -16, s->width);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
74 if (src_x == s->width)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
75 motion_x =0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
76 src_y = av_clip(src_y, -16, s->height);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
77 if (src_y == s->height)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
78 motion_y =0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
79
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
80 linesize = s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
81 uvlinesize = s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
82
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
83 ptr = ref_picture[0] + (src_y * linesize) + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
84
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
85 if(s->flags&CODEC_FLAG_EMU_EDGE){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
86 if( (unsigned)src_x >= s->h_edge_pos - 17
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
87 || (unsigned)src_y >= s->v_edge_pos - 17){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
88 ff_emulated_edge_mc(s->edge_emu_buffer, ptr, linesize, 17, 17, src_x, src_y, s->h_edge_pos, s->v_edge_pos);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
89 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
90 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
91 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
92
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
93 if((motion_x|motion_y)&7){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
94 s->dsp.gmc1(dest_y , ptr , linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
95 s->dsp.gmc1(dest_y+8, ptr+8, linesize, 16, motion_x&15, motion_y&15, 128 - s->no_rounding);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
96 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
97 int dxy;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
98
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
99 dxy= ((motion_x>>3)&1) | ((motion_y>>2)&2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
100 if (s->no_rounding){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
101 s->dsp.put_no_rnd_pixels_tab[0][dxy](dest_y, ptr, linesize, 16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
102 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
103 s->dsp.put_pixels_tab [0][dxy](dest_y, ptr, linesize, 16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
104 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
105 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
106
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
107 if(CONFIG_GRAY && s->flags&CODEC_FLAG_GRAY) return;
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
108
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
109 motion_x= s->sprite_offset[1][0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
110 motion_y= s->sprite_offset[1][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
111 src_x = s->mb_x * 8 + (motion_x >> (s->sprite_warping_accuracy+1));
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
112 src_y = s->mb_y * 8 + (motion_y >> (s->sprite_warping_accuracy+1));
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
113 motion_x<<=(3-s->sprite_warping_accuracy);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
114 motion_y<<=(3-s->sprite_warping_accuracy);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
115 src_x = av_clip(src_x, -8, s->width>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
116 if (src_x == s->width>>1)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
117 motion_x =0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
118 src_y = av_clip(src_y, -8, s->height>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
119 if (src_y == s->height>>1)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
120 motion_y =0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
121
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
122 offset = (src_y * uvlinesize) + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
123 ptr = ref_picture[1] + offset;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
124 if(s->flags&CODEC_FLAG_EMU_EDGE){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
125 if( (unsigned)src_x >= (s->h_edge_pos>>1) - 9
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
126 || (unsigned)src_y >= (s->v_edge_pos>>1) - 9){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
127 ff_emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
128 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
129 emu=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
130 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
131 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
132 s->dsp.gmc1(dest_cb, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
133
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
134 ptr = ref_picture[2] + offset;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
135 if(emu){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
136 ff_emulated_edge_mc(s->edge_emu_buffer, ptr, uvlinesize, 9, 9, src_x, src_y, s->h_edge_pos>>1, s->v_edge_pos>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
137 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
138 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
139 s->dsp.gmc1(dest_cr, ptr, uvlinesize, 8, motion_x&15, motion_y&15, 128 - s->no_rounding);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
140
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
141 return;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
142 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
143
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
144 static inline void gmc_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
145 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
146 uint8_t **ref_picture)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
147 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
148 uint8_t *ptr;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
149 int linesize, uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
150 const int a= s->sprite_warping_accuracy;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
151 int ox, oy;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
152
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
153 linesize = s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
154 uvlinesize = s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
155
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
156 ptr = ref_picture[0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
157
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
158 ox= s->sprite_offset[0][0] + s->sprite_delta[0][0]*s->mb_x*16 + s->sprite_delta[0][1]*s->mb_y*16;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
159 oy= s->sprite_offset[0][1] + s->sprite_delta[1][0]*s->mb_x*16 + s->sprite_delta[1][1]*s->mb_y*16;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
160
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
161 s->dsp.gmc(dest_y, ptr, linesize, 16,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
162 ox,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
163 oy,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
164 s->sprite_delta[0][0], s->sprite_delta[0][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
165 s->sprite_delta[1][0], s->sprite_delta[1][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
166 a+1, (1<<(2*a+1)) - s->no_rounding,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
167 s->h_edge_pos, s->v_edge_pos);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
168 s->dsp.gmc(dest_y+8, ptr, linesize, 16,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
169 ox + s->sprite_delta[0][0]*8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
170 oy + s->sprite_delta[1][0]*8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
171 s->sprite_delta[0][0], s->sprite_delta[0][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
172 s->sprite_delta[1][0], s->sprite_delta[1][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
173 a+1, (1<<(2*a+1)) - s->no_rounding,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
174 s->h_edge_pos, s->v_edge_pos);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
175
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
176 if(CONFIG_GRAY && s->flags&CODEC_FLAG_GRAY) return;
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
177
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
178 ox= s->sprite_offset[1][0] + s->sprite_delta[0][0]*s->mb_x*8 + s->sprite_delta[0][1]*s->mb_y*8;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
179 oy= s->sprite_offset[1][1] + s->sprite_delta[1][0]*s->mb_x*8 + s->sprite_delta[1][1]*s->mb_y*8;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
180
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
181 ptr = ref_picture[1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
182 s->dsp.gmc(dest_cb, ptr, uvlinesize, 8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
183 ox,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
184 oy,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
185 s->sprite_delta[0][0], s->sprite_delta[0][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
186 s->sprite_delta[1][0], s->sprite_delta[1][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
187 a+1, (1<<(2*a+1)) - s->no_rounding,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
188 s->h_edge_pos>>1, s->v_edge_pos>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
189
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
190 ptr = ref_picture[2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
191 s->dsp.gmc(dest_cr, ptr, uvlinesize, 8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
192 ox,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
193 oy,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
194 s->sprite_delta[0][0], s->sprite_delta[0][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
195 s->sprite_delta[1][0], s->sprite_delta[1][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
196 a+1, (1<<(2*a+1)) - s->no_rounding,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
197 s->h_edge_pos>>1, s->v_edge_pos>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
198 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
199
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
200 static inline int hpel_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
201 uint8_t *dest, uint8_t *src,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
202 int field_based, int field_select,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
203 int src_x, int src_y,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
204 int width, int height, int stride,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
205 int h_edge_pos, int v_edge_pos,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
206 int w, int h, op_pixels_func *pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
207 int motion_x, int motion_y)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
208 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
209 int dxy;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
210 int emu=0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
211
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
212 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
213 src_x += motion_x >> 1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
214 src_y += motion_y >> 1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
215
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
216 /* WARNING: do no forget half pels */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
217 src_x = av_clip(src_x, -16, width); //FIXME unneeded for emu?
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
218 if (src_x == width)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
219 dxy &= ~1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
220 src_y = av_clip(src_y, -16, height);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
221 if (src_y == height)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
222 dxy &= ~2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
223 src += src_y * stride + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
224
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
225 if(s->unrestricted_mv && (s->flags&CODEC_FLAG_EMU_EDGE)){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
226 if( (unsigned)src_x > h_edge_pos - (motion_x&1) - w
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
227 || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
228 ff_emulated_edge_mc(s->edge_emu_buffer, src, s->linesize, w+1, (h+1)<<field_based,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
229 src_x, src_y<<field_based, h_edge_pos, s->v_edge_pos);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
230 src= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
231 emu=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
232 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
233 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
234 if(field_select)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
235 src += s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
236 pix_op[dxy](dest, src, stride, h);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
237 return emu;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
238 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
239
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
240 static av_always_inline
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
241 void mpeg_motion_internal(MpegEncContext *s,
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
242 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
243 int field_based, int bottom_field, int field_select,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
244 uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
245 int motion_x, int motion_y, int h, int is_mpeg12)
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
246 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
247 uint8_t *ptr_y, *ptr_cb, *ptr_cr;
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
248 int dxy, uvdxy, mx, my, src_x, src_y,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
249 uvsrc_x, uvsrc_y, v_edge_pos, uvlinesize, linesize;
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
250
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
251 #if 0
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
252 if(s->quarter_sample)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
253 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
254 motion_x>>=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
255 motion_y>>=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
256 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
257 #endif
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
258
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
259 v_edge_pos = s->v_edge_pos >> field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
260 linesize = s->current_picture.linesize[0] << field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
261 uvlinesize = s->current_picture.linesize[1] << field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
262
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
263 dxy = ((motion_y & 1) << 1) | (motion_x & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
264 src_x = s->mb_x* 16 + (motion_x >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
265 src_y =(s->mb_y<<(4-field_based)) + (motion_y >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
266
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
267 if (!is_mpeg12 && s->out_format == FMT_H263) {
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
268 if((s->workaround_bugs & FF_BUG_HPEL_CHROMA) && field_based){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
269 mx = (motion_x>>1)|(motion_x&1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
270 my = motion_y >>1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
271 uvdxy = ((my & 1) << 1) | (mx & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
272 uvsrc_x = s->mb_x* 8 + (mx >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
273 uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
274 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
275 uvdxy = dxy | (motion_y & 2) | ((motion_x & 2) >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
276 uvsrc_x = src_x>>1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
277 uvsrc_y = src_y>>1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
278 }
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
279 }else if(!is_mpeg12 && s->out_format == FMT_H261){//even chroma mv's are full pel in H261
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
280 mx = motion_x / 4;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
281 my = motion_y / 4;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
282 uvdxy = 0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
283 uvsrc_x = s->mb_x*8 + mx;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
284 uvsrc_y = s->mb_y*8 + my;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
285 } else {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
286 if(s->chroma_y_shift){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
287 mx = motion_x / 2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
288 my = motion_y / 2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
289 uvdxy = ((my & 1) << 1) | (mx & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
290 uvsrc_x = s->mb_x* 8 + (mx >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
291 uvsrc_y = (s->mb_y<<(3-field_based)) + (my >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
292 } else {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
293 if(s->chroma_x_shift){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
294 //Chroma422
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
295 mx = motion_x / 2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
296 uvdxy = ((motion_y & 1) << 1) | (mx & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
297 uvsrc_x = s->mb_x* 8 + (mx >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
298 uvsrc_y = src_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
299 } else {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
300 //Chroma444
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
301 uvdxy = dxy;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
302 uvsrc_x = src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
303 uvsrc_y = src_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
304 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
305 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
306 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
307
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
308 ptr_y = ref_picture[0] + src_y * linesize + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
309 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
310 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
311
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
312 if( (unsigned)src_x > s->h_edge_pos - (motion_x&1) - 16
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
313 || (unsigned)src_y > v_edge_pos - (motion_y&1) - h){
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
314 if(is_mpeg12 || s->codec_id == CODEC_ID_MPEG2VIDEO ||
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
315 s->codec_id == CODEC_ID_MPEG1VIDEO){
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
316 av_log(s->avctx,AV_LOG_DEBUG,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
317 "MPEG motion vector out of boundary\n");
9352
03fd7ea4926b Try to honor even completely invalid motion vectors as far as is
michael
parents: 8718
diff changeset
318 if(!s->chroma_y_shift)
9425
1ff6eb1d7d14 fix indentation and remove whitespace after return
bcoudurier
parents: 9352
diff changeset
319 return;
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
320 }
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
321 ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
322 17, 17+field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
323 src_x, src_y<<field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
324 s->h_edge_pos, s->v_edge_pos);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
325 ptr_y = s->edge_emu_buffer;
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
326 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
327 uint8_t *uvbuf= s->edge_emu_buffer+18*s->linesize;
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
328 ff_emulated_edge_mc(uvbuf ,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
329 ptr_cb, s->uvlinesize,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
330 9, 9+field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
331 uvsrc_x, uvsrc_y<<field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
332 s->h_edge_pos>>1, s->v_edge_pos>>1);
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
333 ff_emulated_edge_mc(uvbuf+16,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
334 ptr_cr, s->uvlinesize,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
335 9, 9+field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
336 uvsrc_x, uvsrc_y<<field_based,
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
337 s->h_edge_pos>>1, s->v_edge_pos>>1);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
338 ptr_cb= uvbuf;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
339 ptr_cr= uvbuf+16;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
340 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
341 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
342
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
343 if(bottom_field){ //FIXME use this for field pix too instead of the obnoxious hack which changes picture.data
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
344 dest_y += s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
345 dest_cb+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
346 dest_cr+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
347 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
348
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
349 if(field_select){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
350 ptr_y += s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
351 ptr_cb+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
352 ptr_cr+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
353 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
354
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
355 pix_op[0][dxy](dest_y, ptr_y, linesize, h);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
356
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
357 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
358 pix_op[s->chroma_x_shift][uvdxy]
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
359 (dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift);
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
360 pix_op[s->chroma_x_shift][uvdxy]
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
361 (dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
362 }
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
363 if(!is_mpeg12 && (CONFIG_H261_ENCODER || CONFIG_H261_DECODER) &&
6578
dfa423a2fc78 cosmetics: Break some overly long lines.
diego
parents: 6481
diff changeset
364 s->out_format == FMT_H261){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
365 ff_h261_loop_filter(s);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
366 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
367 }
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
368 /* apply one mpeg motion vector to the three components */
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
369 static av_always_inline
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
370 void mpeg_motion(MpegEncContext *s,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
371 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
372 int field_based, int bottom_field, int field_select,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
373 uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
374 int motion_x, int motion_y, int h)
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
375 {
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 7937
diff changeset
376 #if !CONFIG_SMALL
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
377 if(s->out_format == FMT_MPEG1)
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
378 mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, field_based,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
379 bottom_field, field_select, ref_picture, pix_op,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
380 motion_x, motion_y, h, 1);
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
381 else
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
382 #endif
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
383 mpeg_motion_internal(s, dest_y, dest_cb, dest_cr, field_based,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
384 bottom_field, field_select, ref_picture, pix_op,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
385 motion_x, motion_y, h, 0);
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
386 }
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
387
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
388 //FIXME move to dsputil, avg variant, 16x16 version
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
389 static inline void put_obmc(uint8_t *dst, uint8_t *src[5], int stride){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
390 int x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
391 uint8_t * const top = src[1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
392 uint8_t * const left = src[2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
393 uint8_t * const mid = src[0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
394 uint8_t * const right = src[3];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
395 uint8_t * const bottom= src[4];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
396 #define OBMC_FILTER(x, t, l, m, r, b)\
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
397 dst[x]= (t*top[x] + l*left[x] + m*mid[x] + r*right[x] + b*bottom[x] + 4)>>3
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
398 #define OBMC_FILTER4(x, t, l, m, r, b)\
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
399 OBMC_FILTER(x , t, l, m, r, b);\
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
400 OBMC_FILTER(x+1 , t, l, m, r, b);\
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
401 OBMC_FILTER(x +stride, t, l, m, r, b);\
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
402 OBMC_FILTER(x+1+stride, t, l, m, r, b);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
403
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
404 x=0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
405 OBMC_FILTER (x , 2, 2, 4, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
406 OBMC_FILTER (x+1, 2, 1, 5, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
407 OBMC_FILTER4(x+2, 2, 1, 5, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
408 OBMC_FILTER4(x+4, 2, 0, 5, 1, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
409 OBMC_FILTER (x+6, 2, 0, 5, 1, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
410 OBMC_FILTER (x+7, 2, 0, 4, 2, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
411 x+= stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
412 OBMC_FILTER (x , 1, 2, 5, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
413 OBMC_FILTER (x+1, 1, 2, 5, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
414 OBMC_FILTER (x+6, 1, 0, 5, 2, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
415 OBMC_FILTER (x+7, 1, 0, 5, 2, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
416 x+= stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
417 OBMC_FILTER4(x , 1, 2, 5, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
418 OBMC_FILTER4(x+2, 1, 1, 6, 0, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
419 OBMC_FILTER4(x+4, 1, 0, 6, 1, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
420 OBMC_FILTER4(x+6, 1, 0, 5, 2, 0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
421 x+= 2*stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
422 OBMC_FILTER4(x , 0, 2, 5, 0, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
423 OBMC_FILTER4(x+2, 0, 1, 6, 0, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
424 OBMC_FILTER4(x+4, 0, 0, 6, 1, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
425 OBMC_FILTER4(x+6, 0, 0, 5, 2, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
426 x+= 2*stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
427 OBMC_FILTER (x , 0, 2, 5, 0, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
428 OBMC_FILTER (x+1, 0, 2, 5, 0, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
429 OBMC_FILTER4(x+2, 0, 1, 5, 0, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
430 OBMC_FILTER4(x+4, 0, 0, 5, 1, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
431 OBMC_FILTER (x+6, 0, 0, 5, 2, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
432 OBMC_FILTER (x+7, 0, 0, 5, 2, 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
433 x+= stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
434 OBMC_FILTER (x , 0, 2, 4, 0, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
435 OBMC_FILTER (x+1, 0, 1, 5, 0, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
436 OBMC_FILTER (x+6, 0, 0, 5, 1, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
437 OBMC_FILTER (x+7, 0, 0, 4, 2, 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
438 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
439
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
440 /* obmc for 1 8x8 luma block */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
441 static inline void obmc_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
442 uint8_t *dest, uint8_t *src,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
443 int src_x, int src_y,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
444 op_pixels_func *pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
445 int16_t mv[5][2]/* mid top left right bottom*/)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
446 #define MID 0
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
447 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
448 int i;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
449 uint8_t *ptr[5];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
450
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
451 assert(s->quarter_sample==0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
452
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
453 for(i=0; i<5; i++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
454 if(i && mv[i][0]==mv[MID][0] && mv[i][1]==mv[MID][1]){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
455 ptr[i]= ptr[MID];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
456 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
457 ptr[i]= s->obmc_scratchpad + 8*(i&1) + s->linesize*8*(i>>1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
458 hpel_motion(s, ptr[i], src, 0, 0,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
459 src_x, src_y,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
460 s->width, s->height, s->linesize,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
461 s->h_edge_pos, s->v_edge_pos,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
462 8, 8, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
463 mv[i][0], mv[i][1]);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
464 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
465 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
466
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
467 put_obmc(dest, ptr, s->linesize);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
468 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
469
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
470 static inline void qpel_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
471 uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
472 int field_based, int bottom_field, int field_select,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
473 uint8_t **ref_picture, op_pixels_func (*pix_op)[4],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
474 qpel_mc_func (*qpix_op)[16],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
475 int motion_x, int motion_y, int h)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
476 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
477 uint8_t *ptr_y, *ptr_cb, *ptr_cr;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
478 int dxy, uvdxy, mx, my, src_x, src_y, uvsrc_x, uvsrc_y, v_edge_pos, linesize, uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
479
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
480 dxy = ((motion_y & 3) << 2) | (motion_x & 3);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
481 src_x = s->mb_x * 16 + (motion_x >> 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
482 src_y = s->mb_y * (16 >> field_based) + (motion_y >> 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
483
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
484 v_edge_pos = s->v_edge_pos >> field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
485 linesize = s->linesize << field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
486 uvlinesize = s->uvlinesize << field_based;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
487
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
488 if(field_based){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
489 mx= motion_x/2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
490 my= motion_y>>1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
491 }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA2){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
492 static const int rtab[8]= {0,0,1,1,0,0,0,1};
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
493 mx= (motion_x>>1) + rtab[motion_x&7];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
494 my= (motion_y>>1) + rtab[motion_y&7];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
495 }else if(s->workaround_bugs&FF_BUG_QPEL_CHROMA){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
496 mx= (motion_x>>1)|(motion_x&1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
497 my= (motion_y>>1)|(motion_y&1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
498 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
499 mx= motion_x/2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
500 my= motion_y/2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
501 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
502 mx= (mx>>1)|(mx&1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
503 my= (my>>1)|(my&1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
504
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
505 uvdxy= (mx&1) | ((my&1)<<1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
506 mx>>=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
507 my>>=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
508
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
509 uvsrc_x = s->mb_x * 8 + mx;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
510 uvsrc_y = s->mb_y * (8 >> field_based) + my;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
511
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
512 ptr_y = ref_picture[0] + src_y * linesize + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
513 ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
514 ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
515
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
516 if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 16
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
517 || (unsigned)src_y > v_edge_pos - (motion_y&3) - h ){
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
518 ff_emulated_edge_mc(s->edge_emu_buffer, ptr_y, s->linesize,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
519 17, 17+field_based, src_x, src_y<<field_based,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
520 s->h_edge_pos, s->v_edge_pos);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
521 ptr_y= s->edge_emu_buffer;
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
522 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
523 uint8_t *uvbuf= s->edge_emu_buffer + 18*s->linesize;
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
524 ff_emulated_edge_mc(uvbuf, ptr_cb, s->uvlinesize,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
525 9, 9 + field_based,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
526 uvsrc_x, uvsrc_y<<field_based,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
527 s->h_edge_pos>>1, s->v_edge_pos>>1);
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
528 ff_emulated_edge_mc(uvbuf + 16, ptr_cr, s->uvlinesize,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
529 9, 9 + field_based,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
530 uvsrc_x, uvsrc_y<<field_based,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
531 s->h_edge_pos>>1, s->v_edge_pos>>1);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
532 ptr_cb= uvbuf;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
533 ptr_cr= uvbuf + 16;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
534 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
535 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
536
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
537 if(!field_based)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
538 qpix_op[0][dxy](dest_y, ptr_y, linesize);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
539 else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
540 if(bottom_field){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
541 dest_y += s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
542 dest_cb+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
543 dest_cr+= s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
544 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
545
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
546 if(field_select){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
547 ptr_y += s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
548 ptr_cb += s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
549 ptr_cr += s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
550 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
551 //damn interlaced mode
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
552 //FIXME boundary mirroring is not exactly correct here
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
553 qpix_op[1][dxy](dest_y , ptr_y , linesize);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
554 qpix_op[1][dxy](dest_y+8, ptr_y+8, linesize);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
555 }
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
556 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY)){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
557 pix_op[1][uvdxy](dest_cr, ptr_cr, uvlinesize, h >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
558 pix_op[1][uvdxy](dest_cb, ptr_cb, uvlinesize, h >> 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
559 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
560 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
561
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
562 /**
5428
750d76a34871 Fix typo
takis
parents: 5214
diff changeset
563 * h263 chroma 4mv motion compensation.
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
564 */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
565 static inline void chroma_4mv_motion(MpegEncContext *s,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
566 uint8_t *dest_cb, uint8_t *dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
567 uint8_t **ref_picture,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
568 op_pixels_func *pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
569 int mx, int my){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
570 int dxy, emu=0, src_x, src_y, offset;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
571 uint8_t *ptr;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
572
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
573 /* In case of 8X8, we construct a single chroma motion vector
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
574 with a special rounding */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
575 mx= ff_h263_round_chroma(mx);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
576 my= ff_h263_round_chroma(my);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
577
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
578 dxy = ((my & 1) << 1) | (mx & 1);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
579 mx >>= 1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
580 my >>= 1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
581
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
582 src_x = s->mb_x * 8 + mx;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
583 src_y = s->mb_y * 8 + my;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
584 src_x = av_clip(src_x, -8, s->width/2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
585 if (src_x == s->width/2)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
586 dxy &= ~1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
587 src_y = av_clip(src_y, -8, s->height/2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
588 if (src_y == s->height/2)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
589 dxy &= ~2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
590
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
591 offset = (src_y * (s->uvlinesize)) + src_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
592 ptr = ref_picture[1] + offset;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
593 if(s->flags&CODEC_FLAG_EMU_EDGE){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
594 if( (unsigned)src_x > (s->h_edge_pos>>1) - (dxy &1) - 8
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
595 || (unsigned)src_y > (s->v_edge_pos>>1) - (dxy>>1) - 8){
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
596 ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
597 9, 9, src_x, src_y,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
598 s->h_edge_pos>>1, s->v_edge_pos>>1);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
599 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
600 emu=1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
601 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
602 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
603 pix_op[dxy](dest_cb, ptr, s->uvlinesize, 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
604
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
605 ptr = ref_picture[2] + offset;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
606 if(emu){
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
607 ff_emulated_edge_mc(s->edge_emu_buffer, ptr, s->uvlinesize,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
608 9, 9, src_x, src_y,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
609 s->h_edge_pos>>1, s->v_edge_pos>>1);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
610 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
611 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
612 pix_op[dxy](dest_cr, ptr, s->uvlinesize, 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
613 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
614
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
615 static inline void prefetch_motion(MpegEncContext *s, uint8_t **pix, int dir){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
616 /* fetch pixels for estimated mv 4 macroblocks ahead
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
617 * optimized for 64byte cache lines */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
618 const int shift = s->quarter_sample ? 2 : 1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
619 const int mx= (s->mv[dir][0][0]>>shift) + 16*s->mb_x + 8;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
620 const int my= (s->mv[dir][0][1]>>shift) + 16*s->mb_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
621 int off= mx + (my + (s->mb_x&3)*4)*s->linesize + 64;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
622 s->dsp.prefetch(pix[0]+off, s->linesize, 4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
623 off= (mx>>1) + ((my>>1) + (s->mb_x&7))*s->uvlinesize + 64;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
624 s->dsp.prefetch(pix[1]+off, pix[2]-pix[1], 2);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
625 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
626
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
627 /**
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
628 * motion compensation of a single macroblock
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
629 * @param s context
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
630 * @param dest_y luma destination pointer
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
631 * @param dest_cb chroma cb/u destination pointer
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
632 * @param dest_cr chroma cr/v destination pointer
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
633 * @param dir direction (0->forward, 1->backward)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
634 * @param ref_picture array[3] of pointers to the 3 planes of the reference picture
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
635 * @param pic_op halfpel motion compensation function (average or put normally)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
636 * @param pic_op qpel motion compensation function (average or put normally)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
637 * the motion vectors are taken from s->mv and the MV type from s->mv_type
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
638 */
6659
4866b892ecbe Force inlining of MPV_motion_internal.
benoit
parents: 6658
diff changeset
639 static av_always_inline void MPV_motion_internal(MpegEncContext *s,
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
640 uint8_t *dest_y, uint8_t *dest_cb,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
641 uint8_t *dest_cr, int dir,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
642 uint8_t **ref_picture,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
643 op_pixels_func (*pix_op)[4],
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
644 qpel_mc_func (*qpix_op)[16], int is_mpeg12)
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
645 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
646 int dxy, mx, my, src_x, src_y, motion_x, motion_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
647 int mb_x, mb_y, i;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
648 uint8_t *ptr, *dest;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
649
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
650 mb_x = s->mb_x;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
651 mb_y = s->mb_y;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
652
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
653 prefetch_motion(s, ref_picture, dir);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
654
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
655 if(!is_mpeg12 && s->obmc && s->pict_type != FF_B_TYPE){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
656 int16_t mv_cache[4][4][2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
657 const int xy= s->mb_x + s->mb_y*s->mb_stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
658 const int mot_stride= s->b8_stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
659 const int mot_xy= mb_x*2 + mb_y*2*mot_stride;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
660
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
661 assert(!s->mb_skipped);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
662
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
663 memcpy(mv_cache[1][1], s->current_picture.motion_val[0][mot_xy ], sizeof(int16_t)*4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
664 memcpy(mv_cache[2][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
665 memcpy(mv_cache[3][1], s->current_picture.motion_val[0][mot_xy+mot_stride], sizeof(int16_t)*4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
666
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
667 if(mb_y==0 || IS_INTRA(s->current_picture.mb_type[xy-s->mb_stride])){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
668 memcpy(mv_cache[0][1], mv_cache[1][1], sizeof(int16_t)*4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
669 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
670 memcpy(mv_cache[0][1], s->current_picture.motion_val[0][mot_xy-mot_stride], sizeof(int16_t)*4);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
671 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
672
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
673 if(mb_x==0 || IS_INTRA(s->current_picture.mb_type[xy-1])){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
674 *(int32_t*)mv_cache[1][0]= *(int32_t*)mv_cache[1][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
675 *(int32_t*)mv_cache[2][0]= *(int32_t*)mv_cache[2][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
676 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
677 *(int32_t*)mv_cache[1][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
678 *(int32_t*)mv_cache[2][0]= *(int32_t*)s->current_picture.motion_val[0][mot_xy-1+mot_stride];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
679 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
680
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
681 if(mb_x+1>=s->mb_width || IS_INTRA(s->current_picture.mb_type[xy+1])){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
682 *(int32_t*)mv_cache[1][3]= *(int32_t*)mv_cache[1][2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
683 *(int32_t*)mv_cache[2][3]= *(int32_t*)mv_cache[2][2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
684 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
685 *(int32_t*)mv_cache[1][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
686 *(int32_t*)mv_cache[2][3]= *(int32_t*)s->current_picture.motion_val[0][mot_xy+2+mot_stride];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
687 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
688
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
689 mx = 0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
690 my = 0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
691 for(i=0;i<4;i++) {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
692 const int x= (i&1)+1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
693 const int y= (i>>1)+1;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
694 int16_t mv[5][2]= {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
695 {mv_cache[y][x ][0], mv_cache[y][x ][1]},
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
696 {mv_cache[y-1][x][0], mv_cache[y-1][x][1]},
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
697 {mv_cache[y][x-1][0], mv_cache[y][x-1][1]},
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
698 {mv_cache[y][x+1][0], mv_cache[y][x+1][1]},
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
699 {mv_cache[y+1][x][0], mv_cache[y+1][x][1]}};
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
700 //FIXME cleanup
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
701 obmc_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
702 ref_picture[0],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
703 mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >>1) * 8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
704 pix_op[1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
705 mv);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
706
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
707 mx += mv[0][0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
708 my += mv[0][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
709 }
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
710 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY))
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
711 chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
712
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
713 return;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
714 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
715
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
716 switch(s->mv_type) {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
717 case MV_TYPE_16X16:
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
718 if(s->mcsel){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
719 if(s->real_sprite_warping_points==1){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
720 gmc1_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
721 ref_picture);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
722 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
723 gmc_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
724 ref_picture);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
725 }
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
726 }else if(!is_mpeg12 && s->quarter_sample){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
727 qpel_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
728 0, 0, 0,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
729 ref_picture, pix_op, qpix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
730 s->mv[dir][0][0], s->mv[dir][0][1], 16);
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
731 }else if(!is_mpeg12 && CONFIG_WMV2 && s->mspel){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
732 ff_mspel_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
733 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
734 s->mv[dir][0][0], s->mv[dir][0][1], 16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
735 }else
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
736 {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
737 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
738 0, 0, 0,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
739 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
740 s->mv[dir][0][0], s->mv[dir][0][1], 16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
741 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
742 break;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
743 case MV_TYPE_8X8:
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
744 if (!is_mpeg12) {
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
745 mx = 0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
746 my = 0;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
747 if(s->quarter_sample){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
748 for(i=0;i<4;i++) {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
749 motion_x = s->mv[dir][i][0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
750 motion_y = s->mv[dir][i][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
751
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
752 dxy = ((motion_y & 3) << 2) | (motion_x & 3);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
753 src_x = mb_x * 16 + (motion_x >> 2) + (i & 1) * 8;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
754 src_y = mb_y * 16 + (motion_y >> 2) + (i >>1) * 8;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
755
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
756 /* WARNING: do no forget half pels */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
757 src_x = av_clip(src_x, -16, s->width);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
758 if (src_x == s->width)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
759 dxy &= ~3;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
760 src_y = av_clip(src_y, -16, s->height);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
761 if (src_y == s->height)
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
762 dxy &= ~12;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
763
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
764 ptr = ref_picture[0] + (src_y * s->linesize) + (src_x);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
765 if(s->flags&CODEC_FLAG_EMU_EDGE){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
766 if( (unsigned)src_x > s->h_edge_pos - (motion_x&3) - 8
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
767 || (unsigned)src_y > s->v_edge_pos - (motion_y&3) - 8 ){
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
768 ff_emulated_edge_mc(s->edge_emu_buffer, ptr,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
769 s->linesize, 9, 9,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
770 src_x, src_y,
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
771 s->h_edge_pos, s->v_edge_pos);
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
772 ptr= s->edge_emu_buffer;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
773 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
774 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
775 dest = dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
776 qpix_op[1][dxy](dest, ptr, s->linesize);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
777
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
778 mx += s->mv[dir][i][0]/2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
779 my += s->mv[dir][i][1]/2;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
780 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
781 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
782 for(i=0;i<4;i++) {
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
783 hpel_motion(s, dest_y + ((i & 1) * 8) + (i >> 1) * 8 * s->linesize,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
784 ref_picture[0], 0, 0,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
785 mb_x * 16 + (i & 1) * 8, mb_y * 16 + (i >>1) * 8,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
786 s->width, s->height, s->linesize,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
787 s->h_edge_pos, s->v_edge_pos,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
788 8, 8, pix_op[1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
789 s->mv[dir][i][0], s->mv[dir][i][1]);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
790
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
791 mx += s->mv[dir][i][0];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
792 my += s->mv[dir][i][1];
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
793 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
794 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
795
8596
68e959302527 replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
aurel
parents: 8590
diff changeset
796 if(!CONFIG_GRAY || !(s->flags&CODEC_FLAG_GRAY))
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
797 chroma_4mv_motion(s, dest_cb, dest_cr, ref_picture, pix_op[1], mx, my);
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
798 }
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
799 break;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
800 case MV_TYPE_FIELD:
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
801 if (s->picture_structure == PICT_FRAME) {
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
802 if(!is_mpeg12 && s->quarter_sample){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
803 for(i=0; i<2; i++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
804 qpel_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
805 1, i, s->field_select[dir][i],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
806 ref_picture, pix_op, qpix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
807 s->mv[dir][i][0], s->mv[dir][i][1], 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
808 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
809 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
810 /* top field */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
811 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
812 1, 0, s->field_select[dir][0],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
813 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
814 s->mv[dir][0][0], s->mv[dir][0][1], 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
815 /* bottom field */
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
816 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
817 1, 1, s->field_select[dir][1],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
818 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
819 s->mv[dir][1][0], s->mv[dir][1][1], 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
820 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
821 } else {
6481
493dc59d469a add FF_ prefix to all (frame)_TYPE usage
aurel
parents: 5830
diff changeset
822 if(s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != FF_B_TYPE && !s->first_field){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
823 ref_picture= s->current_picture_ptr->data;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
824 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
825
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
826 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
827 0, 0, s->field_select[dir][0],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
828 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
829 s->mv[dir][0][0], s->mv[dir][0][1], 16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
830 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
831 break;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
832 case MV_TYPE_16X8:
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
833 for(i=0; i<2; i++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
834 uint8_t ** ref2picture;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
835
6579
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
836 if(s->picture_structure == s->field_select[dir][i] + 1
bd5c42ff9e27 cosmetics: Break some overly long lines.
diego
parents: 6578
diff changeset
837 || s->pict_type == FF_B_TYPE || s->first_field){
5204
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
838 ref2picture= ref_picture;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
839 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
840 ref2picture= s->current_picture_ptr->data;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
841 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
842
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
843 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
844 0, 0, s->field_select[dir][i],
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
845 ref2picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
846 s->mv[dir][i][0], s->mv[dir][i][1] + 16*i, 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
847
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
848 dest_y += 16*s->linesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
849 dest_cb+= (16>>s->chroma_y_shift)*s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
850 dest_cr+= (16>>s->chroma_y_shift)*s->uvlinesize;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
851 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
852 break;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
853 case MV_TYPE_DMV:
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
854 if(s->picture_structure == PICT_FRAME){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
855 for(i=0; i<2; i++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
856 int j;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
857 for(j=0; j<2; j++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
858 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
859 1, j, j^i,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
860 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
861 s->mv[dir][2*i + j][0], s->mv[dir][2*i + j][1], 8);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
862 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
863 pix_op = s->dsp.avg_pixels_tab;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
864 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
865 }else{
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
866 for(i=0; i<2; i++){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
867 mpeg_motion(s, dest_y, dest_cb, dest_cr,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
868 0, 0, s->picture_structure != i+1,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
869 ref_picture, pix_op,
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
870 s->mv[dir][2*i][0],s->mv[dir][2*i][1],16);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
871
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
872 // after put we make avg of the same block
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
873 pix_op=s->dsp.avg_pixels_tab;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
874
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
875 //opposite parity is always in the same frame if this is second field
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
876 if(!s->first_field){
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
877 ref_picture = s->current_picture_ptr->data;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
878 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
879 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
880 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
881 break;
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
882 default: assert(0);
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
883 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
884 }
1c3baf4323bb Description: split mpegvideo.c
benoit
parents:
diff changeset
885
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
886 static inline void MPV_motion(MpegEncContext *s,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
887 uint8_t *dest_y, uint8_t *dest_cb,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
888 uint8_t *dest_cr, int dir,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
889 uint8_t **ref_picture,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
890 op_pixels_func (*pix_op)[4],
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
891 qpel_mc_func (*qpix_op)[16])
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
892 {
8590
7a463923ecd1 Change semantic of CONFIG_*, HAVE_* and ARCH_*.
aurel
parents: 7937
diff changeset
893 #if !CONFIG_SMALL
6658
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
894 if(s->out_format == FMT_MPEG1)
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
895 MPV_motion_internal(s, dest_y, dest_cb, dest_cr, dir,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
896 ref_picture, pix_op, qpix_op, 1);
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
897 else
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
898 #endif
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
899 MPV_motion_internal(s, dest_y, dest_cb, dest_cr, dir,
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
900 ref_picture, pix_op, qpix_op, 0);
7ecd59aa5757 Unroll codepath
benoit
parents: 6579
diff changeset
901 }
7760
c4a4495715dd Globally rename the header inclusion guard names.
stefano
parents: 6659
diff changeset
902 #endif /* AVCODEC_MPEGVIDEO_COMMON_H */