if (st->complexity<1) st->complexity=1;
void nb_encoder_ctl(void *state, int request, void *ptr){   EncState *st;   st=state;        switch(request)   {   case SPEEX_GET_FRAME_SIZE:      (*(int*)ptr) = st->frameSize;      break;   case SPEEX_SET_LOW_MODE:   case SPEEX_SET_MODE:      st->submodeID = (*(int*)ptr);      break;   case SPEEX_GET_LOW_MODE:   case SPEEX_GET_MODE:      (*(int*)ptr) = st->submodeID;      break;   case SPEEX_SET_VBR:      st->vbr_enabled = (*(int*)ptr);      break;   case SPEEX_GET_VBR:      (*(int*)ptr) = st->vbr_enabled;      break;   case SPEEX_SET_VBR_QUALITY:      st->vbr_quality = (*(int*)ptr);      break;   case SPEEX_GET_VBR_QUALITY:      (*(int*)ptr) = st->vbr_quality;      break;   case SPEEX_SET_QUALITY:      {         int quality = (*(int*)ptr);         if (quality<=0)            st->submodeID = 0;         else if (quality<=1)            st->submodeID = 1;         else if (quality<=2)            st->submodeID = 2;         else if (quality<=4)            st->submodeID = 3;         else if (quality<=6)            st->submodeID = 4;         else if (quality<=8)            st->submodeID = 5;         else if (quality<=9)            st->submodeID = 6;         else if (quality<=10)            st->submodeID = 7;         else            fprintf(stderr, "Unknown nb_ctl quality: %d\n", quality);      }      break;   case SPEEX_SET_COMPLEXITY:      st->complexity = (*(int*)ptr);      break;   case SPEEX_GET_COMPLEXITY:      (*(int*)ptr) = st->complexity;      break;   case SPEEX_GET_BITRATE:      if (st->submodes[st->submodeID])         (*(int*)ptr) = 50*SUBMODE(bits_per_frame);      else         (*(int*)ptr) = 50*(NB_SUBMODE_BITS+1);      break;   default:      fprintf(stderr, "Unknown nb_ctl request: %d\n", request);   }}