Ejemplo n.º 1
0
static void
destroy_frames(vda_decoder_t *vdad)
{
  vda_frame_t *vf;
  while((vf = LIST_FIRST(&vdad->vdad_frames)) != NULL)
    destroy_frame(vf);
}
Ejemplo n.º 2
0
Archivo: vtb.c Proyecto: Ezio-PS/movian
static void
destroy_frames(vtb_decoder_t *vtbd)
{
  vtb_frame_t *vf;
  while((vf = LIST_FIRST(&vtbd->vtbd_frames)) != NULL)
    destroy_frame(vf);
}
static inline void _fl_cleanNodes(GSM0710_FrameList *list)
{
    GSM0710_Frame *frame;

    while (!_fl_isEmpty(list)) {
        frame = _fl_popFrame(list);
        destroy_frame(frame);
    }
}
Ejemplo n.º 4
0
Archivo: thing.c Proyecto: Cougar/pwm
void destroy_thing(WThing *t)
{
	if(WTHING_IS(t, WTHING_FRAME))
		destroy_frame((WFrame*)t);
	else if(WTHING_IS(t, WTHING_DOCK))
		destroy_dock((WDock*)t);
	else if(WTHING_IS(t, WTHING_MENU))
		destroy_menu_tree((WMenu*)t);
	else if(WTHING_IS(t, WTHING_CLIENTWIN))
		unmanage_clientwin((WClientWin*)t);
}
Ejemplo n.º 5
0
Archivo: tac.c Proyecto: arakan94/ifj15
void free_tac() {
	free(f_list);
	free(ta_table);

	while (!stack_empty(frame_stack)) {
		rm_frame();
	}
	stack_dispose(frame_stack);

	destroy_frame(prep_frame);
}
Ejemplo n.º 6
0
// Baseline DCT
void parse_sof0(struct c63_common *cm)
{
    uint16_t size;
    size = (get_byte(cm->e_ctx.fp) << 8) | get_byte(cm->e_ctx.fp);


    uint8_t precision = get_byte(cm->e_ctx.fp);
    if (precision != 8)
    {
        printf("Only 8-bit precision supported\n");
        exit(1);
    }

    uint16_t height = (get_byte(cm->e_ctx.fp) << 8) | get_byte(cm->e_ctx.fp);
    uint16_t width = (get_byte(cm->e_ctx.fp) << 8) | get_byte(cm->e_ctx.fp);

    // Discard subsampling info. We assume 4:2:0
    uint8_t buf[10];
    read_bytes(cm->e_ctx.fp, buf, 10);


    /* First frame? */
    if (cm->framenum == 0)
    {
        cm->width = width;
        cm->height = height;

        cm->padw[0] = cm->ypw = (uint32_t)(ceil(width/16.0f)*16);
        cm->padh[0] = cm->yph = (uint32_t)(ceil(height/16.0f)*16);
        cm->padw[1] = cm->upw = (uint32_t)(ceil(width*UX/(YX*8.0f))*8);
        cm->padh[1] = cm->uph = (uint32_t)(ceil(height*UY/(YY*8.0f))*8);
        cm->padw[2] = cm->vpw = (uint32_t)(ceil(width*VX/(YX*8.0f))*8);
        cm->padh[2] = cm->vph = (uint32_t)(ceil(height*VY/(YY*8.0f))*8);

        cm->mb_cols = cm->ypw / 8;
        cm->mb_rows = cm->yph / 8;

        cm->curframe = 0;
    }


    /* Advance to next frame */
    destroy_frame(cm->refframe);
    cm->refframe = cm->curframe;
    cm->curframe = create_frame(cm, 0);

    /* Is this a keyframe */
    cm->curframe->keyframe = get_byte(cm->e_ctx.fp);
}
void _fc_cacheFrameData(
    Channel *    channel,
    GSM0710_Frame * frame)
{
    LOGMUX(LOG_DEBUG, "Enter");

    /* All data sent from the modem before receiving the MSC with FC OFF Rsp will be inserted into the link list */
    if ((channel->rx_fl_total + frame->length) > RX_FLOW_CTRL_HIGH_WATERMARK) {
        LOGMUX(LOG_DEBUG, "Accumulated_pending_frame_bytes is larger than mark val=%d, drop it",
               RX_FLOW_CTRL_HIGH_WATERMARK);
        serial.in_buf->dropped_count++;
        //mtk02863
        //Gsm0710Muxd_Assert(19);
    } else {
        channel->rx_fl_total += frame->length;
        channel->rx_fl = _fl_pushFrame(channel->rx_fl, frame);
    }

    LOGMUX(LOG_INFO, "Case2:Frame List=0x%08X, pending_frame_bytes=%d, frame_len=%d",
           (unsigned int)channel->rx_fl, channel->rx_fl_total, frame->length);
    destroy_frame(frame);
    return;
}
Ejemplo n.º 8
0
/* The shell's main routine.  Consists of several steps:
 *  1> Reads JPEGs using first command-line parameter(s)
 *  2> Records the process's elapsed time
 *  3> Lets the user play with the images
 *  4> Checks the elapsed time again, prints out the difference
 *  5> Writes JPEGs out using last command-line parameter(s)
 */
