5 /* Graphics acceleration routines */
7 void quicktime_init_yuv(quicktime_yuv_t
*yuv_table
)
10 for(i
= 0; i
< 256; i
++)
13 yuv_table
->rtoy_tab
[i
] = (long)( 0.2990 * 65536 * i
);
14 yuv_table
->rtou_tab
[i
] = (long)(-0.1687 * 65536 * i
);
15 yuv_table
->rtov_tab
[i
] = (long)( 0.5000 * 65536 * i
);
17 yuv_table
->gtoy_tab
[i
] = (long)( 0.5870 * 65536 * i
);
18 yuv_table
->gtou_tab
[i
] = (long)(-0.3320 * 65536 * i
);
19 yuv_table
->gtov_tab
[i
] = (long)(-0.4187 * 65536 * i
);
21 yuv_table
->btoy_tab
[i
] = (long)( 0.1140 * 65536 * i
);
22 yuv_table
->btou_tab
[i
] = (long)( 0.5000 * 65536 * i
);
23 yuv_table
->btov_tab
[i
] = (long)(-0.0813 * 65536 * i
);
26 yuv_table
->vtor
= &(yuv_table
->vtor_tab
[128]);
27 yuv_table
->vtog
= &(yuv_table
->vtog_tab
[128]);
28 yuv_table
->utog
= &(yuv_table
->utog_tab
[128]);
29 yuv_table
->utob
= &(yuv_table
->utob_tab
[128]);
30 for(i
= -128; i
< 128; i
++)
33 yuv_table
->vtor
[i
] = (long)( 1.4020 * 65536 * i
);
34 yuv_table
->vtog
[i
] = (long)(-0.7141 * 65536 * i
);
36 yuv_table
->utog
[i
] = (long)(-0.3441 * 65536 * i
);
37 yuv_table
->utob
[i
] = (long)( 1.7720 * 65536 * i
);
41 void quicktime_delete_yuv(quicktime_yuv_t
*yuv_table
)
46 quicktime_scaletable_t
* quicktime_new_scaletable(int input_w
, int input_h
, int output_w
, int output_h
)
48 quicktime_scaletable_t
*result
= (quicktime_scaletable_t
*)malloc(sizeof(quicktime_scaletable_t
));
50 float scalex
= (float)input_w
/ output_w
, scaley
= (float)input_h
/ output_h
;
52 result
->input_x
= (int*)malloc(sizeof(int) * output_w
);
53 result
->input_y
= (int*)malloc(sizeof(int) * output_h
);
55 for(i
= 0; i
< output_w
; i
++)
57 result
->input_x
[(int)i
] = (int)(scalex
* i
);
60 for(i
= 0; i
< output_h
; i
++)
62 result
->input_y
[(int)i
] = (int)(scaley
* i
);
65 result
->in_w
= input_w
;
66 result
->in_h
= input_h
;
67 result
->out_w
= output_w
;
68 result
->out_h
= output_h
;
72 void quicktime_delete_scaletable(quicktime_scaletable_t
*scaletable
)
74 free(scaletable
->input_x
);
75 free(scaletable
->input_y
);
79 /* Return 1 if dimensions are different from scaletable */
80 int quicktime_compare_scaletable(quicktime_scaletable_t
*scaletable
,
86 if(scaletable
->in_w
!= in_w
||
87 scaletable
->in_h
!= in_h
||
88 scaletable
->out_w
!= out_w
||
89 scaletable
->out_h
!= out_h
)
95 /* Return 1 if the scaletable is 1:1 */
96 int quicktime_identity_scaletable(quicktime_scaletable_t
*scaletable
)
98 if(scaletable
->in_w
== scaletable
->out_w
&&
99 scaletable
->in_h
== scaletable
->out_h
)