Ignore:
Timestamp:
Dec 3, 2015, 4:40:49 PM (9 years ago)
Author:
alain
Message:

Modify the mjpeg application to support an optional
DCT hardware coprocessor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/mjpeg/demux.c

    r723 r736  
    8686    // giet_tty_alloc( 0 );
    8787
    88     PRINTF("\n[MJPEG] thread DEMUX[%d] starts on P[%d,%d,%d]\n", index, x, y, p )
     88    PRINTF("\n[MJPEG] thread DEMUX[%d] starts on P[%d,%d,%d] / trdid = %x\n",
     89           index , x , y , p, (uint32_t)trdid_demux[index] )
    8990
    9091    // initialise BUFIO for MWMR channel <in>
     
    9596
    9697#if (DEBUG_DEMUX > 1)
    97 PRINTF("\nDEMUX[%d] <in> : &mwmr = %x / &bufio = %x\n",
    98        index , mwmr_in , &bufio_in )
     98if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     99{ PRINTF("\nDEMUX[%d] <in> : &mwmr = %x / &bufio = %x\n",
     100         index , mwmr_in , &bufio_in ) }
    99101#endif
    100102
     
    106108
    107109#if (DEBUG_DEMUX > 1)
    108 PRINTF("\nDEMUX[%d] : <out_quanti> : mwmr = %x / &bufio = %x\n",
    109        index , mwmr_out_quanti , &bufio_out_quanti )
     110if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     111{ PRINTF("\nDEMUX[%d] : <out_quanti> : mwmr = %x / &bufio = %x\n",
     112         index , mwmr_out_quanti , &bufio_out_quanti ) }
    110113#endif
    111114
     
    117120
    118121#if (DEBUG_DEMUX > 1)
    119 PRINTF("\nDEMUX[%d] : <out_huff> : mwmr = %x / &bufio = %x\n",
    120        index , mwmr_out_huff , &bufio_out_huff )
     122if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     123{ PRINTF("\nDEMUX[%d] : <out_huff> : mwmr = %x / &bufio = %x\n",
     124         index , mwmr_out_huff , &bufio_out_huff ) }
    121125#endif
    122126
     
    128132
    129133#if (DEBUG_DEMUX > 1)
    130 PRINTF("\nDEMUX[%d] : <out_data> : mwmr = %x / &bufio = %x\n",
    131        index , mwmr_out_data , &bufio_out_data )
     134if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     135{ PRINTF("\nDEMUX[%d] : <out_data> : mwmr = %x / &bufio = %x\n",
     136         index , mwmr_out_data , &bufio_out_data ) }
    132137#endif
    133138
     
    150155            marker = get_next_marker( &bufio_in );
    151156
    152 #if (DEBUG_DEMUX > 1)
    153 if ( marker == SOI_MK ) PRINTF("\nDEMUX[%x] found Start of Image marker\n", index )
    154 #endif
    155157        }
    156158        while ( marker != SOI_MK );
     159
     160#if (DEBUG_DEMUX > 1)
     161if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     162{ PRINTF("\nDEMUX[%x] found Start of Image marker\n", index ) }
     163#endif
    157164
    158165        found_marker = 0;
     
    173180
    174181#if (DEBUG_DEMUX > 1)
    175 PRINTF("\nDEMUX[%x] found Start of Frame marker\n", index )
     182if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     183{ PRINTF("\nDEMUX[%x] found Start of Frame marker\n", index ) }
    176184#endif
    177185                // Only one component per image is supported
     
    208216
    209217#if (DEBUG_DEMUX > 1)
    210 PRINTF("\nDEMUX[%x] found Quantization Table marker\n", index )
     218if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     219{ PRINTF("\nDEMUX[%x] found Quantization Table marker\n", index ) }
    211220#endif
    212221                // The  quantisation table segment being fixed length,
     
    235244
    236245#if (DEBUG_DEMUX > 1)
    237 PRINTF("\nDEMUX[%x] found Huffman Table marker\n", index )
     246if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     247{ PRINTF("\nDEMUX[%x] found Huffman Table marker\n", index ) }
    238248#endif
    239249                // The Huffman Table segment being variable length,
     
    279289
    280290#if (DEBUG_DEMUX > 1)
    281 PRINTF("\nDEMUX[%x] found Start of Scan marker\n", index )
     291if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     292{ PRINTF("\nDEMUX[%x] found Start of Scan marker\n", index ) }
    282293#endif
    283294                // The scan segment has a variable length:
     
    330341
    331342#if (DEBUG_DEMUX > 1)
    332 PRINTF("\nDEMUX[%x] found End of Image marker\n", index )
     343if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     344{ PRINTF("\nDEMUX[%x] found End of Image marker\n", index ) }
    333345#endif
    334346                mwmr_bufio_flush( &bufio_out_data );
     
    341353
    342354#if (DEBUG_DEMUX > 1)
    343 PRINTF("\nDEMUX[%x] found Comment or Application marker\n", index )
     355if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     356{ PRINTF("\nDEMUX[%x] found Comment or Application marker\n", index ) }
    344357#endif
    345358                // read segment length from bufio_in
     
    367380
    368381#if DEBUG_DEMUX
    369 PRINTF("\nDEMUX[%d] completes image %d at cycle %d\n", index , image , giet_proctime() )
     382if ( (index == DEBUG_CLUSTER_INDEX) || (DEBUG_CLUSTER_INDEX == 0XFFFFFFFF) )
     383{ PRINTF("\nDEMUX[%d] completes image %d at cycle %d\n", index , image , giet_proctime() ) }
    370384#endif
    371385        image = image + x_size * y_size;
     
    373387    }  // end while on images
    374388
    375     giet_pthread_exit( "demux completed" );
     389    giet_pthread_exit( "DEMUX completed" );
    376390
    377391}  // end demux()
Note: See TracChangeset for help on using the changeset viewer.