[x265] [PATCH 5 of 5] api: introduce an x265_picture_init() function

Steve Borho steve at borho.org
Thu Sep 19 04:04:29 CEST 2013


# HG changeset patch
# User Steve Borho <steve at borho.org>
# Date 1379556186 18000
#      Wed Sep 18 21:03:06 2013 -0500
# Node ID 15b6741e3640355ec8868b0dfd6850f82f642c8d
# Parent  2a7b627a4ce910474e36720a9bf5cc3ef233f4fb
api: introduce an x265_picture_init() function

diff -r 2a7b627a4ce9 -r 15b6741e3640 source/common/common.cpp
--- a/source/common/common.cpp	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/common/common.cpp	Wed Sep 18 21:03:06 2013 -0500
@@ -179,6 +179,13 @@
 }
 
 extern "C"
+void x265_picture_init(x265_param_t *param, x265_picture_t *pic)
+{
+    memset(pic, 0, sizeof(x265_picture_t));
+    pic->bitDepth = param->internalBitDepth;
+}
+
+extern "C"
 int x265_param_apply_profile(x265_param_t *param, const char *profile)
 {
     if (!profile)
diff -r 2a7b627a4ce9 -r 15b6741e3640 source/x265.cpp
--- a/source/x265.cpp	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/x265.cpp	Wed Sep 18 21:03:06 2013 -0500
@@ -518,8 +518,7 @@
         cliopt.writeNALs(p_nal, nal);
     }
 
-    pic_orig.sliceType = X265_TYPE_AUTO;
-    pic_orig.userData = NULL;
+    x265_picture_init(&param, pic_in);
 
     // main encoder loop
     uint32_t inFrameCount = 0;
diff -r 2a7b627a4ce9 -r 15b6741e3640 source/x265.h
--- a/source/x265.h	Wed Sep 18 21:03:06 2013 -0500
+++ b/source/x265.h	Wed Sep 18 21:03:06 2013 -0500
@@ -300,6 +300,11 @@
  */
 void x265_param_default(x265_param_t *param);
 
+/***
+ * Initialize an x265_picture_t structure to default values
+ */
+void x265_picture_init(x265_param_t *param, x265_picture_t *pic);
+
 /* x265_param_apply_profile:
  *      Applies the restrictions of the given profile. (one of below) */
 static const char * const x265_profile_names[] = { "main", "main10", "mainstillpicture", 0 };


More information about the x265-devel mailing list