return cachemodellist;
}
-cachemodel_param_t * gene_cachemodel( cachemodellist_param_t *cachemodellist, target_param_t *target)
+cachemodel_param_t * gene_cachemodel( cachemodellist_param_t *cachemodellist, target_param_t *target, bool reqJPP)
{
cachemodel_param_t *cachemodel;
faixbox_param_t *tilepart;
cachemodel = (cachemodel_param_t *)malloc( sizeof(cachemodel_param_t));
refer_target( target, &cachemodel->target);
+
+ if( reqJPP){
+ if( target->jppstream)
+ cachemodel->jppstream = true;
+ else
+ cachemodel->jppstream = false;
+ } else{ // reqJPT
+ if( target->jptstream)
+ cachemodel->jppstream = false;
+ else
+ cachemodel->jppstream = true;
+ }
+
cachemodel->mhead_model = false;
tilepart = target->codeidx->tilepart;
free( (*cachemodel)->tp_model);
free( (*cachemodel)->th_model);
- if( (*cachemodel)->target->codeidx->SIZ.Csiz > 1)
- for( i=0; i<(*cachemodel)->target->codeidx->SIZ.Csiz; i++)
- free( (*cachemodel)->pp_model[i]);
+ for( i=0; i<(*cachemodel)->target->codeidx->SIZ.Csiz; i++)
+ free( (*cachemodel)->pp_model[i]);
free( (*cachemodel)->pp_model);
#ifndef SERVER
#endif
free( *cachemodel);
}
+
+bool is_allsent( cachemodel_param_t cachemodel)
+{
+ target_param_t *target;
+ Byte8_t TPnum; // num of tile parts in each tile
+ Byte8_t Pmax; // max num of packets per tile
+ int i, j, k, n;
+
+ target = cachemodel.target;
+
+ if( !cachemodel.mhead_model)
+ return false;
+
+ TPnum = get_nmax( target->codeidx->tilepart);
+
+ if( cachemodel.jppstream){
+ for( i=0; i<target->codeidx->SIZ.XTnum*target->codeidx->SIZ.YTnum; i++){
+ if( !cachemodel.th_model[i])
+ return false;
+
+ for( j=0; j<target->codeidx->SIZ.Csiz; j++){
+ Pmax = get_nmax( target->codeidx->precpacket[j]);
+ for( k=0; k<Pmax; k++)
+ if( !cachemodel.pp_model[j][i*Pmax+k])
+ return false;
+ }
+ }
+ return true;
+ }
+ else{
+ for( i=0, n=0; i<target->codeidx->SIZ.YTnum; i++)
+ for( j=0; j<target->codeidx->SIZ.XTnum; j++)
+ for( k=0; k<TPnum; k++)
+ if( !cachemodel.tp_model[n++])
+ return false;
+ return true;
+ }
+}