[svn] / branches / dev-api-4 / xvidcore / examples / xvid_encraw.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/examples/xvid_encraw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 923, Sat Mar 15 16:41:32 2003 UTC revision 926, Sun Mar 16 12:05:09 2003 UTC
# Line 19  Line 19 
19   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: xvid_encraw.c,v 1.11.2.7 2003-03-15 16:41:32 suxen_drol Exp $   * $Id: xvid_encraw.c,v 1.11.2.8 2003-03-16 12:04:13 suxen_drol Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 87  Line 87 
87    
88  static int   ARG_STATS = 0;  static int   ARG_STATS = 0;
89  static int   ARG_DUMP = 0;  static int   ARG_DUMP = 0;
90    static int   ARG_LUMIMASKING = 0;
91  static int   ARG_BITRATE = 900;  static int   ARG_BITRATE = 900;
92  static int   ARG_QUANTI = 0;  static int   ARG_QUANTI = 0;
93  static int   ARG_QUALITY = 5;  static int   ARG_QUALITY = 5;
# Line 238  Line 239 
239                  else if (strcmp("-dump", argv[i]) == 0) {                  else if (strcmp("-dump", argv[i]) == 0) {
240                          ARG_DUMP = 1;                          ARG_DUMP = 1;
241                  }                  }
242                    else if (strcmp("-lumimasking", argv[i]) == 0) {
243                            ARG_LUMIMASKING = 1;
244                    }
245                  else if (strcmp("-t", argv[i]) == 0 && i < argc - 1 ) {                  else if (strcmp("-t", argv[i]) == 0 && i < argc - 1 ) {
246                          i++;                          i++;
247                          ARG_INPUTTYPE = atoi(argv[i]);                          ARG_INPUTTYPE = atoi(argv[i]);
# Line 480  Line 484 
484   *         Calculate totals and averages for output, print results   *         Calculate totals and averages for output, print results
485   ****************************************************************************/   ****************************************************************************/
486    
487            printf("Tot: enctime(ms) =%7.2f,               length(bytes) = %7d\n",
488                       totalenctime, (int)totalsize);
489    
490      if (input_num > 0) {      if (input_num > 0) {
491              totalsize    /= input_num;              totalsize    /= input_num;
492              totalenctime /= input_num;              totalenctime /= input_num;
# Line 659  Line 666 
666      switch(opt)      switch(opt)
667      {      {
668      case XVID_PLG_INFO :      case XVID_PLG_INFO :
669            {
670            xvid_plg_info_t * info = (xvid_plg_info_t*)param1;
671            info->flags = XVID_REQDQUANTS;
672            return 0;
673            }
674    
675      case XVID_PLG_CREATE :      case XVID_PLG_CREATE :
676      case XVID_PLG_DESTROY :      case XVID_PLG_DESTROY :
677      case XVID_PLG_BEFORE :      case XVID_PLG_BEFORE :
# Line 667  Line 680 
680      case XVID_PLG_AFTER :      case XVID_PLG_AFTER :
681         {         {
682         xvid_plg_data_t * data = (xvid_plg_data_t*)param1;         xvid_plg_data_t * data = (xvid_plg_data_t*)param1;
683         printf("type=%i, quant=%i, length=%i\n", data->type, data->quant, data->length);          int i,j;
684    
685            printf("---[ frame: %5i   quant: %2i   length: %6i ]---\n", data->frame_num, data->quant, data->length);
686            for (j=0; j<data->mb_height; j++) {
687                for (i = 0; i<data->mb_width; i++)
688                    printf("%2i ",  data->dquant[j*data->dquant_stride + i]);
689                printf("\n");
690            }
691    
692         return 0;         return 0;
693         }         }
694      }      }
# Line 683  Line 704 
704  {  {
705          int xerr;          int xerr;
706    
707      xvid_enc_plugin_t plugins[1];      xvid_enc_plugin_t plugins[2];
708    
709          xvid_gbl_init_t   xvid_gbl_init;          xvid_gbl_init_t   xvid_gbl_init;
710          xvid_enc_create_t xvid_enc_create;          xvid_enc_create_t xvid_enc_create;
# Line 729  Line 750 
750    
751      xvid_enc_create.plugins = plugins;      xvid_enc_create.plugins = plugins;
752      xvid_enc_create.num_plugins = 0;      xvid_enc_create.num_plugins = 0;
753    
754        if (ARG_LUMIMASKING) {
755            plugins[xvid_enc_create.num_plugins].func = xvid_plugin_lumimasking;
756            plugins[xvid_enc_create.num_plugins].param = NULL;
757            xvid_enc_create.num_plugins++;
758        }
759    
760      if (ARG_DUMP) {      if (ARG_DUMP) {
761          plugins[xvid_enc_create.num_plugins].func = xvid_plugin_dump;          plugins[xvid_enc_create.num_plugins].func = xvid_plugin_dump;
762          plugins[xvid_enc_create.num_plugins].param = NULL;          plugins[xvid_enc_create.num_plugins].param = NULL;
763          xvid_enc_create.num_plugins++;          xvid_enc_create.num_plugins++;
764      }      }
765    
766    /*   plugins[xvid_enc_create.num_plugins].func = rawenc_debug;
767         plugins[xvid_enc_create.num_plugins].param = NULL;
768         xvid_enc_create.num_plugins++; */
769    
770          /* No fancy thread tests */          /* No fancy thread tests */
771          xvid_enc_create.num_threads = 0;          xvid_enc_create.num_threads = 0;
772    
# Line 827  Line 859 
859    
860          /* Force the right quantizer */          /* Force the right quantizer */
861          xvid_enc_frame.quant  = ARG_QUANTI;          xvid_enc_frame.quant  = ARG_QUANTI;
         xvid_enc_frame.bquant = 0;  
862    
863          /* Set up motion estimation flags */          /* Set up motion estimation flags */
864          xvid_enc_frame.motion = motion_presets[ARG_QUALITY];          xvid_enc_frame.motion = motion_presets[ARG_QUALITY];

Legend:
Removed from v.923  
changed lines
  Added in v.926

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