[FFmpeg-devel] [RFC PATCH v4 2/5] libavcodec/j2kenc: Fix tag tree coding

Michael Niedermayer michael at niedermayer.cc
Tue Aug 25 10:48:33 EEST 2020


On Tue, Aug 25, 2020 at 09:50:04AM +0530, gautamramk at gmail.com wrote:
> From: Gautam Ramakrishnan <gautamramk at gmail.com>
> 
> The implementation of tag tree encoding was incorrect.
> However, this error was not visible as the current j2k
> encoder encodes only 1 layer.
> This patch fixes tag tree coding for JPEG2000 such tag
> tree coding would work for multi layer encoding.
> ---
>  libavcodec/j2kenc.c   | 41 +++++++++++++++++++++++++----------------
>  libavcodec/jpeg2000.c |  1 +
>  libavcodec/jpeg2000.h |  1 +
>  3 files changed, 27 insertions(+), 16 deletions(-)

iam not sure the tag tree is working correctly before or after this

For example if i make this chnage:

--- a/libavcodec/j2kenc.c
+++ b/libavcodec/j2kenc.c
@@ -282,6 +282,7 @@ static void tag_tree_update(Jpeg2000TgtNode *node)
     while (node->parent){
         if (node->parent->val <= node->val)
             break;
+        abort();
         node->parent->val = node->val;
         node = node->parent;
         lev++;

all tests still pass, so iam not sure what sets the parent values or if
they are not if the code working with them is fully tested

thx

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Observe your enemies, for they first find out your faults. -- Antisthenes
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20200825/fe3e55d7/attachment.sig>


More information about the ffmpeg-devel mailing list