Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linux-dvb] Re: Newstruct and DVB-C with QAM_256




On Thu, 4 Jul 2002, Holger Waechtler (HW) wrote:

HW> Sergei Haller wrote:
HW> > On Thu, 4 Jul 2002, Holger Waechtler (HW) wrote:
HW> >
HW> > So why don't you scale by 257: [0x00...0xFF]*257 = [0x0000...0xFFFF]
HW> >
HW> > ... but wait, 257 = 0x101, so 0xXY * 0x101 = 0xXYXY ...
HW> >
HW> > so scaling by 257 is the same as duplicating the 8 bit values...
HW>
HW> but computationally a little more expensive -- a multiplication costs
HW> more than the shift-or combination
HW> ;)

;)  yes  of  course,

but if you say, "we just double the value", it sounds like "we are lazy to
think  about  a proper way to scale, so we just double the byte"; it's not
clear  that  it  is  scaling,  one  has to think about if the scale of the
0x00..0xFF values is the same as the scale of 0x0000...0xFFFF.

and if you say "we scale by 257 and the side effect is that both bytes are
equal",  everyone  knows:  ahh,  so it is just scaling, so we get the same
scale on the new range as the scale on the old range...



HW> well  it  does  not  really matter, I'm sure there are still about 100
HW> other ways to do it...

of  course, for the implementation one would take the most efficient known
way to do it.

So  maybe you can even put a comment (with the little proof above) on that
place  in  the  code  that  it is the same as multiplying by 257. (just to
prevent  somebody from changing this part of code to multiplication by 257
in the future)


c ya
        Sergei
--
--------------------------------------------------------------------
         eMail:       Sergei.Haller@math.uni-giessen.de
--------------------------------------------------------------------
Be careful of reading health books, you might die of a misprint.
                -- Mark Twain




-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index