On 7/4/07, <b class="gmail_sendername">Benjamin Larsson</b> &lt;<a href="mailto:banan@ludd.ltu.se">banan@ludd.ltu.se</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!</blockquote><div><br>Hi Benjamin <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; +#define QCELP_RATE_FULL_BITMAP \<br>
&gt;<br>And make tables of these in the future.</blockquote><div><br>That&#39;s the plan. As of now, its easier for me to have it this way<br>&nbsp;</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; + *<br>&gt; + * Oce frame is parsed all data gets stored in QCELPFrame.data acording<br>&gt; + * to this structure:<br>&gt;<br><br>? Oce</blockquote><div><br>&#39;Once&#39;, will correct it, thanks <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
&gt; + * LSPVs&nbsp;&nbsp;&nbsp;&nbsp;60&nbsp;&nbsp;&nbsp;&nbsp;61 62 63 64<br>&gt; + * RSVD&nbsp;&nbsp;&nbsp;&nbsp; 65<br>&gt; + * LSP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;66&nbsp;&nbsp;&nbsp;&nbsp;67 68 69 70 71 72 73 74 75<br>&gt; + * CBSEED&nbsp;&nbsp; 76<br>&gt; + *<br>&gt; + *-------------------------------------------------------------------------*/
<br>&gt; +<br>&gt; +typedef struct<br>&gt; +{<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;qcelp_packet_type type;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;uint8_t data[76];&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* holds all data from a frame (_once_ parsed) */<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;uint8_t bits;<br>&gt; +} QCELPFrame;<br>
&gt;<br><br>Move this to the c file, and use simpler types(int). And rename<br>qcelp_packet_type to qcelp_packet_rate.</blockquote><div><br>ok but ..<br><br>a) do you want me to move the comment too?<br>b) whats wrong with uint8_t ? guess I could use unsigned char too but why?
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; +<br>&gt; +typedef struct {<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;GetBitContext gb;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;QCELPFrame&nbsp;&nbsp;&nbsp;&nbsp;*frame;
<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; erasure_count;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;uint8_t&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ifq_count;<br>&gt; +} QCELPContext;<br>&gt;<br><br>Use the int type and don&#39;t allocate frame.</blockquote><div><br>again , see b) above. <br></div>
<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Use int where you can.</blockquote><div><br>and again .. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q-&gt;frame-&gt;type = RATE_FULL;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;q-&gt;frame-&gt;bits = qcelp_bits_per_type[RATE_FULL];<br>&gt;</blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
To not use the qcelp_bits_per_type table and just write the value here<br>might be more clear if the table is only referenced once.<br></blockquote><div><br>I&#39;m unsure right now but I will keep it in mind<br></div><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&gt; +&nbsp;&nbsp;&nbsp;&nbsp;bitcount=0;<br>&gt; +&nbsp;&nbsp;&nbsp;&nbsp;while(bitcount &lt; q-&gt;frame-&gt;bits)<br>&gt;<br><br>
Can you use a for loop instead ? Should give more compact and<br>understandable code.</blockquote><div><br>Sure, why not. <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
That&#39;s all for now, keep up the good work.</blockquote><div><br>Will try ;)<br><br>Best regards<br><br>&nbsp; &nbsp; &nbsp; Reynaldo <br></div></div><br>