diff options
author | Aurelien Jacobs <aurel@gnuage.org> | 2009-01-14 17:19:17 +0000 |
---|---|---|
committer | Aurelien Jacobs <aurel@gnuage.org> | 2009-01-14 17:19:17 +0000 |
commit | 49fb20cb8a5da4250c978bd8cea8bd841dc0594f (patch) | |
tree | 142746aa8ae9cf412da3a61ac287c4d9deb7ca22 /libavcodec/mpegvideo_enc.c | |
parent | 7356aaa78626b34c3b2779c7af84c92111025ebf (diff) | |
download | ffmpeg-49fb20cb8a5da4250c978bd8cea8bd841dc0594f.tar.gz |
replace all occurrence of ENABLE_ by the corresponding CONFIG_, HAVE_ or ARCH_
and remove all ENABLE_ definitions.
Originally committed as revision 16600 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r-- | libavcodec/mpegvideo_enc.c | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index ae00b02684..dc8dd74778 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -518,14 +518,14 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->mjpeg_hsample[0] = 2; s->mjpeg_hsample[1] = 2>>chroma_h_shift; s->mjpeg_hsample[2] = 2>>chroma_h_shift; - if (!(ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) + if (!(CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) || ff_mjpeg_encode_init(s) < 0) return -1; avctx->delay=0; s->low_delay=1; break; case CODEC_ID_H261: - if (!ENABLE_H261_ENCODER) return -1; + if (!CONFIG_H261_ENCODER) return -1; if (ff_h261_get_picture_format(s->width, s->height) < 0) { av_log(avctx, AV_LOG_ERROR, "The specified picture size of %dx%d is not valid for the H.261 codec.\nValid sizes are 176x144, 352x288\n", s->width, s->height); return -1; @@ -535,7 +535,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->low_delay=1; break; case CODEC_ID_H263: - if (!ENABLE_H263_ENCODER) return -1; + if (!CONFIG_H263_ENCODER) return -1; if (h263_get_picture_format(s->width, s->height) == 7) { av_log(avctx, AV_LOG_INFO, "The specified picture size of %dx%d is not valid for the H.263 codec.\nValid sizes are 128x96, 176x144, 352x288, 704x576, and 1408x1152. Try H.263+.\n", s->width, s->height); return -1; @@ -661,7 +661,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) if(avctx->trellis) s->dct_quantize = dct_quantize_trellis_c; - if((ENABLE_H263P_ENCODER || ENABLE_RV20_ENCODER) && s->modified_quant) + if((CONFIG_H263P_ENCODER || CONFIG_RV20_ENCODER) && s->modified_quant) s->chroma_qscale_table= ff_h263_chroma_qscale_table; s->progressive_frame= s->progressive_sequence= !(avctx->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME|CODEC_FLAG_ALT_SCAN)); @@ -670,20 +670,20 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) ff_set_cmp(&s->dsp, s->dsp.ildct_cmp, s->avctx->ildct_cmp); ff_set_cmp(&s->dsp, s->dsp.frame_skip_cmp, s->avctx->frame_skip_cmp); - if (ENABLE_H261_ENCODER && s->out_format == FMT_H261) + if (CONFIG_H261_ENCODER && s->out_format == FMT_H261) ff_h261_encode_init(s); - if (ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263) + if (CONFIG_ANY_H263_ENCODER && s->out_format == FMT_H263) h263_encode_init(s); - if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version) + if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version) ff_msmpeg4_encode_init(s); - if ((ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) + if ((CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) && s->out_format == FMT_MPEG1) ff_mpeg1_encode_init(s); /* init q matrix */ for(i=0;i<64;i++) { int j= s->dsp.idct_permutation[i]; - if(ENABLE_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4 && s->mpeg_quant){ + if(CONFIG_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4 && s->mpeg_quant){ s->intra_matrix[j] = ff_mpeg4_default_intra_matrix[i]; s->inter_matrix[j] = ff_mpeg4_default_non_intra_matrix[i]; }else if(s->out_format == FMT_H263 || s->out_format == FMT_H261){ @@ -722,7 +722,7 @@ av_cold int MPV_encode_end(AVCodecContext *avctx) ff_rate_control_uninit(s); MPV_common_end(s); - if ((ENABLE_MJPEG_ENCODER || ENABLE_LJPEG_ENCODER) && s->out_format == FMT_MJPEG) + if ((CONFIG_MJPEG_ENCODER || CONFIG_LJPEG_ENCODER) && s->out_format == FMT_MJPEG) ff_mjpeg_encode_close(s); av_freep(&avctx->extradata); @@ -1226,7 +1226,7 @@ vbv_retry: MPV_frame_end(s); - if (ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG) + if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG) ff_mjpeg_encode_picture_trailer(s); if(avctx->rc_buffer_size){ @@ -1687,25 +1687,25 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, switch(s->codec_id){ //FIXME funct ptr could be slightly faster case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: - if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) + if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) mpeg1_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MPEG4: - if (ENABLE_MPEG4_ENCODER) + if (CONFIG_MPEG4_ENCODER) mpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MSMPEG4V2: case CODEC_ID_MSMPEG4V3: case CODEC_ID_WMV1: - if (ENABLE_MSMPEG4_ENCODER) + if (CONFIG_MSMPEG4_ENCODER) msmpeg4_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_WMV2: - if (ENABLE_WMV2_ENCODER) + if (CONFIG_WMV2_ENCODER) ff_wmv2_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H261: - if (ENABLE_H261_ENCODER) + if (CONFIG_H261_ENCODER) ff_h261_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_H263: @@ -1713,12 +1713,12 @@ static av_always_inline void encode_mb_internal(MpegEncContext *s, int motion_x, case CODEC_ID_FLV1: case CODEC_ID_RV10: case CODEC_ID_RV20: - if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || - ENABLE_FLV_ENCODER || ENABLE_RV10_ENCODER || ENABLE_RV20_ENCODER) + if (CONFIG_H263_ENCODER || CONFIG_H263P_ENCODER || + CONFIG_FLV_ENCODER || CONFIG_RV10_ENCODER || CONFIG_RV20_ENCODER) h263_encode_mb(s, s->block, motion_x, motion_y); break; case CODEC_ID_MJPEG: - if (ENABLE_MJPEG_ENCODER) + if (CONFIG_MJPEG_ENCODER) ff_mjpeg_encode_mb(s, s->block); break; default: @@ -1965,13 +1965,13 @@ static int mb_var_thread(AVCodecContext *c, void *arg){ } static void write_slice_end(MpegEncContext *s){ - if(ENABLE_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4){ + if(CONFIG_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4){ if(s->partitioned_frame){ ff_mpeg4_merge_partitions(s); } ff_mpeg4_stuffing(&s->pb); - }else if(ENABLE_MJPEG_ENCODER && s->out_format == FMT_MJPEG){ + }else if(CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG){ ff_mjpeg_encode_stuffing(&s->pb); } @@ -2028,11 +2028,11 @@ static int encode_thread(AVCodecContext *c, void *arg){ case CODEC_ID_H263: case CODEC_ID_H263P: case CODEC_ID_FLV1: - if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER || ENABLE_FLV_ENCODER) + if (CONFIG_H263_ENCODER || CONFIG_H263P_ENCODER || CONFIG_FLV_ENCODER) s->gob_index = ff_h263_get_gob_height(s); break; case CODEC_ID_MPEG4: - if(ENABLE_MPEG4_ENCODER && s->partitioned_frame) + if(CONFIG_MPEG4_ENCODER && s->partitioned_frame) ff_mpeg4_init_partitions(s); break; } @@ -2072,7 +2072,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ s->mb_y = mb_y; // moved into loop, can get changed by H.261 ff_update_block_index(s); - if(ENABLE_H261_ENCODER && s->codec_id == CODEC_ID_H261){ + if(CONFIG_H261_ENCODER && s->codec_id == CODEC_ID_H261){ ff_h261_reorder_mb_index(s); xy= s->mb_y*s->mb_stride + s->mb_x; mb_type= s->mb_type[xy]; @@ -2105,7 +2105,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(s->start_mb_y != mb_y || mb_x!=0){ write_slice_end(s); - if(ENABLE_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){ + if(CONFIG_MPEG4_ENCODER && s->codec_id==CODEC_ID_MPEG4 && s->partitioned_frame){ ff_mpeg4_init_partitions(s); } } @@ -2132,21 +2132,21 @@ static int encode_thread(AVCodecContext *c, void *arg){ switch(s->codec_id){ case CODEC_ID_MPEG4: - if (ENABLE_MPEG4_ENCODER) { + if (CONFIG_MPEG4_ENCODER) { ff_mpeg4_encode_video_packet_header(s); ff_mpeg4_clean_buffers(s); } break; case CODEC_ID_MPEG1VIDEO: case CODEC_ID_MPEG2VIDEO: - if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) { + if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) { ff_mpeg1_encode_slice_header(s); ff_mpeg1_clean_buffers(s); } break; case CODEC_ID_H263: case CODEC_ID_H263P: - if (ENABLE_H263_ENCODER || ENABLE_H263P_ENCODER) + if (CONFIG_H263_ENCODER || CONFIG_H263P_ENCODER) h263_encode_gob_header(s, mb_y); break; } @@ -2355,7 +2355,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } } } - if(ENABLE_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT){ + if(CONFIG_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT){ int mx= s->b_direct_mv_table[xy][0]; int my= s->b_direct_mv_table[xy][1]; @@ -2366,7 +2366,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ encode_mb_hq(s, &backup_s, &best_s, CANDIDATE_MB_TYPE_DIRECT, pb, pb2, tex_pb, &dmin, &next_block, mx, my); } - if(ENABLE_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT0){ + if(CONFIG_MPEG4_ENCODER && mb_type&CANDIDATE_MB_TYPE_DIRECT0){ backup_s.dquant = 0; s->mv_dir = MV_DIR_FORWARD | MV_DIR_BACKWARD | MV_DIRECT; s->mb_intra= 0; @@ -2381,7 +2381,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ if(coded){ int mx,my; memcpy(s->mv, best_s.mv, sizeof(s->mv)); - if(ENABLE_MPEG4_ENCODER && best_s.mv_dir & MV_DIRECT){ + if(CONFIG_MPEG4_ENCODER && best_s.mv_dir & MV_DIRECT){ mx=my=0; //FIXME find the one we actually used ff_mpeg4_set_direct_mv(s, mx, my); }else if(best_s.mv_dir&MV_DIR_BACKWARD){ @@ -2429,7 +2429,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } s->last_bits= put_bits_count(&s->pb); - if (ENABLE_ANY_H263_ENCODER && + if (CONFIG_ANY_H263_ENCODER && s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE) ff_h263_update_motion_val(s); @@ -2479,7 +2479,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } break; case CANDIDATE_MB_TYPE_DIRECT: - if (ENABLE_MPEG4_ENCODER) { + if (CONFIG_MPEG4_ENCODER) { s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT; s->mb_intra= 0; motion_x=s->b_direct_mv_table[xy][0]; @@ -2488,7 +2488,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } break; case CANDIDATE_MB_TYPE_DIRECT0: - if (ENABLE_MPEG4_ENCODER) { + if (CONFIG_MPEG4_ENCODER) { s->mv_dir = MV_DIR_FORWARD|MV_DIR_BACKWARD|MV_DIRECT; s->mb_intra= 0; ff_mpeg4_set_direct_mv(s, 0, 0); @@ -2556,7 +2556,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ // RAL: Update last macroblock type s->last_mv_dir = s->mv_dir; - if (ENABLE_ANY_H263_ENCODER && + if (CONFIG_ANY_H263_ENCODER && s->out_format == FMT_H263 && s->pict_type!=FF_B_TYPE) ff_h263_update_motion_val(s); @@ -2587,7 +2587,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ s->dest[2], w>>1, h>>s->chroma_y_shift, s->uvlinesize); } if(s->loop_filter){ - if(ENABLE_ANY_H263_ENCODER && s->out_format == FMT_H263) + if(CONFIG_ANY_H263_ENCODER && s->out_format == FMT_H263) ff_h263_loop_filter(s); } //printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_stride, put_bits_count(&s->pb)); @@ -2595,7 +2595,7 @@ static int encode_thread(AVCodecContext *c, void *arg){ } //not beautiful here but we must write it before flushing so it has to be here - if (ENABLE_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == FF_I_TYPE) + if (CONFIG_MSMPEG4_ENCODER && s->msmpeg4_version && s->msmpeg4_version<4 && s->pict_type == FF_I_TYPE) msmpeg4_encode_ext_header(s); write_slice_end(s); @@ -2666,13 +2666,13 @@ static int estimate_qp(MpegEncContext *s, int dry_run){ if(s->adaptive_quant){ switch(s->codec_id){ case CODEC_ID_MPEG4: - if (ENABLE_MPEG4_ENCODER) + if (CONFIG_MPEG4_ENCODER) ff_clean_mpeg4_qscales(s); break; case CODEC_ID_H263: case CODEC_ID_H263P: case CODEC_ID_FLV1: - if (ENABLE_H263_ENCODER||ENABLE_H263P_ENCODER||ENABLE_FLV_ENCODER) + if (CONFIG_H263_ENCODER||CONFIG_H263P_ENCODER||CONFIG_FLV_ENCODER) ff_clean_h263_qscales(s); break; } @@ -2716,7 +2716,7 @@ static int encode_picture(MpegEncContext *s, int picture_number) // RAL: Condition added for MPEG1VIDEO if (s->codec_id == CODEC_ID_MPEG1VIDEO || s->codec_id == CODEC_ID_MPEG2VIDEO || (s->h263_pred && !s->h263_msmpeg4)) set_frame_distances(s); - if(ENABLE_MPEG4_ENCODER && s->codec_id == CODEC_ID_MPEG4) + if(CONFIG_MPEG4_ENCODER && s->codec_id == CODEC_ID_MPEG4) ff_set_mpeg4_time(s); s->me.scene_change_score=0; @@ -2871,31 +2871,31 @@ static int encode_picture(MpegEncContext *s, int picture_number) s->last_bits= put_bits_count(&s->pb); switch(s->out_format) { case FMT_MJPEG: - if (ENABLE_MJPEG_ENCODER) + if (CONFIG_MJPEG_ENCODER) ff_mjpeg_encode_picture_header(s); break; case FMT_H261: - if (ENABLE_H261_ENCODER) + if (CONFIG_H261_ENCODER) ff_h261_encode_picture_header(s, picture_number); break; case FMT_H263: - if (ENABLE_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2) + if (CONFIG_WMV2_ENCODER && s->codec_id == CODEC_ID_WMV2) ff_wmv2_encode_picture_header(s, picture_number); - else if (ENABLE_MSMPEG4_ENCODER && s->h263_msmpeg4) + else if (CONFIG_MSMPEG4_ENCODER && s->h263_msmpeg4) msmpeg4_encode_picture_header(s, picture_number); - else if (ENABLE_MPEG4_ENCODER && s->h263_pred) + else if (CONFIG_MPEG4_ENCODER && s->h263_pred) mpeg4_encode_picture_header(s, picture_number); - else if (ENABLE_RV10_ENCODER && s->codec_id == CODEC_ID_RV10) + else if (CONFIG_RV10_ENCODER && s->codec_id == CODEC_ID_RV10) rv10_encode_picture_header(s, picture_number); - else if (ENABLE_RV20_ENCODER && s->codec_id == CODEC_ID_RV20) + else if (CONFIG_RV20_ENCODER && s->codec_id == CODEC_ID_RV20) rv20_encode_picture_header(s, picture_number); - else if (ENABLE_FLV_ENCODER && s->codec_id == CODEC_ID_FLV1) + else if (CONFIG_FLV_ENCODER && s->codec_id == CODEC_ID_FLV1) ff_flv_encode_picture_header(s, picture_number); - else if (ENABLE_ANY_H263_ENCODER) + else if (CONFIG_ANY_H263_ENCODER) h263_encode_picture_header(s, picture_number); break; case FMT_MPEG1: - if (ENABLE_MPEG1VIDEO_ENCODER || ENABLE_MPEG2VIDEO_ENCODER) + if (CONFIG_MPEG1VIDEO_ENCODER || CONFIG_MPEG2VIDEO_ENCODER) mpeg1_encode_picture_header(s, picture_number); break; case FMT_H264: |