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. |
8th September 2018, 10:36 | #6341 | Link |
Registered User
Join Date: Feb 2015
Posts: 326
|
The bug is in commit 2.8+48 https://bitbucket.org/multicoreware/...66b1fbeb421b2c
Now it is only one function to allocate analysis_data in multilib x265 8bit+10bit+12bit -- it is from 8bit part and sse_t type is uint32_t in this function. For 10bit and 12bit sse_t type is uint64_t, so this function allocate only half required memory for distortionData if you use multilib x265 for encoding 10bit or 12bit. Patch proposition: Code:
diff -r 88ee12651e30 source/encoder/api.cpp --- a/source/encoder/api.cpp Thu Aug 16 18:27:01 2018 +0530 +++ b/source/encoder/api.cpp Sat Sep 08 06:45:23 2018 +0200 @@ -411,13 +411,18 @@ bool isVbv = param->rc.vbvMaxBitrate > 0 && param->rc.vbvBufferSize > 0; int numDir = 2; //irrespective of P or B slices set direction as 2 uint32_t numPlanes = param->internalCsp == X265_CSP_I400 ? 1 : 3; +#if X265_DEPTH < 10 + int numCUs_sse_t = param->internalBitDepth > 8 ? analysis->numCUsInFrame * 2 : analysis->numCUsInFrame; +#else + int numCUs_sse_t = param->internalBitDepth > 8 ? analysis->numCUsInFrame : (analysis->numCUsInFrame + 1) / 2; +#endif //Allocate memory for distortionData pointer CHECKED_MALLOC_ZERO(distortionData, x265_analysis_distortion_data, 1); - CHECKED_MALLOC_ZERO(distortionData->distortion, sse_t, analysis->numPartitions * analysis->numCUsInFrame); + CHECKED_MALLOC_ZERO(distortionData->distortion, sse_t, analysis->numPartitions * numCUs_sse_t); if (param->rc.bStatRead) { - CHECKED_MALLOC_ZERO(distortionData->ctuDistortion, sse_t, analysis->numCUsInFrame); + CHECKED_MALLOC_ZERO(distortionData->ctuDistortion, sse_t, numCUs_sse_t); CHECKED_MALLOC_ZERO(distortionData->scaledDistortion, double, analysis->numCUsInFrame); CHECKED_MALLOC_ZERO(distortionData->offset, double, analysis->numCUsInFrame); CHECKED_MALLOC_ZERO(distortionData->threshold, double, analysis->numCUsInFrame); |
8th September 2018, 13:56 | #6342 | Link |
Registered User
Join Date: Aug 2009
Posts: 90
|
I'm encoding an 4:2:2 1920x1080p 10bit video with HDR and i'm getting this error/warning:
x265 [error]: Recommended Settings for HDR: colour primaries should be BT.2020, transfer characteristics should be SMPTE ST.2084, matrix coeffs should be BT.2020, the input video should be 10 bit 4:2:0 Disabling offset tuning for HDR videos But the encoding just continues... is it safe to ignore this or should i convert the video to 4:2:0 (i'd rather not but if i really have to...)? |
8th September 2018, 14:39 | #6343 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
4:2:0 is still the chroma sub-sampling standard for all commercially released video. No domestic hardware players supports 4:2:2.
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
8th September 2018, 14:51 | #6344 | Link | |
Registered User
Join Date: Aug 2009
Posts: 90
|
Quote:
My concern is that I'm not sure what "disabling offset tuning for HDR videos" exactly means... Will the resulting encode still be HDR? |
|
8th September 2018, 16:42 | #6345 | Link |
Life's clearer in 4K UHD
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
|
None of my smart TV's can. And my OPPO can't recognise such video streams placed within any supporting container!
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
|
8th September 2018, 17:31 | #6346 | Link |
Registered User
Join Date: Nov 2009
Posts: 59
|
i agree. you won't be happy with a 4:2:2 video file. i encoded one file in 422 by accident. none of my devices could play it. plex also couldn't read it iirc. only pc could handle the file.
IMHO best thing to do would be convert your file to 4:2:0 before encoding. (or maybe it's just a problem with your source filter) you won't see a big difference and x265 won't have any problems with hdr metadata |
10th September 2018, 22:17 | #6349 | Link |
Registered User
Join Date: Feb 2007
Posts: 128
|
Hi guys,
I'm currently trying to convert Star Wars Episode III to x265... and hell... it's a beast. This movie gives me super ugly artifacts in dark scenes. Original: https://i.imgur.com/PA9cWuR.png Encoding: https://i.imgur.com/HpVbyf4.png (with meagre 2,300kb/s in that scene, 4,500kb/s on avg for the whole movie) My settings were: --crf 23 --tune grain --profile main12 --output-depth 12 --rskip --qcomp 0.8 --no-open-gop --no-deblock --no-strong-intra-smoothing I already tried aq-mode 3 but to retain an okayish quality I had to set the aq-strength to 1.5 and ended up with 12 mbit/s for this scene. I then tried aq-strength 3 and ended up with with perfect quality... and wopping 43 mbit /s. Why are dark scenes so much more costly than brighter scenes? This does not feel right... What can I do? |
11th September 2018, 04:08 | #6351 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,277
|
Also:
Boosting the brightness and looking at the source sometimes shows lots of compression artifacts, so some smoothing/denoising of the dark areas might help to understand where the bit rate goes. Dark areas often contain lots of noise and artifacts which the encoder interprets as details that should be preserved. |
11th September 2018, 11:41 | #6354 | Link |
German doom9/Gleitz SuMo
Join Date: Oct 2001
Location: Germany, rural Altmark
Posts: 6,782
|
Intentionally, aq-mode 3 is supposed to help with dark scenes, even without zones; but it needs a matching aq-strength too, and sufficient bitrate, and possibly other circumstances — and still can't work wonders...
Last edited by LigH; 11th September 2018 at 11:49. |
11th September 2018, 18:45 | #6357 | Link | |
Registered User
Join Date: Jun 2016
Posts: 116
|
Quote:
|
|
11th September 2018, 21:15 | #6358 | Link |
Registered User
Join Date: Feb 2007
Posts: 128
|
Hey brumsky et al.!
Yes... psy_rd was set to 4. I kept grain mode but reduced psy_rd to 1 and set crf to 21 now and the artifacts are gone (while the file size got a bit smaller) ... the result is a bit smeared though. Also it kills most of the grain. https://i.imgur.com/eqQJXy7.png Lowering Crf or Psy further won't do any good though... quite the contrary. At least on that example scene. Last edited by katzenjoghurt; 11th September 2018 at 21:33. |
11th September 2018, 21:25 | #6359 | Link | |
Registered User
Join Date: Feb 2007
Posts: 128
|
I didn't know that this is good practice.
Tried it out but didn't find any sweet spot yet though. :-/ Quote:
Last edited by katzenjoghurt; 12th September 2018 at 08:57. |
|
12th September 2018, 19:54 | #6360 | Link | |
Lost my old account :(
Join Date: Jul 2017
Posts: 325
|
Quote:
I would start over with main10, keep --no-strong-intra-smoothing and --no-sao, try a slower preset and a lower CRF value. If that doesnt give you good results start playing with AQ and qcomp |
|
|
|