comparison svq3.c @ 2967:ef2149182f1c libavcodec

COSMETICS: Remove all trailing whitespace.
author diego
date Sat, 17 Dec 2005 18:14:38 +0000
parents 564788471dd4
children bfabfdf9ce55
comparison
equal deleted inserted replaced
2966:564788471dd4 2967:ef2149182f1c
24 * decoders need information in this atom to operate correctly. Such 24 * decoders need information in this atom to operate correctly. Such
25 * is the case with SVQ3. In order to get the best use out of this decoder, 25 * is the case with SVQ3. In order to get the best use out of this decoder,
26 * the calling app must make the SVQ3 ImageDescription atom available 26 * the calling app must make the SVQ3 ImageDescription atom available
27 * via the AVCodecContext's extradata[_size] field: 27 * via the AVCodecContext's extradata[_size] field:
28 * 28 *
29 * AVCodecContext.extradata = pointer to ImageDescription, first characters 29 * AVCodecContext.extradata = pointer to ImageDescription, first characters
30 * are expected to be 'S', 'V', 'Q', and '3', NOT the 4-byte atom length 30 * are expected to be 'S', 'V', 'Q', and '3', NOT the 4-byte atom length
31 * AVCodecContext.extradata_size = size of ImageDescription atom memory 31 * AVCodecContext.extradata_size = size of ImageDescription atom memory
32 * buffer (which will be the same as the ImageDescription atom size field 32 * buffer (which will be the same as the ImageDescription atom size field
33 * from the QT file, minus 4 bytes since the length is missing) 33 * from the QT file, minus 4 bytes since the length is missing)
34 * 34 *
35 * You will know you have these parameters passed correctly when the decoder 35 * You will know you have these parameters passed correctly when the decoder
36 * correctly decodes this file: 36 * correctly decodes this file:
37 * ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov 37 * ftp://ftp.mplayerhq.hu/MPlayer/samples/V-codecs/SVQ3/Vertical400kbit.sorenson3.mov
38 * 38 *
39 */ 39 */
40 40
41 /** 41 /**
42 * @file svq3.c 42 * @file svq3.c
43 * svq3 decoder. 43 * svq3 decoder.
44 */ 44 */
45 45
46 #define FULLPEL_MODE 1 46 #define FULLPEL_MODE 1
47 #define HALFPEL_MODE 2 47 #define HALFPEL_MODE 2
48 #define THIRDPEL_MODE 3 48 #define THIRDPEL_MODE 3
49 #define PREDICT_MODE 4 49 #define PREDICT_MODE 4
50 50
51 /* dual scan (from some older h264 draft) 51 /* dual scan (from some older h264 draft)
52 o-->o-->o o 52 o-->o-->o o
53 | /| 53 | /|
54 o o o / o 54 o o o / o
55 | / | |/ | 55 | / | |/ |
56 o o o o 56 o o o o
57 / 57 /
58 o-->o-->o-->o 58 o-->o-->o-->o
59 */ 59 */
60 static const uint8_t svq3_scan[16]={ 60 static const uint8_t svq3_scan[16]={
61 0+0*4, 1+0*4, 2+0*4, 2+1*4, 61 0+0*4, 1+0*4, 2+0*4, 2+1*4,
62 2+2*4, 3+0*4, 3+1*4, 3+2*4, 62 2+2*4, 3+0*4, 3+1*4, 3+2*4,
177 dst[i + stride*3]= cm[ dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) ]; 177 dst[i + stride*3]= cm[ dst[i + stride*3] + (((z0 - z3)*qmul + rr) >> 20) ];
178 } 178 }
179 } 179 }
180 180
181 static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){ 181 static void pred4x4_down_left_svq3_c(uint8_t *src, uint8_t *topright, int stride){
182 LOAD_TOP_EDGE 182 LOAD_TOP_EDGE
183 LOAD_LEFT_EDGE 183 LOAD_LEFT_EDGE
184 const __attribute__((unused)) int unu0= t0; 184 const __attribute__((unused)) int unu0= t0;
185 const __attribute__((unused)) int unu1= l0; 185 const __attribute__((unused)) int unu1= l0;
186 186
187 src[0+0*stride]=(l1 + t1)>>1; 187 src[0+0*stride]=(l1 + t1)>>1;
188 src[1+0*stride]= 188 src[1+0*stride]=
273 int i, emu = 0; 273 int i, emu = 0;
274 int blocksize= 2 - (width>>3); //16->0, 8->1, 4->2 274 int blocksize= 2 - (width>>3); //16->0, 8->1, 4->2
275 275
276 mx += x; 276 mx += x;
277 my += y; 277 my += y;
278 278
279 if (mx < 0 || mx >= (s->h_edge_pos - width - 1) || 279 if (mx < 0 || mx >= (s->h_edge_pos - width - 1) ||
280 my < 0 || my >= (s->v_edge_pos - height - 1)) { 280 my < 0 || my >= (s->v_edge_pos - height - 1)) {
281 281
282 if ((s->flags & CODEC_FLAG_EMU_EDGE)) { 282 if ((s->flags & CODEC_FLAG_EMU_EDGE)) {
283 emu = 1; 283 emu = 1;
478 N??11111 478 N??11111
479 N??11111 479 N??11111
480 N??11111 480 N??11111
481 N 481 N
482 */ 482 */
483 483
484 for (m=0; m < 2; m++) { 484 for (m=0; m < 2; m++) {
485 if (s->mb_x > 0 && h->intra4x4_pred_mode[mb_xy - 1][0] != -1) { 485 if (s->mb_x > 0 && h->intra4x4_pred_mode[mb_xy - 1][0] != -1) {
486 for (i=0; i < 4; i++) { 486 for (i=0; i < 4; i++) {
487 *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - 1 + i*h->b_stride]; 487 *(uint32_t *) h->mv_cache[m][scan8[0] - 1 + i*8] = *(uint32_t *) s->current_picture.motion_val[m][b_xy - 1 + i*h->b_stride];
488 } 488 }
878 878
879 s->pict_type = h->slice_type; 879 s->pict_type = h->slice_type;
880 s->picture_number = h->slice_num; 880 s->picture_number = h->slice_num;
881 881
882 if(avctx->debug&FF_DEBUG_PICT_INFO){ 882 if(avctx->debug&FF_DEBUG_PICT_INFO){
883 av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d\n", 883 av_log(h->s.avctx, AV_LOG_DEBUG, "%c hpel:%d, tpel:%d aqp:%d qp:%d\n",
884 av_get_pict_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag, 884 av_get_pict_type_char(s->pict_type), h->halfpel_flag, h->thirdpel_flag,
885 s->adaptive_quant, s->qscale 885 s->adaptive_quant, s->qscale
886 ); 886 );
887 } 887 }
888 888
937 for(j=-1; j<4; j++) 937 for(j=-1; j<4; j++)
938 h->ref_cache[m][scan8[0] + 8*i + j]= 1; 938 h->ref_cache[m][scan8[0] + 8*i + j]= 1;
939 h->ref_cache[m][scan8[0] + 8*i + j]= PART_NOT_AVAILABLE; 939 h->ref_cache[m][scan8[0] + 8*i + j]= PART_NOT_AVAILABLE;
940 } 940 }
941 } 941 }
942 942
943 for (s->mb_y=0; s->mb_y < s->mb_height; s->mb_y++) { 943 for (s->mb_y=0; s->mb_y < s->mb_height; s->mb_y++) {
944 for (s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) { 944 for (s->mb_x=0; s->mb_x < s->mb_width; s->mb_x++) {
945 945
946 if ( (get_bits_count(&s->gb) + 7) >= s->gb.size_in_bits && 946 if ( (get_bits_count(&s->gb) + 7) >= s->gb.size_in_bits &&
947 ((get_bits_count(&s->gb) & 7) == 0 || show_bits (&s->gb, (-get_bits_count(&s->gb) & 7)) == 0)) { 947 ((get_bits_count(&s->gb) & 7) == 0 || show_bits (&s->gb, (-get_bits_count(&s->gb) & 7)) == 0)) {