Commit f2378498 authored by James Zern's avatar James Zern Committed by Gerrit Code Review

Merge changes from topic 'missing-proto'

* changes:
  vpxenc: make some functions static
  vpxdec: make some functions static
  tools_common.h: fix get_vpx_decoder_count() proto
  tools_common.h: fix get_vpx_encoder_count() proto
  tools_common.h: fix usage_exit() prototype
parents 73de6ad5 5c337fd0
......@@ -71,7 +71,7 @@ static void print_md5(FILE *stream, unsigned char digest[16]) {
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
......
......@@ -65,7 +65,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile> <N-M|N/M>\n", exec_name);
exit(EXIT_FAILURE);
}
......
......@@ -52,7 +52,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
......
......@@ -15,6 +15,7 @@
#include <stdlib.h>
#include <string.h>
#include "../tools_common.h"
#include "../vp9/encoder/vp9_resize.h"
static const char *exec_name = NULL;
......@@ -26,7 +27,7 @@ static void usage() {
printf("<output_yuv> [<frames>]\n");
}
void usage_exit() {
void usage_exit(void) {
usage();
exit(EXIT_FAILURE);
}
......
......@@ -55,7 +55,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
exec_name);
exit(EXIT_FAILURE);
......
......@@ -88,7 +88,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <infile> <outfile>\n", exec_name);
exit(EXIT_FAILURE);
}
......
......@@ -106,7 +106,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr,
"Usage: %s <codec> <width> <height> <infile> <outfile> "
"<keyframe-interval> [<error-resilient>]\nSee comments in "
......
......@@ -58,7 +58,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <codec> <width> <height> <infile> <outfile>\n",
exec_name);
exit(EXIT_FAILURE);
......
......@@ -40,11 +40,11 @@
#include "vpx/vpx_encoder.h"
#include "vpx/vp8cx.h"
#include "vpx_ports/mem_ops.h"
#include "./tools_common.h"
#include "../tools_common.h"
#define interface (vpx_codec_vp8_cx())
#define fourcc 0x30385056
void usage_exit() {
void usage_exit(void) {
exit(EXIT_FAILURE);
}
......
......@@ -58,7 +58,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile> <frame>\n",
exec_name);
exit(EXIT_FAILURE);
......
......@@ -20,7 +20,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless "
"encoding feature. Supports raw input only.\n");
fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name);
......
......@@ -116,7 +116,7 @@ typedef struct {
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
fprintf(stderr, "Usage: %s <options> input_filename output_filename\n",
exec_name);
fprintf(stderr, "Options:\n");
......
......@@ -28,7 +28,7 @@
static const char *exec_name;
void usage_exit() {
void usage_exit(void) {
exit(EXIT_FAILURE);
}
......
......@@ -140,7 +140,7 @@ static const VpxInterface vpx_encoders[] = {
#endif
};
int get_vpx_encoder_count() {
int get_vpx_encoder_count(void) {
return sizeof(vpx_encoders) / sizeof(vpx_encoders[0]);
}
......@@ -170,7 +170,7 @@ static const VpxInterface vpx_decoders[] = {
#endif
};
int get_vpx_decoder_count() {
int get_vpx_decoder_count(void) {
return sizeof(vpx_decoders) / sizeof(vpx_decoders[0]);
}
......
......@@ -119,7 +119,7 @@ void warn(const char *fmt, ...);
void die_codec(vpx_codec_ctx_t *ctx, const char *s) VPX_NO_RETURN;
/* The tool including this file must define usage_exit() */
void usage_exit() VPX_NO_RETURN;
void usage_exit(void) VPX_NO_RETURN;
#undef VPX_NO_RETURN
......@@ -131,11 +131,11 @@ typedef struct VpxInterface {
vpx_codec_iface_t *(*const codec_interface)();
} VpxInterface;
int get_vpx_encoder_count();
int get_vpx_encoder_count(void);
const VpxInterface *get_vpx_encoder_by_index(int i);
const VpxInterface *get_vpx_encoder_by_name(const char *name);
int get_vpx_decoder_count();
int get_vpx_decoder_count(void);
const VpxInterface *get_vpx_decoder_by_index(int i);
const VpxInterface *get_vpx_decoder_by_name(const char *name);
const VpxInterface *get_vpx_decoder_by_fourcc(uint32_t fourcc);
......
......@@ -169,7 +169,7 @@ static INLINE int libyuv_scale(vpx_image_t *src, vpx_image_t *dst,
}
#endif
void usage_exit() {
void usage_exit(void) {
int i;
fprintf(stderr, "Usage: %s <options> filename\n\n"
......@@ -312,7 +312,7 @@ static void write_image_file(const vpx_image_t *img, const int planes[3],
}
}
int file_is_raw(struct VpxInputContext *input) {
static int file_is_raw(struct VpxInputContext *input) {
uint8_t buf[32];
int is_raw = 0;
vpx_codec_stream_info_t si;
......@@ -343,7 +343,7 @@ int file_is_raw(struct VpxInputContext *input) {
return is_raw;
}
void show_progress(int frame_in, int frame_out, uint64_t dx_time) {
static void show_progress(int frame_in, int frame_out, uint64_t dx_time) {
fprintf(stderr,
"%d decoded frames/%d showed frames in %"PRId64" us (%.2f fps)\r",
frame_in, frame_out, dx_time,
......@@ -365,8 +365,8 @@ struct ExternalFrameBufferList {
// Application private data passed into the set function. |min_size| is the
// minimum size in bytes needed to decode the next frame. |fb| pointer to the
// frame buffer.
int get_vp9_frame_buffer(void *cb_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
static int get_vp9_frame_buffer(void *cb_priv, size_t min_size,
vpx_codec_frame_buffer_t *fb) {
int i;
struct ExternalFrameBufferList *const ext_fb_list =
(struct ExternalFrameBufferList *)cb_priv;
......@@ -403,8 +403,8 @@ int get_vp9_frame_buffer(void *cb_priv, size_t min_size,
// Callback used by libvpx when there are no references to the frame buffer.
// |cb_priv| user private data passed into the set function. |fb| pointer
// to the frame buffer.
int release_vp9_frame_buffer(void *cb_priv,
vpx_codec_frame_buffer_t *fb) {
static int release_vp9_frame_buffer(void *cb_priv,
vpx_codec_frame_buffer_t *fb) {
struct ExternalFrameBuffer *const ext_fb =
(struct ExternalFrameBuffer *)fb->priv;
(void)cb_priv;
......@@ -412,9 +412,9 @@ int release_vp9_frame_buffer(void *cb_priv,
return 0;
}
void generate_filename(const char *pattern, char *out, size_t q_len,
unsigned int d_w, unsigned int d_h,
unsigned int frame_in) {
static void generate_filename(const char *pattern, char *out, size_t q_len,
unsigned int d_w, unsigned int d_h,
unsigned int frame_in) {
const char *p = pattern;
char *q = out;
......@@ -536,7 +536,7 @@ static int img_shifted_realloc_required(const vpx_image_t *img,
}
#endif
int main_loop(int argc, const char **argv_) {
static int main_loop(int argc, const char **argv_) {
vpx_codec_ctx_t decoder;
char *fn = NULL;
int i;
......
......@@ -99,7 +99,7 @@ static void warn_or_exit_on_error(vpx_codec_ctx_t *ctx, int fatal,
va_end(ap);
}
int read_frame(struct VpxInputContext *input_ctx, vpx_image_t *img) {
static int read_frame(struct VpxInputContext *input_ctx, vpx_image_t *img) {
FILE *f = input_ctx->file;
y4m_input *y4m = &input_ctx->y4m;
int shortread = 0;
......@@ -114,14 +114,14 @@ int read_frame(struct VpxInputContext *input_ctx, vpx_image_t *img) {
return !shortread;
}
int file_is_y4m(const char detect[4]) {
static int file_is_y4m(const char detect[4]) {
if (memcmp(detect, "YUV4", 4) == 0) {
return 1;
}
return 0;
}
int fourcc_is_ivf(const char detect[4]) {
static int fourcc_is_ivf(const char detect[4]) {
if (memcmp(detect, "DKIF", 4) == 0) {
return 1;
}
......@@ -467,7 +467,7 @@ static const int vp9_arg_ctrl_map[] = {
static const arg_def_t *no_args[] = { NULL };
void usage_exit() {
void usage_exit(void) {
int i;
fprintf(stderr, "Usage: %s <options> -o dst_filename src_filename \n",
......@@ -793,8 +793,8 @@ struct stream_state {
};
void validate_positive_rational(const char *msg,
struct vpx_rational *rat) {
static void validate_positive_rational(const char *msg,
struct vpx_rational *rat) {
if (rat->den < 0) {
rat->num *= -1;
rat->den *= -1;
......@@ -919,7 +919,7 @@ static void parse_global_config(struct VpxEncoderConfig *global, char **argv) {
}
void open_input_file(struct VpxInputContext *input) {
static void open_input_file(struct VpxInputContext *input) {
/* Parse certain options from the input file, if possible */
input->file = strcmp(input->filename, "-")
? fopen(input->filename, "rb") : set_binary_mode(stdin);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment