$NetBSD: patch-ae,v 1.4 2006/10/13 12:51:27 tron Exp $ --- scripts/anytovcd.sh.orig 2005-07-21 14:53:00.000000000 +0100 +++ scripts/anytovcd.sh 2006-10-13 13:25:11.000000000 +0100 @@ -313,7 +313,7 @@ esac done -if test "${VIDEO_SRC}" == "" || ! test -r "${VIDEO_SRC}"; then +if test "${VIDEO_SRC}" = "" || ! test -r "${VIDEO_SRC}"; then show_error "input file not specified or not present." show_error "Use -h to get help." @@ -333,15 +333,15 @@ VID_SIZE_SRC="`probe_vid_size "${VIDEO_SRC}"`" # input interlacing -if test "${INTERLACING}" == "none"; then +if test "${INTERLACING}" = "none"; then VID_ILACE_SRC="p" -elif test "${INTERLACING}" == "top_first"; then +elif test "${INTERLACING}" = "top_first"; then VID_ILACE_SRC="t" -elif test "${INTERLACING}" == "bottom_first"; then +elif test "${INTERLACING}" = "bottom_first"; then VID_ILACE_SRC="b" @@ -352,15 +352,15 @@ fi # output interlacing -if test "${INTERLACING_OUT}" == "none"; then +if test "${INTERLACING_OUT}" = "none"; then VID_ILACE_OUT="p" -elif test "${INTERLACING_OUT}" == "top_first"; then +elif test "${INTERLACING_OUT}" = "top_first"; then VID_ILACE_OUT="t" -elif test "${INTERLACING_OUT}" == "bottom_first"; then +elif test "${INTERLACING_OUT}" = "bottom_first"; then VID_ILACE_OUT="b" @@ -371,14 +371,14 @@ fi # input framerate -if test "${VID_FPS_SRC}" == ""; then +if test "${VID_FPS_SRC}" = ""; then VID_FPS_SRC="`probe_vid_fps "${VIDEO_SRC}"`" fi # input pixel/sample aspect ratio -if test "${VID_SAR_SRC}" == ""; then +if test "${VID_SAR_SRC}" = ""; then if which ${TRANSCODE} >/dev/null; then @@ -396,7 +396,7 @@ VID_SAR_N_SRC="`echo ${VID_SAR_SRC} | cut -d: -f1`" VID_SAR_D_SRC="`echo ${VID_SAR_SRC} | cut -d: -f2`" -if test "${VID_SAR_N_SRC}" == "0" || test "${VID_SAR_D_SRC}" == "0"; then +if test "${VID_SAR_N_SRC}" = "0" || test "${VID_SAR_D_SRC}" = "0"; then show_warn "Unknown pixel aspect ratio, defaulting to 1:1" VID_SAR_SRC="1:1" @@ -423,15 +423,15 @@ fi # quality presets -if test "${QUALITY}" == "best"; then +if test "${QUALITY}" = "best"; then QUANT="4" -elif test "${QUALITY}" == "good"; then +elif test "${QUALITY}" = "good"; then QUANT="5" -elif test "${QUALITY}" == "fair"; then +elif test "${QUALITY}" = "fair"; then QUANT="6" @@ -444,7 +444,7 @@ fi # profile(s) -if test "${VCD_TYPE}" == "cvd"; then +if test "${VCD_TYPE}" = "cvd"; then FF_ENC="${FF_ENC} -vcodec mpeg2video -f rawvideo -bufsize 224" MPEG2ENC="${MPEG2ENC} -f 8" @@ -468,7 +468,7 @@ # default volume size in mbytes (m = 1000) VOL_SIZE="4700" -elif test "${VCD_TYPE}" == "cvd_wide"; then +elif test "${VCD_TYPE}" = "cvd_wide"; then FF_ENC="${FF_ENC} -vcodec mpeg2video -f rawvideo -bufsize 224" MPEG2ENC="${MPEG2ENC} -f 8" @@ -490,7 +490,7 @@ VOL_SIZE="4700" -elif test "${VCD_TYPE}" == "dvd"; then +elif test "${VCD_TYPE}" = "dvd"; then FF_ENC="${FF_ENC} -target dvd -f rawvideo -dc 10" MPEG2ENC="${MPEG2ENC} -f 8 -D 10" @@ -513,7 +513,7 @@ VOL_SIZE="4700" -elif test "${VCD_TYPE}" == "dvd_wide"; then +elif test "${VCD_TYPE}" = "dvd_wide"; then FF_ENC="${FF_ENC} -target dvd -f rawvideo -dc 10" MPEG2ENC="${MPEG2ENC} -f 8 -D 10" @@ -536,7 +536,7 @@ VOL_SIZE="4700" -elif test "${VCD_TYPE}" == "mvcd"; then +elif test "${VCD_TYPE}" = "mvcd"; then FF_ENC="${FF_ENC} -vcodec mpeg1video -f rawvideo -bufsize 40 -me_range 64" MPEG2ENC="${MPEG2ENC} -f 2 -g 12 -G 24 -B 256 -S 797" @@ -562,7 +562,7 @@ # 360000 sectors * 2324 bytes per sector / 1000 / 1000 VOL_SIZE="836" -elif test "${VCD_TYPE}" == "svcd"; then +elif test "${VCD_TYPE}" = "svcd"; then FF_ENC="${FF_ENC} -target svcd -f rawvideo" MPEG2ENC="${MPEG2ENC} -f 4 -B 256 -S 797" @@ -585,7 +585,7 @@ VOL_SIZE="836" -elif test "${VCD_TYPE}" == "vcd"; then +elif test "${VCD_TYPE}" = "vcd"; then ENC_TYPE="cbr" @@ -618,7 +618,7 @@ fi # audio pass-through -if test "${ACOPY_MODE}" == "1"; then +if test "${ACOPY_MODE}" = "1"; then AUD_BITRATE_OUT="${AUD_BITRATE_SRC}" AUD_FMT_OUT="${AUD_FMT_SRC}" @@ -632,12 +632,12 @@ MPEG_OUT="${PREFIX_OUT}-%d.mpg" # output interlacing -if test "${VID_ILACE_OUT}" == "b"; then +if test "${VID_ILACE_OUT}" = "b"; then FF_ENC="${FF_ENC} -ildct -ilme -top 0" MPEG2ENC="${MPEG2ENC} -I 1 -z b" -elif test "${VID_ILACE_OUT}" == "t"; then +elif test "${VID_ILACE_OUT}" = "t"; then FF_ENC="${FF_ENC} -ildct -ilme -top 1" MPEG2ENC="${MPEG2ENC} -I 1 -z t" @@ -649,15 +649,15 @@ fi # output framerate -if test "${VID_FPS_SRC}" == "30000:1001" || test "${VID_FPS_SRC}" == "24000:1001" || test "${VID_FPS_SRC}" == "25:1"; then +if test "${VID_FPS_SRC}" = "30000:1001" || test "${VID_FPS_SRC}" = "24000:1001" || test "${VID_FPS_SRC}" = "25:1"; then VID_FPS_OUT="${VID_FPS_SRC}" -elif test "${OUT_NORM}" == "ntsc"; then +elif test "${OUT_NORM}" = "ntsc"; then VID_FPS_OUT="30000:1001" -elif test "${OUT_NORM}" == "ntsc_film"; then +elif test "${OUT_NORM}" = "ntsc_film"; then VID_FPS_OUT="24000:1001" @@ -668,7 +668,7 @@ fi # output sar and framesize for pal/ntsc -if test "${VID_FPS_OUT}" == "25:1"; then +if test "${VID_FPS_OUT}" = "25:1"; then VID_SAR_OUT="${VID_SAR_625_OUT}" VID_SIZE_OUT="${VID_SIZE_625_OUT}" @@ -681,7 +681,7 @@ fi # cvd_wide "preset" for y4mscaler -if test "${VCD_TYPE}" == "cvd_wide"; then +if test "${VCD_TYPE}" = "cvd_wide"; then Y4MSCALER="${Y4MSCALER} -O sar=${VID_SAR_OUT} -O size=${VID_SIZE_OUT}" @@ -695,12 +695,12 @@ fi # video decoder -if test "${DEC_TOOL}" == "mpeg2dec"; then +if test "${DEC_TOOL}" = "mpeg2dec"; then test_bin ${MPEG2DEC} DECODER="${MPEG2DEC} -s -o pgmpipe \"${VIDEO_SRC}\" | ${PGMTOY4M} |" -elif test "${DEC_TOOL}" == "ffmpeg"; then +elif test "${DEC_TOOL}" = "ffmpeg"; then test_bin ${FFMPEG} DECODER="${FF_DEC} -y /dev/stdout | ${PGMTOY4M} |" @@ -714,7 +714,7 @@ fi # video framerate correction -if test "${VID_FPS_SRC}" == "${VID_FPS_OUT}"; then +if test "${VID_FPS_SRC}" = "${VID_FPS_OUT}"; then FRC="" @@ -726,14 +726,14 @@ fi # video "deinterlacer" -if test "${VID_ILACE_SRC}" != "p" && test "${VID_ILACE_OUT}" == "p"; then +if test "${VID_ILACE_SRC}" != "p" && test "${VID_ILACE_OUT}" = "p"; then Y4MSCALER="${Y4MSCALER} -I ilace=top_only" fi # video scaler -if test "${VID_SAR_SRC}" == "${VID_SAR_OUT}" && test "${VID_SIZE_SRC}" == "${VID_SIZE_OUT}"; then +if test "${VID_SAR_SRC}" = "${VID_SAR_OUT}" && test "${VID_SIZE_SRC}" = "${VID_SIZE_OUT}"; then SCALER="" @@ -750,7 +750,7 @@ FILTER_TYPE="`echo ${FILTER} | awk -F: '{print $1}'`" FILTER_LEVEL="`echo ${FILTER} | awk -F: '{print $2}'`" - if test "${FILTER_LEVEL}" == ""; then + if test "${FILTER_LEVEL}" = ""; then FILTER_LEVEL="light" @@ -760,7 +760,7 @@ Y4MDENOISE_FLAGS="-v 0" # filter level - if test "${FILTER_LEVEL}" == "light"; then + if test "${FILTER_LEVEL}" = "light"; then YUVMEDIANFILTER_FLAGS="-t 0" YUVDENOISE_FLAGS="-l 1 -t 4 -S 0" @@ -771,7 +771,7 @@ Y4MDENOISE_FLAGS="${Y4MDENOISE_FLAGS} -t 1" Y4MUNSHARP_FLAGS="-L 1.5,0.2,0" - elif test "${FILTER_LEVEL}" == "medium"; then + elif test "${FILTER_LEVEL}" = "medium"; then YUVMEDIANFILTER_FLAGS="-T 0" YUVDENOISE_FLAGS="-l 2 -t 6 -S 0" @@ -782,7 +782,7 @@ Y4MDENOISE_FLAGS="${Y4MDENOISE_FLAGS} -t 2" Y4MUNSHARP_FLAGS="-L 2.0,0.3,0" - elif test "${FILTER_LEVEL}" == "heavy"; then + elif test "${FILTER_LEVEL}" = "heavy"; then YUVMEDIANFILTER_FLAGS="" YUVDENOISE_FLAGS="-l 3 -t 8 -S 0" @@ -801,46 +801,46 @@ fi # filter type - if test "${FILTER_TYPE}" == "none"; then + if test "${FILTER_TYPE}" = "none"; then FILTER="" - elif test "${FILTER_TYPE}" == "hqdenoise"; then + elif test "${FILTER_TYPE}" = "hqdenoise"; then test_bin ${Y4MDENOISE} FILTER="${Y4MDENOISE} ${Y4MDENOISE_FLAGS} |" - elif test "${FILTER_TYPE}" == "mean"; then + elif test "${FILTER_TYPE}" = "mean"; then test_bin ${YUVMEDIANFILTER} FILTER="${YUVMEDIANFILTER} ${MEANFILTER_FLAGS} |" - elif test "${FILTER_TYPE}" == "median"; then + elif test "${FILTER_TYPE}" = "median"; then test_bin ${YUVMEDIANFILTER} FILTER="${YUVMEDIANFILTER} ${YUVMEDIANFILTER_FLAGS} |" - elif test "${FILTER_TYPE}" == "spatial"; then + elif test "${FILTER_TYPE}" = "spatial"; then test_bin ${Y4MSPATIALFILTER} FILTER="${Y4MSPATIALFILTER} ${Y4MSPATIALFILTER_FLAGS} |" - elif test "${FILTER_TYPE}" == "temporal_old"; then + elif test "${FILTER_TYPE}" = "temporal_old"; then test_bin ${YUVDENOISE} FILTER="${YUVDENOISE} ${YUVDENOISE_FLAGS} |" - elif test "${FILTER_TYPE}" == "temporal_rc1"; then + elif test "${FILTER_TYPE}" = "temporal_rc1"; then test_bin ${YUVDENOISE} FILTER="${YUVDENOISE} ${YUVDENOISE2_FLAGS} |" - elif test "${FILTER_TYPE}" == "temporal"; then + elif test "${FILTER_TYPE}" = "temporal"; then test_bin ${YUVDENOISE} FILTER="${YUVDENOISE} ${YUVDENOISE3_FLAGS} |" - elif test "${FILTER_TYPE}" == "unsharp"; then + elif test "${FILTER_TYPE}" = "unsharp"; then test_bin ${Y4MUNSHARP} FILTER="${Y4MUNSHARP} ${Y4MUNSHARP_FLAGS} |" @@ -857,7 +857,7 @@ done # 3:2 pulldown -if test "${VID_FPS_OUT}" == "24000:1001" && test "${VID_FMT_OUT}" == "m2v"; then +if test "${VID_FPS_OUT}" = "24000:1001" && test "${VID_FMT_OUT}" = "m2v"; then FF_ENC="${FF_ENC}" MPEG2ENC="${MPEG2ENC} -p" @@ -865,12 +865,12 @@ fi # quantisation matrices -if test "${MATRICES}" == "kvcd"; then +if test "${MATRICES}" = "kvcd"; then FF_ENC="${FF_ENC} -intra_matrix ${INTRA_KVCD} -inter_matrix ${INTER_KVCD}" MPEG2ENC="${MPEG2ENC} -K kvcd" -elif test "${MATRICES}" == "mvcd"; then +elif test "${MATRICES}" = "mvcd"; then echo "`matrix_copy ${INTRA_MVCD}`" > ${CQMFILE} echo "`matrix_copy ${INTER_MVCD}`" >> ${CQMFILE} @@ -878,7 +878,7 @@ FF_ENC="${FF_ENC} -intra_matrix ${INTRA_MVCD} -inter_matrix ${INTER_MVCD}" MPEG2ENC="${MPEG2ENC} -K file=${CQMFILE}" -elif test "${MATRICES}" == "tmpgenc"; then +elif test "${MATRICES}" = "tmpgenc"; then FF_ENC="${FF_ENC} -intra_matrix ${INTRA_TMPGENC} -inter_matrix ${INTER_TMPGENC}" MPEG2ENC="${MPEG2ENC} -K tmpgenc" @@ -886,13 +886,13 @@ fi # video encoding mode -if test "${ENC_TYPE}" == "cbr"; then +if test "${ENC_TYPE}" = "cbr"; then # when using -q with mpeg2enc, variable bitrate is selected. # it's not ok for vcds... MPEG2ENC="${MPEG2ENC}" -elif test "${ENC_TYPE}" == "abr"; then +elif test "${ENC_TYPE}" = "abr"; then if test "${DURATION}" != ""; then @@ -948,13 +948,13 @@ fi # video encoder -if test "${ENC_TOOL}" == "ffmpeg"; then +if test "${ENC_TOOL}" = "ffmpeg"; then test_bin ${FFMPEG} ANALYSER="${FF_STATS} -y \"${VIDEO_OUT}\"" ENCODER="${FF_ENC} -y \"${VIDEO_OUT}\"" -elif test "${ENC_TOOL}" == "mpeg2enc"; then +elif test "${ENC_TOOL}" = "mpeg2enc"; then test_bin ${MPEG2ENC} ANALYSER="${MPEG2ENC_STATS} -o \"${VIDEO_OUT}\"" @@ -969,7 +969,7 @@ fi # audio resampler -if test "${AUD_FREQ_SRC}" == "${AUD_FREQ_OUT}"; then +if test "${AUD_FREQ_SRC}" = "${AUD_FREQ_OUT}"; then AUDIO_RESAMPLER="" @@ -981,12 +981,12 @@ fi # audio decoder/encoder -if test "${ACOPY_MODE}" == "1"; then +if test "${ACOPY_MODE}" = "1"; then AUDIO_DECODER="${FFMPEG} ${FF_DEC_AFLAGS}" AUDIO_ENCODER="-acodec copy -y \"${AUDIO_OUT}\"" -elif test "${AUD_FREQ_SRC}" == "${AUD_FREQ_OUT}"; then +elif test "${AUD_FREQ_SRC}" = "${AUD_FREQ_OUT}"; then AUDIO_DECODER="${FFMPEG} ${FF_DEC_AFLAGS}" AUDIO_ENCODER="-ab ${AUD_BITRATE_OUT} -ac ${AUD_CHANNELS_OUT} -y \"${AUDIO_OUT}\"" @@ -1011,11 +1011,11 @@ show_info " pixel aspect ratio: ${VID_SAR_OUT}" # video "analyse" -if ! test "${BLIND_MODE}" == "1" && test "${ENC_TYPE}" == "abr"; then +if ! test "${BLIND_MODE}" = "1" && test "${ENC_TYPE}" = "abr"; then eval "${DECODER} ${FILTERS} ${FRC} ${SCALER} ${PIPE_BUFFER} ${ANALYSER}" - if test "${ENC_TOOL}" == "mpeg2enc"; then + if test "${ENC_TOOL}" = "mpeg2enc"; then QUANT="`mpeg2enc_statfile_analyse ${STATFILE}`" QUANT="`range_check $QUANT 3 31`" @@ -1026,23 +1026,23 @@ fi # video (de)coding -if ! test "${BLIND_MODE}" == "1"; then +if ! test "${BLIND_MODE}" = "1"; then eval "${DECODER} ${FILTERS} ${FRC} ${SCALER} ${PIPE_BUFFER} ${ENCODER}" fi # audio (de)coding -if ! test "${MUTE_MODE}" == "1"; then +if ! test "${MUTE_MODE}" = "1"; then eval "${AUDIO_DECODER} ${AUDIO_RESAMPLER} ${AUDIO_ENCODER}" fi # multiplexing -if ! test "${BLIND_MODE}" == "1" && ! test "${MUTE_MODE}" == "1"; then +if ! test "${BLIND_MODE}" = "1" && ! test "${MUTE_MODE}" = "1"; then - if test "${REQUANT_MODE}" == "1"; then + if test "${REQUANT_MODE}" = "1"; then VID_SRC_SIZE="`ls -l ${VIDEO_OUT} | awk '{print $5}'`" AUD_SRC_SIZE="`ls -l ${AUDIO_OUT} | awk '{print $5}'`"