VideoHelp Forum




+ Reply to Thread
Results 1 to 5 of 5
  1. This is about ConvertToYV24.

    Thought of using it since it allows cropping odd numbers of pixels...

    And if the source is in YUV420p, then using ConvertToYV24 and recreating a YUV420p using x264 would be lossy?
    What is the main difference compared to normal way without conversion?

    I did 2 samples and found that the converted output gave slightly bigger output!

    Here my tests...
    Source: 1280x720. Same x264 settings within test.
    Test A, Anime with animation tune. Test B, live with film tune.

    Code:
    Result A1: ............... crop(0, 2, 0, -2). (output: 1280x716). 1001 KiB 
    Result A2: ConvertToYV24() crop(0, 2, 0, -2). (output: 1280x716). 991 KiB 
    Result A3: ConvertToYV24() crop(0, 1, 0, -1). (output: 1280x718). 977 KiB 
     
    Result B1: ............... crop(0, 2, 0, -2). (output: 1280x716). 1.03 MiB 
    Result B2: ConvertToYV24() crop(0, 2, 0, -2). (output: 1280x716). 1.02 MiB  
    Result B3: ConvertToYV24() crop(0, 1, 0, -1). (output: 1280x718). 1.05 MiB
    1. What are the reasons for converted one giving smaller filesize?
    Is it due to efficiency or loss of details?!

    2. Why in test A, 718 height video is bigger than 716 height one?...

    Quote Quote  
  2. 1) Yes it's lossy because you're upscaling and downscaling the chroma, so the chroma edges in the U, V planes will become less accurate , more blurred. The default resizer is "bicubic" , but you can change the chromaresampling options with avisynth 2.6.x . Think of when you upscale and downscale a picture, it becomes more blurry. Same thing happening with the color information here

    2) In general, sharper, more detail, takes more bitrate. Lower detail, blurrier, takes less bitrate. E.g. if you use "regular" sharpener and repeat the same test, filesize will increase.

    So the results are expected, except A3, B3 . Not sure, but it might have to do with mod4. In general, higher effeciency with mod16>8>4> because MB's can be aligned , but difference might have to do with source content (live probably has more noise, grain compare to animation) , or might just be rounding differences. Try repeating the tests, also on different samples, and with --threads 1
    Last edited by poisondeathray; 6th Nov 2014 at 09:48.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    What is your necessity for cropping odd number of pixels?

    Scott
    Quote Quote  
  4. I thought it was just a thought experiment, and the effects on 4:2:0 encoding with x264

    However, if you have a real reason for this, you can crop odd dimensions and stay in 4:2:0 YV12, without incurring the loss of detail in the width dimension by colorspace conversion (up and downscaling chroma to 4:4:4 ) by using internal crop in the resizer


    (For this comparison I use bicubic, because ConvertToXX uses bicubic by default)
    e.g

    a) "original"
    colorbars(1280,720,"yv12")

    b) crop method, using yv24. Since it resizes chroma planes width and height, you lose quality in both dimensions

    colorbars(1280,720,"yv12")
    converttoyv24
    crop(0,1,0,-1,true)
    converttoyv12

    c) internal resizer crop, notice width quality is preserved

    colorbars(1280,720,"yv12")
    bicubicresize(1280,718,src_top=1, src_height=-1)



    These are just the avisynth manipulation part, you can carry on test the effects on the encoder
    Image Attached Thumbnails Click image for larger version

Name:	a.png
Views:	162
Size:	5.5 KB
ID:	28404  

    Click image for larger version

Name:	b.png
Views:	158
Size:	6.1 KB
ID:	28405  

    Click image for larger version

Name:	c.png
Views:	162
Size:	6.0 KB
ID:	28408  

    Quote Quote  
  5. Originally Posted by Cornucopia View Post
    What is your necessity for cropping odd number of pixels?
    Scott
    To save the 2 lines that would be lost using 2

    poisondeathray, Thank you very much for the detailed answers!..
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!