Log in

View Full Version : Crop then resize or just resize for 720p?


kikker
20th April 2009, 20:34
When encoding from a BD rip with a front end GUI, is there any theoretical difference between having the encoder GUI auto-crop using the autocrop filter, then resizing and adding borders to arrive at 1280x720 resolution suitable for BD spec, OR simply resizing the 1080p source down to 1280x720?

poisondeathray
20th April 2009, 20:56
I don't think it will be a big difference, but autocrop might not get it right (ie. might be off by a few pixels, or worse, crop active pixels), as it has to crop in multiples of 2

The aspect ratio will be identical to the source if you just resize directly (leaving borders intact)

Sagekilla
20th April 2009, 21:11
Ideally, I would do crop + resize in one step. For example, with 2.4:1 material I'd do: Splin36Resize(1280, 544, 0, 140, 0, -140).

Also, if you have stuff like it needs to crop vertically by 33 pixels (non mod-2), then it can still crop and resize if you do it within the resizer.

rack04
20th April 2009, 22:07
Ideally, I would do crop + resize in one step. For example, with 2.4:1 material I'd do: Splin36Resize(1280, 544, 0, 140, 0, -140).

Also, if you have stuff like it needs to crop vertically by 33 pixels (non mod-2), then it can still crop and resize if you do it within the resizer.

Wouldn't that give you 1280x824?

kikker
20th April 2009, 22:23
Ideally, I would do crop + resize in one step. For example, with 2.4:1 material I'd do: Splin36Resize(1280, 544, 0, 140, 0, -140).

Also, if you have stuff like it needs to crop vertically by 33 pixels (non mod-2), then it can still crop and resize if you do it within the resizer.

OK, thanks. Out of curiosity, I'm just wondering why it would better or worse to take BD rip at 1920x1080, autocrop, and then resize along while adding borders versus just downsizing straightaway to 1280x720? I think the encoder sees the same stream, does it not? Either method does not adhere to the mod16 rule, so I think the encoder just adds 8 pixels to the vertical in either case, correct? So, it's not a matter of a compressibility between the two I think...

poisondeathray
20th April 2009, 22:35
OK, thanks. Out of curiosity, I'm just wondering why it would better or worse to take BD rip at 1920x1080, autocrop, and then resize along while adding borders versus just downsizing straightaway to 1280x720? I think the encoder sees the same stream, does it not? Either method does not adhere to the mod16 rule, so I think the encoder just adds 8 pixels to the vertical in either case, correct? So, it's not a matter of a compressibility between the two I think...


If your goal is 1280x720 (with borders), then just do a straight resize. Not only is it faster (1 step), it is more accurate because autocrop is not perfect: it can make mistakes.

The encoder does not necessarily see the same stream using (autocrop, resize, addborders) because the crop values are multiples of 2 (slight aspect ratio may be off). As I said earlier, the straight resize will give you identical aspect ratio to the source

ajp_anton
21st April 2009, 01:17
Are the black borders in a BD always 100% black?

Forteen88
24th April 2009, 01:24
Are the black borders in a BD always 100% black?Mission Impossible III Blu-ray had some 'dirty' pixels at the bottom of the frame, so I suppose other Blu-ray's have also, which makes the autocrop-feature not that reliable if it don't crop that.

ajp_anton
24th April 2009, 12:38
Mission Impossible III Blu-ray had some 'dirty' pixels at the bottom of the frame, so I suppose other Blu-ray's have also, which makes the autocrop-feature not that reliable if it don't crop that.Wasn't thinking of autocrop (why not just do it manually?), but rather compressing the final image, which will be done better with perfectly black bars, which is achieved by cropping and re-adding them.

benwaggoner
24th April 2009, 17:13
Are the black borders in a BD always 100% black?
Well, Y'=16, so video black.

It's also preferable to have them on mod16 or at least mod8 to not stick that high frequency transition in the middle of a macroblock. So it might be worth doing a slightly anamorphic scale to get that alignment.

At least 720 is mod16. 1080 is a pain since you need to have the top and bottom letterboxing 8 pixels different in height due to the half macroblock at the bottom.

Thus, 1080p > 720p can also benefit from a vertical position change to get macroblock alignment as well.

I've been a firm advocate that next generation delivery mechanisms allow any mod16 height, so we can stop encoding and decoding black rectangles. After all, even a weak compositing engine can draw a black rectangle adequately :).

I'm amazed how many traditional video people are still stuck on fixed aspect ratio frame sizes. Matting is the new interlaced!

kikker
24th April 2009, 20:10
Thus, 1080p > 720p can also benefit from a vertical position change to get macroblock alignment as well.


Interesting. How would such an avs script look for such an encode? Thanks...

benwaggoner
24th April 2009, 22:33
Interesting. How would such an avs script look for such an encode? Thanks...
Might be simplest to just crop to active image area, tweak to mod16, and then composite back with macroblock alignment into the 1280x720.

I've largely transcended physical media, so I'm normally done once I've got my cropped mod16 image.

Blue_MiSfit
25th April 2009, 00:14
^

That's what I always do :)

I achieve mod16 by overcropping usually, since there's often a fair amount of crud on the edges :)

Sagekilla
25th April 2009, 01:52
Also, with so much resolution I don't think you're going to miss 8 lines ;) Also note, though it's rare for a blu-ray to actually have some uneven bordering, you can do odd-pixel crops with a resizer, so you can still minimize overcropping if that case does happen:


# Below is valid for 2.4:1 content

# Example of it you had some weird uneven bordering:
# Spline36Resize(1280, 528, 0, 137, 0, -143)

Spline36Resize(1280,528, 0, 140, 0, -140)
AddBorders(0, 96, 0, 96) # Exactly 6 macroblocks of bordering on top and bottom: so no active image creeps in to eat up bits.

Snowknight26
25th April 2009, 04:23
Also note, though it's rare for a blu-ray to actually have some uneven bordering

I wouldn't call it rare. It's unfortunately quite common.

you can do odd-pixel crops with a resizer, so you can still minimize overcropping if that case does happen

Wouldn't that shift the chroma plane (or was it luma) incorrectly?

Sagekilla
25th April 2009, 04:26
Nope. Only case I can think of where this shows up is in interlacing. But then, you probably deserve chroma alignment (And the field blending) for deciding to do any vertical resizing / cropping on interlaced content. I've done this method plenty of times and never had any alignment issues ever. Also, sounds like I get pretty lucky: Out of my blu-ray collection I've only had 2 titles that required uneven cropping IIRC.

kikker
28th April 2009, 14:15
Pretty basic follow up question then: If the 8x8 macroblocking options are enabled for the encoder, only mod8 needs to be satisfied as opposed to the full mod16, correct?

benwaggoner
28th April 2009, 18:19
Pretty basic follow up question then: If the 8x8 macroblocking options are enabled for the encoder, only mod8 needs to be satisfied as opposed to the full mod16, correct?
Do you mean, if only 4x4 blocks are used, an 8x8 macroblock would include full 4x4 chroma blocks and so only mod 8 would need to be used?

Sounds intuitively reasonable, but aren't there motion vector stuff that still uses 16x16 macroblocks anyway? Still, that should eliminate that very high frequency edge mid-block at least.