Re: [AVTCORE] [Technical Errata Reported] RFC2435 (4095)

worley@ariadne.com (Dale R. Worley) Fri, 30 January 2015 02:28 UTC

Return-Path: <worley@alum.mit.edu>
X-Original-To: avt@ietfa.amsl.com
Delivered-To: avt@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3BA881A88EA for <avt@ietfa.amsl.com>; Thu, 29 Jan 2015 18:28:43 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.235
X-Spam-Level:
X-Spam-Status: No, score=-1.235 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_SOFTFAIL=0.665] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zlB93OddGr_2 for <avt@ietfa.amsl.com>; Thu, 29 Jan 2015 18:28:42 -0800 (PST)
Received: from resqmta-po-11v.sys.comcast.net (resqmta-po-11v.sys.comcast.net [IPv6:2001:558:fe16:19:96:114:154:170]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EC8D21A88E8 for <avt@ietf.org>; Thu, 29 Jan 2015 18:28:41 -0800 (PST)
Received: from resomta-po-10v.sys.comcast.net ([96.114.154.234]) by resqmta-po-11v.sys.comcast.net with comcast id m2TY1p00453iAfU012UhEh; Fri, 30 Jan 2015 02:28:41 +0000
Received: from hobgoblin.ariadne.com ([24.34.72.61]) by resomta-po-10v.sys.comcast.net with comcast id m2Uf1p00Y1KKtkw012Ugsa; Fri, 30 Jan 2015 02:28:41 +0000
Received: from hobgoblin.ariadne.com (hobgoblin.ariadne.com [127.0.0.1]) by hobgoblin.ariadne.com (8.14.7/8.14.7) with ESMTP id t0U2Sdp7022376; Thu, 29 Jan 2015 21:28:39 -0500
Received: (from worley@localhost) by hobgoblin.ariadne.com (8.14.7/8.14.7/Submit) id t0U2Sced022373; Thu, 29 Jan 2015 21:28:38 -0500
X-Authentication-Warning: hobgoblin.ariadne.com: worley set sender to worley@alum.mit.edu using -f
From: worley@ariadne.com
To: Magnus Westerlund <magnus.westerlund@ericsson.com>
In-Reply-To: <54CA2EF3.2000108@ericsson.com> (magnus.westerlund@ericsson.com)
Sender: worley@ariadne.com
Date: Thu, 29 Jan 2015 21:28:38 -0500
Message-ID: <87vbjpgfxl.fsf@hobgoblin.ariadne.com>
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1422584921; bh=w6pReOtWCt42qrL6xBzSc/QiriQnReOIvtc+mfMrz7g=; h=Received:Received:Received:Received:From:To:Subject:Date: Message-ID; b=HcUvNOvPvCR/0Y3aCsKZkKgzf86xSMQ0I1PyiDnKvL9FaB0CuXGtOJKhqn7YO1F6j dvzJ+B1lLlhznqToL6F2pcQ8/eau8VJMDXwZJYiwUZzvC0zipxxGMzaQH5Nsmdroa7 zY5m+n9Ki0BF8vDyPLJHX00bCmRQUjQKBs8akoLxzE5NU54P5nCCbovvTuWwJKPRgf 9TpQq+0L/85qNuod9Y9gSAZ3jgi1XcQoAp+QW8kx+/bml7GBI7dDlMllQQ+XkeXgxc 2UQbs491cn0JAIH1RmYzP6ifo+Zbpc5wzaJBN2UNyqWcb/qGS1MDEJ+3q6ADBi6XIl vxnKJe0aFDOXw==
Archived-At: <http://mailarchive.ietf.org/arch/msg/avt/ZYvvIJ5_aToypvW_DIHIz0dmr1U>
Cc: juliusfriedman@gmail.com, avt@ietf.org
Subject: Re: [AVTCORE] [Technical Errata Reported] RFC2435 (4095)
X-BeenThere: avt@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Audio/Video Transport Core Maintenance <avt.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/avt>, <mailto:avt-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/avt/>
List-Post: <mailto:avt@ietf.org>
List-Help: <mailto:avt-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/avt>, <mailto:avt-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 30 Jan 2015 02:28:43 -0000

Magnus Westerlund <magnus.westerlund@ericsson.com> writes:
> I would like to have your feedback on this errata.
>
> It appears to me that the code is hard coded for three components. That
> should be pretty evident for anyone reading the comments.
>
> So from that perspective Julius is correct that the code was not taking
> single component images into account. However, it is difficult to
> determine the intention here.

The code change in the erratum is:

    --- says	2015-01-29 21:21:01.578501194 -0500
    +++ should-say	2015-01-29 21:20:32.139678733 -0500
    @@ -1,4 +1,4 @@
    -Section Appendix B says:
    +It should say:

     int MakeHeaders(u_char *p, int type, int w, int h, u_char *lqt,
                     u_char *cqt, u_short dri)
    @@ -12,7 +12,7 @@
             *p++ = 0xd8;            /* SOI */

             p = MakeQuantHeader(p, lqt, 0);
    -        p = MakeQuantHeader(p, cqt, 1);
    +        if(cqt != NULL) p = MakeQuantHeader(p, cqt, 1);

             if (dri != 0)
                     p = MakeDRIHeader(p, dri);
    @@ -27,7 +27,7 @@
             *p++ = w >> 8;          /* width msb */
             *p++ = w;               /* wudth lsb */
             *p++ = 3;               /* number of components */
    -        *p++ = 0;               /* comp 0 */
    +        *p++ = 1;               /* comp 1 */
             if (type == 0)
                     *p++ = 0x21;    /* hsamp = 2, vsamp = 1 */
             else
    @@ -47,6 +47,8 @@
                                   sizeof(lum_ac_codelens),
                                   lum_ac_symbols,
                                   sizeof(lum_ac_symbols), 0, 1);
    +        if(cqt != NULL)
    +        {
             p = MakeHuffmanHeader(p, chm_dc_codelens,
                                   sizeof(chm_dc_codelens),
                                   chm_dc_symbols,
    @@ -55,6 +57,7 @@
                                   sizeof(chm_ac_codelens),
                                   chm_ac_symbols,
                                   sizeof(chm_ac_symbols), 1, 1);
    +       }



    @@ -67,14 +70,14 @@
             *p++ = 0xff;
             *p++ = 0xda;            /* SOS */
             *p++ = 0;               /* length msb */
    -        *p++ = 12;              /* length lsb */
    -        *p++ = 3;               /* 3 components */
    +        *p++ = cqt != NULL ? 0x12 : 0x0b;/* length lsb */
    +        *p++ = cqt != NULL ? 0x03 : 0x01;/* 3 components */
             *p++ = 0;               /* comp 0 */
             *p++ = 0;               /* huffman table 0 */
    -        *p++ = 1;               /* comp 1 */
    -        *p++ = 0x11;            /* huffman table 1 */
    -        *p++ = 2;               /* comp 2 */
    -        *p++ = 0x11;            /* huffman table 1 */
    +        *p++ = 0x01;               /* comp 1 */
    +        *p++ = cqt != NULL ? 0x11 : 0x00;/* huffman table 1 */
    +        if(cqt != NULL) *p++ = 2;/* comp 2 */
    +        *p++ = cqt != NULL ? 0x11 : 0x00;/* huffman table 1 */
             *p++ = 0;               /* first DCT coeff */
             *p++ = 63;              /* last DCT coeff */
             *p++ = 0;               /* sucessive approx. */

I don't understand the code, but it appears that the "should-say" code is
intended to work as the "says" code works when cqt is not NULL.

However, this change is always operative:

    -        *p++ = 0;               /* comp 0 */
    +        *p++ = 1;               /* comp 1 */

And this change is peculiar, in that the first character assigned to p
changes from 12 to a choice between 18 (0x12) and 11 (0xB).  I wonder if
0x12 is intended to be 12?

    -        *p++ = 12;              /* length lsb */
    -        *p++ = 3;               /* 3 components */
    +        *p++ = cqt != NULL ? 0x12 : 0x0b;/* length lsb */
    +        *p++ = cqt != NULL ? 0x03 : 0x01;/* 3 components */

Dale