6 /* Graphics acceleration routines */
8 void quicktime_init_yuv(quicktime_yuv_t *yuv_table)
11 for(i = 0; i < 256; i++)
14 yuv_table->rtoy_tab[i] = (long)( 0.2990 * 65536 * i);
15 yuv_table->rtou_tab[i] = (long)(-0.1687 * 65536 * i);
16 yuv_table->rtov_tab[i] = (long)( 0.5000 * 65536 * i);
18 yuv_table->gtoy_tab[i] = (long)( 0.5870 * 65536 * i);
19 yuv_table->gtou_tab[i] = (long)(-0.3320 * 65536 * i);
20 yuv_table->gtov_tab[i] = (long)(-0.4187 * 65536 * i);
22 yuv_table->btoy_tab[i] = (long)( 0.1140 * 65536 * i);
23 yuv_table->btou_tab[i] = (long)( 0.5000 * 65536 * i);
24 yuv_table->btov_tab[i] = (long)(-0.0813 * 65536 * i);
27 yuv_table->vtor = &(yuv_table->vtor_tab[128]);
28 yuv_table->vtog = &(yuv_table->vtog_tab[128]);
29 yuv_table->utog = &(yuv_table->utog_tab[128]);
30 yuv_table->utob = &(yuv_table->utob_tab[128]);
31 for(i = -128; i < 128; i++)
34 yuv_table->vtor[i] = (long)( 1.4020 * 65536 * i);
35 yuv_table->vtog[i] = (long)(-0.7141 * 65536 * i);
37 yuv_table->utog[i] = (long)(-0.3441 * 65536 * i);
38 yuv_table->utob[i] = (long)( 1.7720 * 65536 * i);
42 void quicktime_delete_yuv(quicktime_yuv_t *yuv_table)
47 quicktime_scaletable_t* quicktime_new_scaletable(int input_w, int input_h, int output_w, int output_h)
49 quicktime_scaletable_t *result = (quicktime_scaletable_t*)malloc(sizeof(quicktime_scaletable_t));
51 float scalex = (float)input_w / output_w, scaley = (float)input_h / output_h;
53 result->input_x = (int*)malloc(sizeof(int) * output_w);
54 result->input_y = (int*)malloc(sizeof(int) * output_h);
56 for(i = 0; i < output_w; i++)
58 result->input_x[(int)i] = (int)(scalex * i);
61 for(i = 0; i < output_h; i++)
63 result->input_y[(int)i] = (int)(scaley * i);
66 result->in_w = input_w;
67 result->in_h = input_h;
68 result->out_w = output_w;
69 result->out_h = output_h;
73 void quicktime_delete_scaletable(quicktime_scaletable_t *scaletable)
75 free(scaletable->input_x);
76 free(scaletable->input_y);
80 /* Return 1 if dimensions are different from scaletable */
81 int quicktime_compare_scaletable(quicktime_scaletable_t *scaletable,
87 if(scaletable->in_w != in_w ||
88 scaletable->in_h != in_h ||
89 scaletable->out_w != out_w ||
90 scaletable->out_h != out_h)
96 /* Return 1 if the scaletable is 1:1 */
97 int quicktime_identity_scaletable(quicktime_scaletable_t *scaletable)
99 if(scaletable->in_w == scaletable->out_w &&
100 scaletable->in_h == scaletable->out_h)