diff --git a/README.md b/README.md
index 9608c0fd..7b5b67f8 100644
--- a/README.md
+++ b/README.md
@@ -11,6 +11,21 @@ http://ultravideo.cs.tut.fi/#encoder for more information.
Currently most of the features are turned on/off from the code on compile time, but they are
meant to be user configurable later.
+ Usage:
+ hevc_encoder -i -w -h -o
+ Optional parameters:
+ -n, --frames : number of frames to decode
+ -q, --qp : Quantization Parameter, default 32
+ -p, --period : Period of intra pictures, default 0
+ 0: only first picture is intra
+ 1: all pictures are intra
+ 2-N: every Nth picture is intra
+ --no-deblock : Disable deblocking filter
+ --deblock : Deblocking filter parameters
+ --no-sao : Disable sample adaptive offset
+
+Example:
+
kvazaar -i -w -h -o -n -q
eg. `kvazaar -i BQMall_832x480_60.yuv -w 832 -h 480 -o out.bin -n 600 -q 32`
diff --git a/src/encmain.c b/src/encmain.c
index e86a5d1a..ac47ca9a 100644
--- a/src/encmain.c
+++ b/src/encmain.c
@@ -20,13 +20,6 @@
/*
* \file
*
- * TODO: Check that these usage instructions are correct.
- * \subsection options_subsec All program options:
- * - -i : input
- * - -o : output
- * - -w : frame width
- * - -h : frame height
- * - -n : encode only n frames
*/
#ifdef _WIN32
@@ -74,11 +67,12 @@ int main(int argc, char *argv[])
FILE *recout = fopen("encrec_832x480_60.yuv","wb"); //!< reconstructed YUV output (only on debug mode)
#endif
- // Windows needs all of the standard in/outputs to be set to _O_BINARY
+ // Stdin and stdout need to be binary for input and output to work.
+ // Stderr needs to be text mode to convert \n to \r\n in Windows.
#ifdef _WIN32
_setmode( _fileno( stdin ), _O_BINARY );
_setmode( _fileno( stdout ), _O_BINARY );
- _setmode( _fileno( stderr ), _O_BINARY );
+ _setmode( _fileno( stderr ), _O_TEXT );
#endif
// Handle configuration
@@ -86,23 +80,25 @@ int main(int argc, char *argv[])
// If problem with configuration, print banner and shutdown
if (!cfg || !config_init(cfg) || !config_read(cfg,argc,argv)) {
- fprintf(stderr, "/***********************************************/\r\n");
- fprintf(stderr, " * Kvazaar HEVC Encoder v. " VERSION_STRING "*\r\n");
- fprintf(stderr, " * Tampere University of Technology 2014 *\r\n");
- fprintf(stderr, "/***********************************************/\r\n\r\n");
+ fprintf(stderr,
+ "/***********************************************/\n"
+ " * Kvazaar HEVC Encoder v. " VERSION_STRING "*\n"
+ " * Tampere University of Technology 2014 *\n"
+ "/***********************************************/\n\n");
- fprintf(stderr, "Usage:\r\n");
- fprintf(stderr, "hevc_encoder -i -w -h -o \r\n");
- fprintf(stderr, "Optional parameters:\r\n");
- fprintf(stderr, " -n, --frames : number of frames to decode\r\n");
- fprintf(stderr, " -q, --qp : Quantization Parameter, default 32\r\n");
- fprintf(stderr, " -p, --period : Period of intra pictures, default 0\r\n");
- fprintf(stderr, " 0: only first picture is intra\r\n");
- fprintf(stderr, " 1: all pictures are intra\r\n");
- fprintf(stderr, " 2-N: every Nth picture is intra\r\n");
- fprintf(stderr, " --no-deblock : Disable deblocking filter\r\n");
- fprintf(stderr, " --deblock : Deblocking filter parameters\r\n");
- fprintf(stderr, " --no-sao : Disable sample adaptive offset\r\n");
+ fprintf(stderr,
+ "Usage:\n"
+ "hevc_encoder -i -w -h -o \n"
+ "Optional parameters:\n"
+ " -n, --frames : number of frames to decode\n"
+ " -q, --qp : Quantization Parameter, default 32\n"
+ " -p, --period : Period of intra pictures, default 0\n"
+ " 0: only first picture is intra\n"
+ " 1: all pictures are intra\n"
+ " 2-N: every Nth picture is intra\n"
+ " --no-deblock : Disable deblocking filter\n"
+ " --deblock : Deblocking filter parameters\n"
+ " --no-sao : Disable sample adaptive offset\n");
if (cfg)
config_destroy(cfg);
diff --git a/src/global.h b/src/global.h
index 41a18110..385a3f92 100644
--- a/src/global.h
+++ b/src/global.h
@@ -108,7 +108,7 @@ typedef int16_t coefficient;
//#define SIGN3(x) ((x) > 0) ? +1 : ((x) == 0 ? 0 : -1)
#define SIGN3(x) (((x) > 0) - ((x) < 0))
-#define VERSION_STRING "0.2 "
+#define VERSION_STRING "0.2.3 "
#define VERSION 0.2
//#define VERBOSE 1