Trivial change to add crude timing information for encoding section
Change-Id: I84e07c2f1240b95d5de083df06eb3d581bfb9b68
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
#define VPX_CODEC_DISABLE_COMPAT 1
|
#define VPX_CODEC_DISABLE_COMPAT 1
|
||||||
#include "vpx/vpx_encoder.h"
|
#include "vpx/vpx_encoder.h"
|
||||||
#include "vpx/vp8cx.h"
|
#include "vpx/vp8cx.h"
|
||||||
@@ -137,6 +138,8 @@ int main(int argc, char **argv) {
|
|||||||
int layer_flags[VPX_TS_MAX_PERIODICITY] = {0};
|
int layer_flags[VPX_TS_MAX_PERIODICITY] = {0};
|
||||||
int flag_periodicity;
|
int flag_periodicity;
|
||||||
int max_intra_size_pct;
|
int max_intra_size_pct;
|
||||||
|
clock_t before;
|
||||||
|
clock_t after;
|
||||||
|
|
||||||
/* Check usage and arguments */
|
/* Check usage and arguments */
|
||||||
if (argc < 9)
|
if (argc < 9)
|
||||||
@@ -639,6 +642,7 @@ int main(int argc, char **argv) {
|
|||||||
vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT,
|
vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT,
|
||||||
max_intra_size_pct);
|
max_intra_size_pct);
|
||||||
|
|
||||||
|
before = clock();
|
||||||
frame_avail = 1;
|
frame_avail = 1;
|
||||||
while (frame_avail || got_data) {
|
while (frame_avail || got_data) {
|
||||||
vpx_codec_iter_t iter = NULL;
|
vpx_codec_iter_t iter = NULL;
|
||||||
@@ -660,8 +664,8 @@ int main(int argc, char **argv) {
|
|||||||
got_data = 1;
|
got_data = 1;
|
||||||
switch (pkt->kind) {
|
switch (pkt->kind) {
|
||||||
case VPX_CODEC_CX_FRAME_PKT:
|
case VPX_CODEC_CX_FRAME_PKT:
|
||||||
for (i=cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
|
for (i = cfg.ts_layer_id[frame_cnt % cfg.ts_periodicity];
|
||||||
i<cfg.ts_number_layers; i++)
|
i < cfg.ts_number_layers; i++)
|
||||||
{
|
{
|
||||||
write_ivf_frame_header(outfile[i], pkt);
|
write_ivf_frame_header(outfile[i], pkt);
|
||||||
(void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
|
(void) fwrite(pkt->data.frame.buf, 1, pkt->data.frame.sz,
|
||||||
@@ -676,9 +680,13 @@ int main(int argc, char **argv) {
|
|||||||
frame_cnt++;
|
frame_cnt++;
|
||||||
pts += frame_duration;
|
pts += frame_duration;
|
||||||
}
|
}
|
||||||
|
after = clock();
|
||||||
|
|
||||||
|
printf("Processed %d frames in %ld ms.\n", frame_cnt-1,
|
||||||
|
(int) (after - before) / (CLOCKS_PER_SEC / 1000));
|
||||||
|
|
||||||
fclose (infile);
|
fclose (infile);
|
||||||
|
|
||||||
printf ("Processed %d frames.\n",frame_cnt-1);
|
|
||||||
if (vpx_codec_destroy(&codec))
|
if (vpx_codec_destroy(&codec))
|
||||||
die_codec (&codec, "Failed to destroy codec");
|
die_codec (&codec, "Failed to destroy codec");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user