Mercurial > libavcodec.hg
comparison svq1enc.c @ 6481:493dc59d469a libavcodec
add FF_ prefix to all (frame)_TYPE usage
author | aurel |
---|---|
date | Sun, 09 Mar 2008 23:31:02 +0000 |
parents | eca08bfad00f |
children | 48759bfbd073 |
comparison
equal
deleted
inserted
replaced
6480:6f01a499e785 | 6481:493dc59d469a |
---|---|
80 put_bits(&s->pb, 8, 0x00); | 80 put_bits(&s->pb, 8, 0x00); |
81 | 81 |
82 /* frame type */ | 82 /* frame type */ |
83 put_bits(&s->pb, 2, frame_type - 1); | 83 put_bits(&s->pb, 2, frame_type - 1); |
84 | 84 |
85 if (frame_type == I_TYPE) { | 85 if (frame_type == FF_I_TYPE) { |
86 | 86 |
87 /* no checksum since frame code is 0x20 */ | 87 /* no checksum since frame code is 0x20 */ |
88 | 88 |
89 /* no embedded string either */ | 89 /* no embedded string either */ |
90 | 90 |
281 threshold[level] = threshold[level + 1] * THRESHOLD_MULTIPLIER; | 281 threshold[level] = threshold[level + 1] * THRESHOLD_MULTIPLIER; |
282 | 282 |
283 block_width = (width + 15) / 16; | 283 block_width = (width + 15) / 16; |
284 block_height = (height + 15) / 16; | 284 block_height = (height + 15) / 16; |
285 | 285 |
286 if(s->picture.pict_type == P_TYPE){ | 286 if(s->picture.pict_type == FF_P_TYPE){ |
287 s->m.avctx= s->avctx; | 287 s->m.avctx= s->avctx; |
288 s->m.current_picture_ptr= &s->m.current_picture; | 288 s->m.current_picture_ptr= &s->m.current_picture; |
289 s->m.last_picture_ptr = &s->m.last_picture; | 289 s->m.last_picture_ptr = &s->m.last_picture; |
290 s->m.last_picture.data[0]= ref_plane; | 290 s->m.last_picture.data[0]= ref_plane; |
291 s->m.linesize= | 291 s->m.linesize= |
387 | 387 |
388 s->m.mb_x= x; | 388 s->m.mb_x= x; |
389 ff_init_block_index(&s->m); | 389 ff_init_block_index(&s->m); |
390 ff_update_block_index(&s->m); | 390 ff_update_block_index(&s->m); |
391 | 391 |
392 if(s->picture.pict_type == I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){ | 392 if(s->picture.pict_type == FF_I_TYPE || (s->m.mb_type[x + y*s->m.mb_stride]&CANDIDATE_MB_TYPE_INTRA)){ |
393 for(i=0; i<6; i++){ | 393 for(i=0; i<6; i++){ |
394 init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32); | 394 init_put_bits(&s->reorder_pb[i], reorder_buffer[0][i], 7*32); |
395 } | 395 } |
396 if(s->picture.pict_type == P_TYPE){ | 396 if(s->picture.pict_type == FF_P_TYPE){ |
397 const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; | 397 const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTRA]; |
398 put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); | 398 put_bits(&s->reorder_pb[5], vlc[1], vlc[0]); |
399 score[0]= vlc[1]*lambda; | 399 score[0]= vlc[1]*lambda; |
400 } | 400 } |
401 score[0]+= encode_block(s, src+16*x, NULL, temp, stride, 5, 64, lambda, 1); | 401 score[0]+= encode_block(s, src+16*x, NULL, temp, stride, 5, 64, lambda, 1); |
406 }else | 406 }else |
407 score[0]= INT_MAX; | 407 score[0]= INT_MAX; |
408 | 408 |
409 best=0; | 409 best=0; |
410 | 410 |
411 if(s->picture.pict_type == P_TYPE){ | 411 if(s->picture.pict_type == FF_P_TYPE){ |
412 const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; | 412 const uint8_t *vlc= ff_svq1_block_type_vlc[SVQ1_BLOCK_INTER]; |
413 int mx, my, pred_x, pred_y, dxy; | 413 int mx, my, pred_x, pred_y, dxy; |
414 int16_t *motion_ptr; | 414 int16_t *motion_ptr; |
415 | 415 |
416 motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y); | 416 motion_ptr= h263_pred_motion(&s->m, 0, 0, &pred_x, &pred_y); |
531 s->last_picture= temp; | 531 s->last_picture= temp; |
532 | 532 |
533 init_put_bits(&s->pb, buf, buf_size); | 533 init_put_bits(&s->pb, buf, buf_size); |
534 | 534 |
535 *p = *pict; | 535 *p = *pict; |
536 p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? P_TYPE : I_TYPE; | 536 p->pict_type = avctx->gop_size && avctx->frame_number % avctx->gop_size ? FF_P_TYPE : FF_I_TYPE; |
537 p->key_frame = p->pict_type == I_TYPE; | 537 p->key_frame = p->pict_type == FF_I_TYPE; |
538 | 538 |
539 svq1_write_header(s, p->pict_type); | 539 svq1_write_header(s, p->pict_type); |
540 for(i=0; i<3; i++){ | 540 for(i=0; i<3; i++){ |
541 if(svq1_encode_plane(s, i, | 541 if(svq1_encode_plane(s, i, |
542 s->picture.data[i], s->last_picture.data[i], s->current_picture.data[i], | 542 s->picture.data[i], s->last_picture.data[i], s->current_picture.data[i], |