modify the feedback system in O-mode
hello,
I try to modify the feedback system. I mainly change three files : rohc_decomp.h/c and d_generic.c. I set the situation "ROHC_ERROR" to "ROHC_ERROR_CRC", ie, if decompression is failure, it always returns ROHC_ERROR_CRC. I change feedback from piggybacking to interspersing. So I add ROHC_ERROR_FEEDBACK when feedback is decompressed unsuccessfully.
Here are the main code:
first, in file rohc_decomp.h
add #define N and #define K
in struct d_context add:
/// create a window for feedback interval in NO CONTEXT state
struct c_wlsb *curvalnc;
/// create a window for feedback interval in STATIC CONTEXT state
struct c_wlsb *curvalsc;
/// create a window for feedback interval in FULL CONTEXT state
struct c_wlsb *curvalfc;
/// create a window for feedback interval in case of ROHC_ERROR_
struct c_wlsb *curvalenc;
/// create a window for feedback interval in STATIC CONTEXT state
struct c_wlsb *curvalsc0;
///The number of received packets in NO CONTEXT state
int num_recv_nc;
///The number of received packets in STATIC CONTEXT state
int num_recv_sc;
///The number of received packets in FULL CONTEXT state
int num_recv_fc;
///The number of received packets in case of ROHC_ERROR_CONTEXT
int num_recv_enc;
///The number of received packets in STATIC CONTEXT state(type0,1)
int num_recv_sc0;
second, in file rohc_decomp.c
in function rohc_decompress():
switch(ret)
{
case ROHC_ERROR_
break;
//BY SQ
case ROHC_ERROR_
break;
case ROHC_ERROR_CRC:
{
case NO_CONTEXT:
{
}
case STATIC_CONTEXT:
{
}
case FULL_CONTEXT:
{
}
}
case ROHC_ERROR_
decomp-
{
int i;
{
}
}
break;
case ROHC_ERROR_SC:
ddata.
{
int i;
{
}
}
break;
default: /* ROHC_OK_NO_DATA, ROHC_OK */
if(decomp-
{
/* switch active context to O-mode */
ddata.
d_operation
}
break;
}
in function d_optimistic_
switch(rohc_status)
{
case ROHC_OK:
/* create an ACK feedback */
rohc_debugf(1, "send an ACK feedback\n");
f_feedback2(
feedback = f_wrap_
if(feedback == NULL)
{
rohc_debugf(0, "failed to create an ACK feedback\n");
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
context-
c_piggyback_
/* destroy the feedback */
zfree(feedback);
break;
case ROHC_ERROR_
/* create a STATIC NACK feedback */
rohc_debugf(1, "send a STATIC NACK feedback\n");
f_feedback2(
f_add_
feedback = f_wrap_
if(feedback == NULL)
{
rohc_debugf(0, "failed to create a STATIC NACK feedback\n");
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
context-
c_piggyback_
/* destroy the feedback */
zfree(feedback);
break;
case ROHC_ERROR_SC:
{
}
/* create a NACK feedback */
rohc_debugf(1, "send a NACK feedback\n");
f_feedback2(
feedback = f_wrap_
if(feedback == NULL)
{
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
c_
/* destroy the feedback */
zfree(
break;
case ROHC_ERROR_CRC:
//context-
switch(
{
case NO_CONTEXT:
/* create a STATIC NACK feedback */
rohc_debugf(1, "send a STATIC NACK feedback\n");
f_
feedback = f_wrap_
if(feedback == NULL)
{
rohc_
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
c_
/* destroy the feedback */
zfree(
break;
case STATIC_CONTEXT:
f_
feedback = f_wrap_
if(feedback == NULL)
{
rohc_
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
c_
zfree(
case FULL_CONTEXT:
/* create a NACK feedback */
rohc_debugf(1, "send a NACK feedback\n");
f_
feedback = f_wrap_
if(feedback == NULL)
{
rohc_
return;
}
/* send the feedback via the compressor associated
* with the decompressor */
c_
/* change state */
context->state = STATIC_CONTEXT;
/* destroy the feedback */
zfree(
break;
default:
rohc_debugf(0, "should not arrive: unknown state value (%d)\n",
break;
}
break;
}
in function struct d_context * context_create():
context-
context-
context-
context-
context-
context-
context-
context-
context-
context-
in function context_free():
c_destroy_
third, in file d_generic.c
in function decode_
//set wlsb window value to zero when change state
if(context->state == NO_CONTEXT)
{
int i;
//set wlsb window value to zero
for(i = 0; i < N; i++)
{
}
}
else if(context->state == STATIC_CONTEXT)
{
int i;
//set wlsb window value to zero
for(i = 0; i < N; i++)
{
}
}
in function decode_irdyn, add code after context->state = FULL_CONTEXT:
int i1;
//set wlsb window value to zero when change state
for(i1 = 0; i1 < N; i1++)
{
}
context-
context-
context-
context-
context-
context-
in function decode_uor2(), add code after context->state = FULL_CONTEXT:
int i1;
//set wlsb window value to zero when change state
for(i1 = 0; i1 < N; i1++)
{
}
context-
context-
context-
context-
context-
context-
in function d_generic_decode:
in switch(
I change the code in that way according to RFC 3095 5.3.2.2.3 and 5.4.2.2.
Question information
- Language:
- English Edit question
- Status:
- Open
- For:
- rohc Edit question
- Assignee:
- Didier Barvaux Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask qingbaibai for more information if necessary.