After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 754024 - codecparsers: Various HEVC codecparser fixes
codecparsers: Various HEVC codecparser fixes
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.5.91
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2015-08-24 12:50 UTC by sreerenj
Modified: 2015-08-28 18:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom (1.37 KB, patch)
2015-08-24 12:53 UTC, sreerenj
committed Details | Review
codecparsers: h265: Fix tile row and column parsing (5.81 KB, patch)
2015-08-24 12:53 UTC, sreerenj
committed Details | Review
codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion (6.08 KB, patch)
2015-08-24 12:53 UTC, sreerenj
committed Details | Review
codecparsers: h265: Fix tile row and column parsing (5.86 KB, patch)
2015-08-26 08:33 UTC, sreerenj
rejected Details | Review
codecparsers: h265: Avoid floating point arithmetic (1.26 KB, patch)
2015-08-26 09:58 UTC, sreerenj
accepted-commit_after_freeze Details | Review

Description sreerenj 2015-08-24 12:50:58 UTC
Couple of hevc parsing fixes:
-- codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
-- codecparsers: h265: Fix tile row and column parsing
-- codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion
Comment 1 sreerenj 2015-08-24 12:53:18 UTC
Created attachment 309914 [details] [review]
codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
Comment 2 sreerenj 2015-08-24 12:53:38 UTC
Created attachment 309915 [details] [review]
codecparsers: h265: Fix tile row and column parsing
Comment 3 sreerenj 2015-08-24 12:53:59 UTC
Created attachment 309917 [details] [review]
codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion
Comment 4 sreerenj 2015-08-24 13:01:17 UTC
Patch1: Follow the spec as exactly for checking the range

patch2: This is a necessary patch, with out this the tile_row and tile_column values calculated are wrong. I have done this fix in gstremaer-vaapi months ago  , but forgot to move this to codecparsers.

patch3: This is required for projects gstreamer-vaapi and libyami. But nothing touching the existing parsing code. Only adding few more APIs to do up-right-diagonal to raster scan convertion and vice versa.
Comment 5 Sebastian Dröge (slomo) 2015-08-24 18:27:19 UTC
Review of attachment 309915 [details] [review]:

Seems ok to me (without having the spec) but

::: gst-libs/gst/codecparsers/gsth265parser.c
@@ +1805,3 @@
+      ceil ((gdouble) sps->pic_height_in_luma_samples / (gdouble) CtbSizeY);
+  pps->PicWidthInCtbsY =
+      ceil ((gdouble) sps->pic_width_in_luma_samples / (gdouble) CtbSizeY);

Can we have integer arithmetic here? :)
Comment 6 Sebastian Dröge (slomo) 2015-08-24 18:29:19 UTC
commit 9f5d96271964d1ccab9272b4efa91f98ba099f29
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Mon Aug 24 21:28:46 2015 +0300

    win32: Add new h265 parser symbols

commit 497f3726687bac932eaf7313b9f0d31800ff473b
Author: lyb <andy_liu_china@163.com>
Date:   Mon Aug 24 08:06:15 2015 +0300

    codecparsers: h265: Add APIs for up-right-diagonal/raster scan conversion
    
    As per  7-42 and 7-43 the ScalingFactor's scanIdx is 0,
    which is "up-right-diagonal" scan. Add APIs for converting
    up-right-diagonal to raster and vise versa.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754024

