[cvs] / xvidcore / src / plugins / plugin_dump.c Repository:
ViewVC logotype

Annotation of /xvidcore/src/plugins/plugin_dump.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.2.3 - (view) (download)

1 : edgomez 1.1.2.3 /*****************************************************************************
2 :     *
3 :     * XVID MPEG-4 VIDEO CODEC
4 :     * - XviD plugin: dump pgm files of original and encoded frames -
5 :     *
6 :     * Copyright(C) 2003 Peter Ross <pross@xvid.org>
7 :     *
8 :     * This program is free software ; you can redistribute it and/or modify
9 :     * it under the terms of the GNU General Public License as published by
10 :     * the Free Software Foundation ; either version 2 of the License, or
11 :     * (at your option) any later version.
12 :     *
13 :     * This program is distributed in the hope that it will be useful,
14 :     * but WITHOUT ANY WARRANTY ; without even the implied warranty of
15 :     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 :     * GNU General Public License for more details.
17 :     *
18 :     * You should have received a copy of the GNU General Public License
19 :     * along with this program ; if not, write to the Free Software
20 :     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 :     *
22 :     * $Id$
23 :     *
24 :     ****************************************************************************/
25 :    
26 : edgomez 1.1.2.2 #include <stdio.h>
27 :    
28 : suxen_drol 1.1.2.1 #include "../xvid.h"
29 :     #include "../image/image.h"
30 :    
31 :    
32 :     int xvid_plugin_dump(void * handle, int opt, void * param1, void * param2)
33 :     {
34 :     switch(opt)
35 :     {
36 :     case XVID_PLG_INFO :
37 :     {
38 :     xvid_plg_info_t * info = (xvid_plg_info_t*)param1;
39 :     info->flags = XVID_REQORIGINAL;
40 :     return 0;
41 :     }
42 :    
43 :     case XVID_PLG_CREATE :
44 :     case XVID_PLG_DESTROY :
45 :     case XVID_PLG_BEFORE :
46 :     return 0;
47 :    
48 :     case XVID_PLG_AFTER :
49 :     {
50 :     xvid_plg_data_t * data = (xvid_plg_data_t*)param1;
51 :     IMAGE img;
52 :     char tmp[100];
53 :     img.y = data->original.plane[0];
54 :     img.u = data->original.plane[1];
55 :     img.v = data->original.plane[2];
56 :     sprintf(tmp, "ori-%03i.pgm", data->frame_num);
57 :     image_dump_yuvpgm(&img, data->original.stride[0], data->width, data->height, tmp);
58 :    
59 :     img.y = data->current.plane[0];
60 :     img.u = data->current.plane[1];
61 :     img.v = data->current.plane[2];
62 :     sprintf(tmp, "enc-%03i.pgm", data->frame_num);
63 :     image_dump_yuvpgm(&img, data->reference.stride[0], data->width, data->height, tmp);
64 :     }
65 :    
66 :     return 0;
67 :     }
68 :    
69 :     return XVID_ERR_FAIL;
70 :     }

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4