1 |
|
#include <stdio.h> |
2 |
|
|
3 |
|
#include "../xvid.h" |
4 |
|
#include "../image/image.h" |
5 |
|
|
6 |
|
|
7 |
|
int xvid_plugin_dump(void * handle, int opt, void * param1, void * param2) |
8 |
|
{ |
9 |
|
switch(opt) |
10 |
|
{ |
11 |
|
case XVID_PLG_INFO : |
12 |
|
{ |
13 |
|
xvid_plg_info_t * info = (xvid_plg_info_t*)param1; |
14 |
|
info->flags = XVID_REQORIGINAL; |
15 |
|
return 0; |
16 |
|
} |
17 |
|
|
18 |
|
case XVID_PLG_CREATE : |
19 |
|
case XVID_PLG_DESTROY : |
20 |
|
case XVID_PLG_BEFORE : |
21 |
|
return 0; |
22 |
|
|
23 |
|
case XVID_PLG_AFTER : |
24 |
|
{ |
25 |
|
xvid_plg_data_t * data = (xvid_plg_data_t*)param1; |
26 |
|
IMAGE img; |
27 |
|
char tmp[100]; |
28 |
|
img.y = data->original.plane[0]; |
29 |
|
img.u = data->original.plane[1]; |
30 |
|
img.v = data->original.plane[2]; |
31 |
|
sprintf(tmp, "ori-%03i.pgm", data->frame_num); |
32 |
|
image_dump_yuvpgm(&img, data->original.stride[0], data->width, data->height, tmp); |
33 |
|
|
34 |
|
img.y = data->current.plane[0]; |
35 |
|
img.u = data->current.plane[1]; |
36 |
|
img.v = data->current.plane[2]; |
37 |
|
sprintf(tmp, "enc-%03i.pgm", data->frame_num); |
38 |
|
image_dump_yuvpgm(&img, data->reference.stride[0], data->width, data->height, tmp); |
39 |
|
} |
40 |
|
|
41 |
|
return 0; |
42 |
|
} |
43 |
|
|
44 |
|
return XVID_ERR_FAIL; |
45 |
|
} |