int main(int argc, char *argv[]) {
    int i;
    int num_inputs; /* Number of JPEG input-output files */
    int num_runs, run;  /* Number of runs, for multi-run code */
    double run_time, total_time; /* Amount of time we've run */
    struct timeval start_time, end_time; /* Time before/after user code */

    /* Step 0A: Check & process command line */
    if (argc != 1 + NUM_INPUTS + NUM_OUTPUTS + RUNS_COMMAND + RUNS_PROCS) {
        fprintf(stderr, "Usage: %s runs procs input1.jpg %soutput.jpg\n",
                argv[0],
                NUM_INPUTS > 1 ? "input2.jpg " : "");
        exit(1);
    }

    num_inputs = argc - 1 - NUM_OUTPUTS - RUNS_COMMAND - RUNS_PROCS;

    num_runs = atoi(argv[1]);
    if (num_runs < 1) num_runs = 1;
    if (num_runs > 10) num_runs = 10; /* Change if you like LOTS of runs */
    fprintf(stderr, "Making %d runs . . .\n", num_runs);
    num_procs = atoi(argv[1 + RUNS_COMMAND]);
    if (num_procs < 1) num_procs = 1;
    if (num_procs > 256) num_procs = 256;
    fprintf(stderr, "Using %d processors . . .\n", num_procs);

    /* Step 1: Get some JPEGs into memory, uncompressed */
    for (i=0; i < num_inputs; i++)
        input_frames[i] = read_JPEG_file(argv[i+1+RUNS_COMMAND+RUNS_PROCS]);

    /* Step 2: Allocate output frames */
    for (i=0; i < NUM_OUTPUTS; i++)
        output_frames[i] = allocate_frame(input_frames[i]->image_height,
                                          input_frames[i]->image_width,
                                          input_frames[i]->num_components);

    /* Loop over multiple runs, if desired */

    total_time = 0.0;
    run = 0;
    while ((run < num_runs)) {
        /* Step 3: Record elapsed time */
        gettimeofday(&start_time, NULL);

        /* Step 4: Call a user function! */
        EEE4084F_parallel();

        /* Step 5: Check & print elapsed time */
        gettimeofday(&end_time, NULL);
        run_time = ((double)(end_time.tv_sec) + (double)(end_time.tv_usec)/1000000.0)
                   - ((double)(start_time.tv_sec) + (double)(start_time.tv_usec)/1000000.0);

        fprintf(stderr, "%d. ELAPSED  TIME = %20.3f sec\n", run, run_time);
        total_time += run_time;
#ifdef NO_FIRST
        if (run == 0) {
            fprintf(stderr, "  . . . first run discarded\n");
            total_time = 0.0;
        }
#endif
        run++;
    }

    /* Print out final, average time, if desired */
#ifdef NO_FIRST
    fprintf(stderr, "AVERAGE ELAPSED TIME = %20.3f seconds\n",
            total_time / ((double)(run - 1)));
#else
    fprintf(stderr, "AVERAGE ELAPSED TIME = %20.3f seconds\n",
            total_time / ((double)run));
#endif

    /* Step 6: Write JPEGs out from memory buffers */
    for (i=0; i < NUM_OUTPUTS; i++)
        write_JPEG_file(argv[argc - NUM_OUTPUTS + i], output_frames[i], OUT_QUALITY);

    destroy_frame(input_frames[0]);
    printf("input_frame[0]!\n");
    destroy_frame(output_frames[0]);
    printf("output_frame[0]!\n");

}
Ejemplo n.º 9
0
Archivo: tac.c Proyecto: arakan94/ifj15
void rm_frame() {
	destroy_frame(stack_pop(frame_stack));
}