Crop のバックアップ差分(No.3)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
 Crop(clip clip, int left, int top, int width, int height, bool align)

 Crop(clip clip, int left, int top, int -right, int -bottom, bool align)

 CropBottom(clip clip, int count, bool align)

Cropは、各フレームの余分なピクセルを切り落とします(crop)。もし、あなたのソースビデオが解像度720x480であり、なおかつ、VideoCD用に352x240に縮小したいなら、ここに、そのための正確な方法があります:

 # 正しいアスペクト比を保持したまま、CCIR601をVCDに変換する:
 ReduceBy2
 Crop(4, 0, 352, 240)

In AviSynth v2.01 and later, the alternative syntax using negative (or zero) values is possible. In this case, the last two parameters are also treated as offsets, VirtualDub-style. For example:
AviSynth v2.01以降では、負の値(または0)を使った代替シンタックスが可能です。この場合、最後の2つのパラメータは、VirtualDubスタイルのオフセットとして取り扱われます。たとえば:

 # Crops 16 pixels all the way around the picture, regardless of image size:
 # 画像サイズを考慮せずに、すべての縁を16ピクセルをCropする:
 Crop(16, 16, -16, -16)

In v2.53 an option align (false by default) is added:
v2.53で、alignオプション(デフォルトはfalse)が追加されました:

Cropping an YUY2/RGB32 image is always mod4 (four bytes). However, when reading x bytes (an int), it is faster when the read is aligned to a modx placement in memory. MMX/SSE likes 8-byte alignment and SSE2 likes 16-byte alignment. If the data is NOT aligned, each read/write operation will be delayed at least 4 cycles. So images are always aligned to mod16 when they are created by AviSynth.

If an image has been cropped, they will sometimes be placed unaligned in memory - "align = true" will copy the entire frame from the unaligned memory placement to an aligned one. So if the penalty of the following filter is larger than the penalty of a complete image copy, using "align=true" will be faster. Especially when it is followed by smoothers.

The alternative CropBottom syntax is useful for cropping garbage off the bottom of a clip captured from VHS tape. It removes count lines from the bottom of each frame.

In order to preserve the data structure of the different colorspaces, the following mods should be used. You will not get an error message if they are not obeyed, but it may create strange artifacts. For a complete discussion on this, see DataStorageInAviSynth

In RGB:
RGB:

width no restriction
width 制限なし

height no restriction if video is progressive
height ビデオがプログレッシブなら、制限なし

height mod-2 if video is interlaced
height ビデオがプログレッシブなら、2の倍数

In YUY2:
YUY2:

width mod-2
width 2の倍数

height no restriction if video is progressive
height ビデオがプログレッシブなら、制限なし

height mod-2 if video is interlaced
height ビデオがプログレッシブなら、2の倍数

In YV12:
YV12:

width mod-2
width 2の倍数

height mod-2 if video is progressive
height ビデオがプログレッシブなら、2の倍数

height mod-4 if video is interlaced
height ビデオがプログレッシブなら、4の倍数

NOTE: The resize functions optionally allow fractional cropping of the input frame, this results in a weighting being applied to the edge pixels being resized. These options may be used if the mod-n format dimension restriction of crop are inconvienient. See [[Resize Filter>Resize]].

#hr
//註: このページは、http://www.avisynth.org/Cropの日本語訳です。