rendered paste bodyint theora_control(theora_state *th,int req,void *buf,size_t buf_sz) {
CP_INSTANCE *cpi = th->internal_encode;
PB_INSTANCE *pbi = &cpi->pb;
switch(req) {
case TH_ENCCTL_SET_QUANT_PARAMS:
if( ( buf==NULL&&buf_sz!=0 )
|| ( buf!=NULL&&buf_sz!=sizeof(th_quant_info) )
|| cpi->CurrentFrame != 1 ){
return TH_EINVAL;
}
memcpy(&pbi->quant_info, buf, sizeof(th_quant_info));
InitQTables(pbi);
return 0;
default:
return TH_EIMPL;
}
}int theora_control(theora_state *th,int req,void *buf,size_t buf_sz) {
CP_INSTANCE *cpi = th->internal_encode;
PB_INSTANCE *pbi = &cpi->pb;
switch(req) {
case TH_ENCCTL_SET_QUANT_PARAMS:
if( ( buf==NULL&&buf_sz!=0 )
|| ( buf!=NULL&&buf_sz!=sizeof(th_quant_info) )
|| cpi->CurrentFrame != 1 ){
return TH_EINVAL;
}
memcpy(&pbi->quant_info, buf, sizeof(th_quant_info));
InitQTables(pbi);
return 0;
default:
return TH_EIMPL;
}
}