Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
10th November 2024, 22:52 | #21 | Link |
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,823
|
Thanks.
Why you didn't set the chroma default as top-left? Usually that's the one used for AVC/HEVC encoding. Moreover: is there a way to make it work and output arbitrary bitdepth, such as 10/16/32? Otherwise I need to put z_ConvertFormat(resample_filter="spline64",dither_type="error_diffusion",pixel_type="yuv420p16") before the Resize8 line and, on my slow cpu, it's stealing some cycles instead of having it done internally.
__________________
@turment on Telegram Last edited by tormento; 10th November 2024 at 23:13. |
11th November 2024, 04:16 | #22 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,936
|
The default is left as it's the default for all chroma placement aware resizers, to the best of my knowledge. The native Avisynth functions that support chroma placement, such as ConvertToYUV420(), also default to left. It doesn't really matter though, as if the chroma placement is specified in frame properties it's the placement that's used.
The original version of the function was intended to correct the chroma shift while using Avisynth's resizers as they're (still) not chroma placement aware, but even though the updated version supports any resizer with the same named arguments for cropping as Avisynth's resizers, they don't necessarily have the ability to change the bitdepth, and when they do they have different arguments for specifying it. The only practical way for Resize8 to change the bitdepth would be to use ConvertBits(), but I'm not sure if there's much point when it's easy enough to add ConvertBits to a script. Edit: If you're using a chroma placement aware resizer then it might be simpler to use it instead, especially if it can change the bitdepth. These should give you an identical output if the chroma location is "left". Code:
ConvertBits(16).Resize8(940,540, kernel="z_Spline64Resize") ConvertBits(16).z_Spline64Resize(940,540) z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16") Code:
propSet("_ChromaLocation", 2) # top_left A = ConvertBits(16).Resize8(940,540, kernel="z_Spline64Resize") B = z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16", chromaloc_op="auto=>same") Compare(A,B) Last edited by hello_hello; 12th November 2024 at 18:47. |
11th November 2024, 13:59 | #23 | Link |
Registered User
Join Date: Aug 2024
Posts: 207
|
"top_left" is not the default, default is "left", not only in all chroma placement aware resizers, but also true for virtually all encodings "below" UHD Bluray - they just somehow suddenly decided to change it to top_left
Last edited by Z2697; 11th November 2024 at 14:08. |
11th November 2024, 18:27 | #24 | Link | |
Acid fr0g
Join Date: May 2002
Location: Italy
Posts: 2,823
|
Quote:
I mean, without frame properties.
__________________
@turment on Telegram |
|
11th November 2024, 23:25 | #25 | Link | |
Registered User
Join Date: Mar 2011
Posts: 4,936
|
Quote:
x264 and x265 both have a command line option --chromaloc so it's obviously saved as Video Usability Information, but I don't recall MediaInfo displaying it. That doesn't necessarily mean it doesn't, if it exists, as my memory isn't great. https://x265.readthedocs.io/en/maste...mation-options Last edited by hello_hello; 11th November 2024 at 23:40. |
|
12th November 2024, 07:25 | #26 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,115
|
Mediainfo doesn't explicitly mention it, however when it says 4:2:0 without anything it means left (the good old MPEG-2 standard) and when it says Type 2 it means top_left (the "new" H.265 standard). Other tools like ffprobe or indeed the two Avisynth indexers you mentioned display it explicitly.
|
12th November 2024, 15:34 | #27 | Link | |
Registered User
Join Date: Jul 2018
Posts: 503
|
Quote:
* If the conditions are met. Yes, when ffmpeg also signals (not always) the chroma location. |
|
12th November 2024, 17:40 | #28 | Link |
Registered User
Join Date: Mar 2011
Posts: 4,936
|
Ah..... yes, these seem to produce the same result.
propSet("_ChromaLocation", 2) # top_left A = z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16", use_props=1) B = z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16", chromaloc_op="auto=>same") Compare(A,B) Could I ask why the default for use_props isn't 1 though? Would it be more intuitive if the default for use_props was 1 but it automatically switched to -1 when the colorspace_op or chromaloc_op arguments are used? That way z_ConvertFormat would use any frame properties that exist without the user having to tell it to, but it'd ignore them and do something else when values for colorspace_op or chromaloc_op are specified. Maybe I'm missing something.... Cheers. |
12th November 2024, 19:22 | #29 | Link |
Registered User
Join Date: Jul 2018
Posts: 503
|
B = z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16", chromaloc_op="auto=>same") - is using use_props=1. From doc - "-1: If frame properties are supported - if every value of colorspace_op and every value of chromaloc_op is specified, and it's different than "auto", 0, otherwise 1."
So you're comparing the same processing. Maybe you want - B = z_ConvertFormat(940,540, resample_filter="Spline64", pixel_type="YUV420P16", chromaloc_op="top_left=>top_left"). In this case use_props=0 is used. The default use_props is -1 - meaning its auto selected between 0 and 1 depending on the used command. Compare the speed of A with the new B (with use_props=0). The reason for the default value of -1 - for some filtering one can completely ignore the frame props (changing only bit depth or just resizing RGB/YUV444 video...) and can benefit from the better speed. Maybe I could add the case when a video with chroma subsampling is resized and use_props=-1 used, the frame props to be read. |
Thread Tools | Search this Thread |
Display Modes | |
|
|