On 7/4/07, <b class="gmail_sendername">Benjamin Larsson</b> <<a href="mailto:banan@ludd.ltu.se">banan@ludd.ltu.se</a>> 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;">> +#define QCELP_RATE_FULL_BITMAP \<br>
><br>And make tables of these in the future.</blockquote><div><br>That's the plan. As of now, its easier for me to have it this way<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> + *<br>> + * Oce frame is parsed all data gets stored in QCELPFrame.data acording<br>> + * to this structure:<br>><br><br>? Oce</blockquote><div><br>'Once', 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;">
> + * LSPVs 60 61 62 63 64<br>> + * RSVD 65<br>> + * LSP 66 67 68 69 70 71 72 73 74 75<br>> + * CBSEED 76<br>> + *<br>> + *-------------------------------------------------------------------------*/
<br>> +<br>> +typedef struct<br>> +{<br>> + qcelp_packet_type type;<br>> + uint8_t data[76]; /* holds all data from a frame (_once_ parsed) */<br>> + uint8_t bits;<br>> +} QCELPFrame;<br>
><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;">> +<br>> +typedef struct {<br>> + GetBitContext gb;<br>> + QCELPFrame *frame;
<br>> + uint8_t erasure_count;<br>> + uint8_t ifq_count;<br>> +} QCELPContext;<br>><br><br>Use the int type and don'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>> + q->frame->type = RATE_FULL;<br>> + q->frame->bits = qcelp_bits_per_type[RATE_FULL];<br>></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'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;">> + bitcount=0;<br>> + while(bitcount < q->frame->bits)<br>><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's all for now, keep up the good work.</blockquote><div><br>Will try ;)<br><br>Best regards<br><br> Reynaldo <br></div></div><br>