commit 26e350f0bf865594315f7af194d2a5a980e00f41
Author: XuGuangxin <Guangxin.Xu@intel.com>
Date:   Mon Aug 24 04:18:52 2015 +0300

    codecparsers: h265: Fix the range of delta_chroma_log2_weight_denom
    
    Being more strict on specification, According to 7.4.7.3,
    delta_chroma_log2_weight_denom should be in the range of
    [(0 - luma_log2_weight_denom), (7 - luma_log2_weight_denom)]
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754024
Comment 7 sreerenj 2015-08-25 20:21:17 UTC
(In reply to Sebastian Dröge (slomo) from comment #5)
> Review of attachment 309915 [details] [review] [review]:
> 
> Seems ok to me (without having the spec) but
> 
> ::: gst-libs/gst/codecparsers/gsth265parser.c
> @@ +1805,3 @@
> +      ceil ((gdouble) sps->pic_height_in_luma_samples / (gdouble) CtbSizeY);
> +  pps->PicWidthInCtbsY =
> +      ceil ((gdouble) sps->pic_width_in_luma_samples / (gdouble) CtbSizeY);
> 
> Can we have integer arithmetic here? :)


As per spec "% Used to denote division in mathematical equations where no truncation or rounding is intended."
and PicWidthInCtbsY= Ceil (sps->pic_width_in_luma_samples % CtbSizeY)

Do you want to get a custom ceil function to get this job done with integer arithmetic??
Comment 8 sreerenj 2015-08-26 08:28:15 UTC
Aha may be I can use the gst_util_uint64_scale_ceil (),,,!
Comment 9 sreerenj 2015-08-26 08:33:57 UTC
Created attachment 310006 [details] [review]
codecparsers: h265: Fix tile row and column parsing
Comment 10 sreerenj 2015-08-26 08:36:51 UTC
I have noticed that you removed the Signed-off message!, I wonder why?
I don't have commit access, at least I should get the signed-off signature since I am spending significant time on making these patches upstream compatible (on-line and offline),proper commit message etc etc... :)
Comment 11 Sebastian Dröge (slomo) 2015-08-26 08:45:36 UTC
(In reply to sreerenj from comment #10)
> I have noticed that you removed the Signed-off message!, I wonder why?
> I don't have commit access, at least I should get the signed-off signature
> since I am spending significant time on making these patches upstream
> compatible (on-line and offline),proper commit message etc etc... :)

We generally don't do this signed-off stuff, that's why I removed it. I didn't notice that the patches were actually not from you, but you forwarded them for someone else. I guess for such a case it makes sense to keep it, sorry for removing :)
Comment 12 Sebastian Dröge (slomo) 2015-08-26 09:23:35 UTC
Or just do
>  (sps->pic_height_in_luma_samples + CtbSizeY - 1) / CtbSizeY


I'll merge that patch for now as is, as it just moves the code around anyway. But please provide a patch for later that gets rid of the floating point arithmetic :)
Comment 13 Sebastian Dröge (slomo) 2015-08-26 09:25:37 UTC
Comment on attachment 310006 [details] [review]
codecparsers: h265: Fix tile row and column parsing

For later, no need to go via 64 bit (actually 96 bit) integers here :)
Comment 14 Sebastian Dröge (slomo) 2015-08-26 09:26:05 UTC
commit 54c2620bdb256022cdd11dd6639ca91cb982ffe2
Author: XuGuangxin <Guangxin.Xu@intel.com>
Date:   Mon Aug 24 07:46:27 2015 +0300

    codecparsers: h265: Fix tile row and column parsing
    
    Section 6.5.1:  Coding tree block raster and tile scanning conversion process
    Follow the equations 6-3 and 6-4
    
    This will provide correct offset_max in slice_header for parsing
    num_entry_point_offsets.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=754024
    
    Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Comment 15 sreerenj 2015-08-26 09:58:48 UTC
Created attachment 310010 [details] [review]
codecparsers: h265: Avoid floating point arithmetic
Comment 16 sreerenj 2015-08-26 09:59:31 UTC
(In reply to Sebastian Dröge (slomo) from comment #12)
> Or just do
> >  (sps->pic_height_in_luma_samples + CtbSizeY - 1) / CtbSizeY

right,, :), thanks..
> 
> I'll merge that patch for now as is, as it just moves the code around
> anyway. But please provide a patch for later that gets rid of the floating
> point arithmetic :)

patch attached...