20 |
* along with this program; if not, write to the Free Software |
* along with this program; if not, write to the Free Software |
21 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
22 |
* |
* |
23 |
* $Id: xvid_decraw.c,v 1.27 2010-03-09 09:20:05 Isibaar Exp $ |
* $Id: xvid_decraw.c,v 1.28 2010-12-18 10:17:35 Isibaar Exp $ |
24 |
* |
* |
25 |
****************************************************************************/ |
****************************************************************************/ |
26 |
|
|
67 |
static int BPP = 1; |
static int BPP = 1; |
68 |
static int FORMAT = USE_PNM; |
static int FORMAT = USE_PNM; |
69 |
static int POSTPROC = 0; |
static int POSTPROC = 0; |
70 |
|
static int ARG_THREADS = 0; |
71 |
|
|
72 |
static char filepath[256] = "./"; |
static char filepath[256] = "./"; |
73 |
static void *dec_handle = NULL; |
static void *dec_handle = NULL; |
188 |
} else { |
} else { |
189 |
FORMAT = USE_PNM; |
FORMAT = USE_PNM; |
190 |
} |
} |
191 |
|
} else if (strcmp("-threads", argv[i]) == 0 && i < argc -1) { |
192 |
|
i++; |
193 |
|
ARG_THREADS = atoi(argv[i]); |
194 |
} else if (strcmp("-help", argv[i]) == 0) { |
} else if (strcmp("-help", argv[i]) == 0) { |
195 |
usage(); |
usage(); |
196 |
return(0); |
return(0); |
494 |
fprintf(stderr, " -c csp : choose colorspace output (rgb16, rgb24, rgb32, yv12, i420)\n"); |
fprintf(stderr, " -c csp : choose colorspace output (rgb16, rgb24, rgb32, yv12, i420)\n"); |
495 |
fprintf(stderr, " -f format : choose output file format (tga, pnm, pgm, yuv)\n"); |
fprintf(stderr, " -f format : choose output file format (tga, pnm, pgm, yuv)\n"); |
496 |
fprintf(stderr, " -postproc : postprocessing level (0=off, 1=deblock, 2=deblock+dering)\n"); |
fprintf(stderr, " -postproc : postprocessing level (0=off, 1=deblock, 2=deblock+dering)\n"); |
497 |
|
fprintf(stderr, " -threads int : number of threads\n"); |
498 |
fprintf(stderr, " -m : save mpeg4 raw stream to individual files\n"); |
fprintf(stderr, " -m : save mpeg4 raw stream to individual files\n"); |
499 |
fprintf(stderr, " -help : This help message\n"); |
fprintf(stderr, " -help : This help message\n"); |
500 |
fprintf(stderr, " (* means default)\n"); |
fprintf(stderr, " (* means default)\n"); |
713 |
|
|
714 |
xvid_gbl_init_t xvid_gbl_init; |
xvid_gbl_init_t xvid_gbl_init; |
715 |
xvid_dec_create_t xvid_dec_create; |
xvid_dec_create_t xvid_dec_create; |
716 |
|
xvid_gbl_info_t xvid_gbl_info; |
717 |
|
|
718 |
/* Reset the structure with zeros */ |
/* Reset the structure with zeros */ |
719 |
memset(&xvid_gbl_init, 0, sizeof(xvid_gbl_init_t)); |
memset(&xvid_gbl_init, 0, sizeof(xvid_gbl_init_t)); |
720 |
memset(&xvid_dec_create, 0, sizeof(xvid_dec_create_t)); |
memset(&xvid_dec_create, 0, sizeof(xvid_dec_create_t)); |
721 |
|
memset(&xvid_gbl_info, 0, sizeof(xvid_gbl_info)); |
722 |
|
|
723 |
/*------------------------------------------------------------------------ |
/*------------------------------------------------------------------------ |
724 |
* Xvid core initialization |
* Xvid core initialization |
725 |
*----------------------------------------------------------------------*/ |
*----------------------------------------------------------------------*/ |
726 |
|
|
727 |
|
xvid_gbl_info.version = XVID_VERSION; |
728 |
|
xvid_global(NULL, XVID_GBL_INFO, &xvid_gbl_info, NULL); |
729 |
|
|
730 |
|
if (xvid_gbl_info.build != NULL) { |
731 |
|
fprintf(stderr, "xvidcore build version: %s\n", xvid_gbl_info.build); |
732 |
|
} |
733 |
|
fprintf(stderr, "Bitstream version: %d.%d.%d\n", XVID_VERSION_MAJOR(xvid_gbl_info.actual_version), XVID_VERSION_MINOR(xvid_gbl_info.actual_version), XVID_VERSION_PATCH(xvid_gbl_info.actual_version)); |
734 |
|
fprintf(stderr, "Detected CPU flags: "); |
735 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_ASM) |
736 |
|
fprintf(stderr, "ASM "); |
737 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_MMX) |
738 |
|
fprintf(stderr, "MMX "); |
739 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_MMXEXT) |
740 |
|
fprintf(stderr, "MMXEXT "); |
741 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_SSE) |
742 |
|
fprintf(stderr, "SSE "); |
743 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_SSE2) |
744 |
|
fprintf(stderr, "SSE2 "); |
745 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_SSE3) |
746 |
|
fprintf(stderr, "SSE3 "); |
747 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_SSE41) |
748 |
|
fprintf(stderr, "SSE41 "); |
749 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_3DNOW) |
750 |
|
fprintf(stderr, "3DNOW "); |
751 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_3DNOWEXT) |
752 |
|
fprintf(stderr, "3DNOWEXT "); |
753 |
|
if (xvid_gbl_info.cpu_flags & XVID_CPU_TSC) |
754 |
|
fprintf(stderr, "TSC "); |
755 |
|
fprintf(stderr, "\n"); |
756 |
|
fprintf(stderr, "Detected %d cpus,", xvid_gbl_info.num_threads); |
757 |
|
if (!ARG_THREADS) ARG_THREADS = xvid_gbl_info.num_threads; |
758 |
|
fprintf(stderr, " using %d threads.\n", ARG_THREADS); |
759 |
|
|
760 |
/* Version */ |
/* Version */ |
761 |
xvid_gbl_init.version = XVID_VERSION; |
xvid_gbl_init.version = XVID_VERSION; |
762 |
|
|
788 |
xvid_dec_create.width = 0; |
xvid_dec_create.width = 0; |
789 |
xvid_dec_create.height = 0; |
xvid_dec_create.height = 0; |
790 |
|
|
791 |
|
xvid_dec_create.num_threads = ARG_THREADS; |
792 |
|
|
793 |
ret = xvid_decore(NULL, XVID_DEC_CREATE, &xvid_dec_create, NULL); |
ret = xvid_decore(NULL, XVID_DEC_CREATE, &xvid_dec_create, NULL); |
794 |
|
|
795 |
dec_handle = xvid_dec_create.handle; |
dec_handle = xvid_dec_create.handle; |