1 |
|
#include "../xvid.h" |
2 |
|
#include "../image/image.h" |
3 |
|
#include "../quant/adapt_quant.h" |
4 |
|
|
5 |
|
int xvid_plugin_lumimasking(void * handle, int opt, void * param1, void * param2) |
6 |
|
{ |
7 |
|
switch(opt) |
8 |
|
{ |
9 |
|
case XVID_PLG_INFO : |
10 |
|
{ |
11 |
|
xvid_plg_info_t * info = (xvid_plg_info_t*)param1; |
12 |
|
info->flags = XVID_REQDQUANTS; |
13 |
|
return 0; |
14 |
|
} |
15 |
|
|
16 |
|
case XVID_PLG_CREATE : |
17 |
|
case XVID_PLG_DESTROY : |
18 |
|
return 0; |
19 |
|
|
20 |
|
|
21 |
|
case XVID_PLG_BEFORE : |
22 |
|
{ |
23 |
|
xvid_plg_data_t * data = (xvid_plg_data_t*)param1; |
24 |
|
data->quant = |
25 |
|
adaptive_quantization(data->current.plane[0], data->current.stride[0], |
26 |
|
data->dquant, |
27 |
|
data->quant /* framequant*/, |
28 |
|
data->quant /* min_quant */, |
29 |
|
data->quant*2 /* max_quant */, |
30 |
|
data->mb_width, data->mb_height); |
31 |
|
|
32 |
|
return 0; |
33 |
|
} |
34 |
|
|
35 |
|
case XVID_PLG_AFTER : |
36 |
|
return 0; |
37 |
|
} |
38 |
|
|
39 |
|
return XVID_ERR_FAIL; |
40 |
|
} |
41 |
|
|
42 |
|
|
43 |
|
|
44 |
|
|