<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>that is correct<BR>
to have an idea, go have a look here: <A href="http://xa.bi/files/amrconvert">http://xa.bi/files/amrconvert</A><BR>
<BR><BR><BR><BR> <BR>
<HR id=stopSpelling>
<BR>
> Date: Mon, 30 Jul 2007 15:37:46 +0200<BR>> From: klaus.mailinglists@pernau.at<BR>> To: asterisk-video@lists.digium.com<BR>> Subject: Re: [Asterisk-video] if2 bit stuffing in app_h324m<BR>> <BR>> Hi Francesco!<BR>> <BR>> Francesco Emmi wrote:<BR>> > Klaus Darilion wrote:<BR>> >> Thanks - got it.<BR>> >><BR>> >> But I'm still not sure about the Bitreverse during if2 stuffing.<BR>> >><BR>> >> There is Bitreverse() libh324m during H324MSessionRead and <BR>> >> H324MSessionWrite. Thus, those should be transparent to h324m_gw.<BR>> >><BR>> > <BR>> > Yes, you are right. But consider that ReverseBit here has not a "octet <BR>> > sex" meaning. It is used just because simplifies code for transcoding <BR>> > from MIME to IF2 (Better you look ETSI TS 126 101...it's very clear and <BR>> > you'll understand soon why the use of reverseBit).<BR>> <BR>> Ok. Can you please help me to understand the bit encodings?<BR>> <BR>> I think I understand the RFC 4867 format - e.g: mode 7 uses 244 bits. <BR>> Network order with most significant byte/bit first. Thus<BR>> <BR>> AMR bit 0 -> buf[0] | (1 << 7)<BR>> AMR bit 1 -> buf[0] | (1 << 6)<BR>> AMR bit 2 -> buf[0] | (1 << 5)<BR>> AMR bit 3 -> buf[0] | (1 << 4)<BR>> AMR bit 4 -> buf[0] | (1 << 3)<BR>> AMR bit 5 -> buf[0] | (1 << 2)<BR>> AMR bit 6 -> buf[0] | (1 << 1)<BR>> AMR bit 7 -> buf[0] | (1 << 0)<BR>> AMR bit 8 -> buf[1] | (1 << 7)<BR>> AMR bit 9 -> buf[1] | (1 << 6)<BR>> ...<BR>> <BR>> AMR bit 242 -> buf[30] | (1 << 5)<BR>> AMR bit 243 -> buf[30] | (1 << 4)<BR>> <BR>> Is this correct?<BR>> <BR>> Then, if this is transformed to if2 - I would think it should be following:<BR>> <BR>> AMR mode bit 0 -> buf[0] | (1 << 7)<BR>> AMR mode bit 1 -> buf[0] | (1 << 6)<BR>> AMR mode bit 2 -> buf[0] | (1 << 5)<BR>> AMR mode bit 3 -> buf[0] | (1 << 4)<BR>> <BR>> AMR bit 0 -> buf[0] | (1 << 3)<BR>> AMR bit 1 -> buf[0] | (1 << 2)<BR>> AMR bit 2 -> buf[0] | (1 << 1)<BR>> AMR bit 3 -> buf[0] | (1 << 0)<BR>> AMR bit 4 -> buf[1] | (1 << 7)<BR>> AMR bit 5 -> buf[1] | (1 << 6)<BR>> AMR bit 6 -> buf[1] | (1 << 5)<BR>> AMR bit 7 -> buf[1] | (1 << 4)<BR>> AMR bit 8 -> buf[1] | (1 << 3)<BR>> AMR bit 9 -> buf[1] | (1 << 2)<BR>> ...<BR>> <BR>> AMR bit 242 -> buf[30] | (1 << 1)<BR>> AMR bit 243 -> buf[30] | (1 << 0)<BR>> <BR>> <BR>> Is this correct?<BR>> <BR>> <BR>> >> But: There is Bitreverse() when creating the h324 frames - but there is <BR>> >> no Bitreverse() when creating the ast_frame. Further, when creating the <BR>> >> ast_frame, the mode is derived from the first byte, but then the AMR <BR>> >> frame is just copied without if2 decoding (shifting everything for 4 bits).<BR>> >><BR>> > <BR>> > Ok. According to me you are right. Code in my machine has been patched <BR>> > also to convert from IF2 to MIME in ast_create_frame (so a Bitreverse <BR>> > also here). I had no time to discuss this feature with Sergio, and then <BR>> > to commit patch. But I think this is the correct way.<BR>> <BR>> Can you please post your version of app_h324m.c (or the corresponding <BR>> patch) at the mailing list.<BR>> <BR>> > Anyway, without this, mp4save will save an mp4 with amr in IF2 format, <BR>> > and AFAIK this is not correct...<BR>> <BR>> Yes. I've managed to save AMR in IF2 format to an mp4 file, and playing <BR>> it back - but now I know that I'm wrong and I have to transform to <BR>> RFC4867 format.<BR>> <BR>> regards<BR>> klaus<BR>> <BR>> _______________________________________________<BR>> --Bandwidth and Colocation Provided by http://www.api-digital.com--<BR>> <BR>> asterisk-video mailing list<BR>> To UNSUBSCRIBE or update options visit:<BR>> http://lists.digium.com/mailman/listinfo/asterisk-video<BR><BR><br /><hr />Besoin d'un e-mail ? Créez gratuitement un compte Windows Live Hotmail et bénéficiez d'un filtre antivirus gratuit ! <a href='http://www.windowslive.fr/hotmail/default.asp' target='_new'>Windows Live Hotmail</a></body>
</html>