Hello community,

here is the log from the commit of package libva-utils for openSUSE:Factory 
checked in at 2020-10-13 15:44:43
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libva-utils (Old)
 and      /work/SRC/openSUSE:Factory/.libva-utils.new.3486 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libva-utils"

Tue Oct 13 15:44:43 2020 rev:13 rq:841332 version:2.9.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/libva-utils/libva-utils.changes  2020-09-03 
01:14:48.112484844 +0200
+++ /work/SRC/openSUSE:Factory/.libva-utils.new.3486/libva-utils.changes        
2020-10-13 15:45:55.133456783 +0200
@@ -1,0 +2,7 @@
+Sat Oct 10 20:35:24 UTC 2020 - Dirk Mueller <[email protected]>
+
+- udpate to 2.9.0:
+  * Fix KW issues
+  * Add support for csc with RGBP
+
+-------------------------------------------------------------------

Old:
----
  libva-utils-2.8.0.tar.gz

New:
----
  libva-utils-2.9.0.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libva-utils.spec ++++++
--- /var/tmp/diff_new_pack.sEGZmK/_old  2020-10-13 15:45:56.745457479 +0200
+++ /var/tmp/diff_new_pack.sEGZmK/_new  2020-10-13 15:45:56.749457481 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           libva-utils
-Version:        2.8.0
+Version:        2.9.0
 Release:        0
 Summary:        A collection of utilities and examples to exercise VA-API
 License:        MIT AND EPL-1.0

++++++ libva-utils-2.8.0.tar.gz -> libva-utils-2.9.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/NEWS new/libva-utils-2.9.0/NEWS
--- old/libva-utils-2.8.0/NEWS  2020-06-26 01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/NEWS  2020-09-12 00:13:28.000000000 +0200
@@ -1,6 +1,10 @@
-libva-utils NEWS -- summary of changes.  2020-06-26
+libva-utils NEWS -- summary of changes.  2020-09-11
 Copyright (C) 2009-2020 Intel Corporation
 
+Version 2.9.0 - 11.Sep.2020
+* Fix KW issues
+* Add support for csc with RGBP
+
 Version 2.8.0 - 26.Jun.2020
 * test: cast VA_STATUS_ERROR_UNKNOWN to VAStatus type
 * test/fixture: fix GCC 10.0.1 error with drmDevicePaths
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/configure.ac 
new/libva-utils-2.9.0/configure.ac
--- old/libva-utils-2.8.0/configure.ac  2020-06-26 01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/configure.ac  2020-09-12 00:13:28.000000000 +0200
@@ -29,7 +29,7 @@
 # - micro version is libva_micro_version
 # - pre version is libva_pre_version, usually development version
 m4_define([libva_utils_major_version], [2])
-m4_define([libva_utils_minor_version], [8])
+m4_define([libva_utils_minor_version], [9])
 m4_define([libva_utils_micro_version], [0])
 m4_define([libva_utils_pre_version],   [0])
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/encode/hevcencode.c 
new/libva-utils-2.9.0/encode/hevcencode.c
--- old/libva-utils-2.8.0/encode/hevcencode.c   2020-06-26 01:50:07.000000000 
+0200
+++ new/libva-utils-2.9.0/encode/hevcencode.c   2020-09-12 00:13:28.000000000 
+0200
@@ -2051,7 +2051,9 @@
     }
 
     /* store coded data into a file */
-    coded_fp = fopen(coded_fn,"w+");
+    if (coded_fn) {
+        coded_fp = fopen(coded_fn,"w+");
+    }
     if (coded_fp == NULL) {
         printf("Open file %s failed, exit\n", coded_fn);
         exit(1);
@@ -2298,8 +2300,10 @@
     CHECK_VASTATUS(va_status, "vaCreateSurfaces");
 
     tmp_surfaceid = calloc(2 * SURFACE_NUM, sizeof(VASurfaceID));
-    memcpy(tmp_surfaceid, src_surface, SURFACE_NUM * sizeof(VASurfaceID));
-    memcpy(tmp_surfaceid + SURFACE_NUM, ref_surface, SURFACE_NUM * 
sizeof(VASurfaceID));
+    if (tmp_surfaceid) {
+        memcpy(tmp_surfaceid, src_surface, SURFACE_NUM * sizeof(VASurfaceID));
+        memcpy(tmp_surfaceid + SURFACE_NUM, ref_surface, SURFACE_NUM * 
sizeof(VASurfaceID));
+    }
 
     /* Create a context for this encode pipe */
     va_status = vaCreateContext(va_dpy, config_id,
@@ -3098,8 +3102,10 @@
     struct storage_task_t *tmp;
 
     tmp = calloc(1, sizeof(struct storage_task_t));
-    tmp->display_order = display_order;
-    tmp->encode_order = encode_order;
+    if (tmp) {
+        tmp->display_order = display_order;
+        tmp->encode_order = encode_order;
+    }
 
     pthread_mutex_lock(&encode_mutex);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/encode/jpegenc.c 
new/libva-utils-2.9.0/encode/jpegenc.c
--- old/libva-utils-2.8.0/encode/jpegenc.c      2020-06-26 01:50:07.000000000 
+0200
+++ new/libva-utils-2.9.0/encode/jpegenc.c      2020-09-12 00:13:28.000000000 
+0200
@@ -931,15 +931,6 @@
     yuv_type = atoi(argv[5]);
     quality = atoi(argv[6]);
     
-    yuv_fp = fopen(argv[3],"rb");
-    if ( yuv_fp == NULL){
-        printf("Can't open input YUV file\n");
-        return -1;
-    }
-    
-    fseeko(yuv_fp, (off_t)0, SEEK_END);
-    file_size = ftello(yuv_fp);
-    
     //<input file type: 0(I420)/1(NV12)/2(UYVY)/3(YUY2)/4(Y8)/5(RGBA)>
     switch(yuv_type)
     {
@@ -970,8 +961,16 @@
             show_help();
             return -1;
         }
-        
     }
+
+    yuv_fp = fopen(argv[3],"rb");
+    if ( yuv_fp == NULL){
+        printf("Can't open input YUV file\n");
+        return -1;
+    }
+
+    fseeko(yuv_fp, (off_t)0, SEEK_END);
+    file_size = ftello(yuv_fp);
     
     if ( (file_size < frame_size) || (file_size % frame_size) ) {
         fclose(yuv_fp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/encode/mpeg2vaenc.c 
new/libva-utils-2.9.0/encode/mpeg2vaenc.c
--- old/libva-utils-2.8.0/encode/mpeg2vaenc.c   2020-06-26 01:50:07.000000000 
+0200
+++ new/libva-utils-2.9.0/encode/mpeg2vaenc.c   2020-09-12 00:13:28.000000000 
+0200
@@ -1533,7 +1533,9 @@
     gettimeofday(&tpstart, NULL);
 
     memset(&ctx, 0, sizeof(ctx));
-    parse_args(&ctx, argc, argv);
+    if (argv) {
+        parse_args(&ctx, argc, argv);
+    }
     mpeg2enc_init(&ctx);
     mpeg2enc_run(&ctx);
     mpeg2enc_end(&ctx);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/encode/vp8enc.c 
new/libva-utils-2.9.0/encode/vp8enc.c
--- old/libva-utils-2.8.0/encode/vp8enc.c       2020-06-26 01:50:07.000000000 
+0200
+++ new/libva-utils-2.9.0/encode/vp8enc.c       2020-09-12 00:13:28.000000000 
+0200
@@ -1095,7 +1095,8 @@
 int main(int argc, char *argv[])
 {
   int current_frame, frame_type;
-  FILE *fp_vp8_output, *fp_yuv_input;
+  FILE *fp_vp8_output = NULL;
+  FILE *fp_yuv_input = NULL;
   uint64_t timestamp;
   struct timeval t1,t2;
   double fps, elapsed_time;
@@ -1118,7 +1119,15 @@
   settings.height = atoi(argv[2]);
   parameter_check("Height", settings.height, 16, MAX_XY_RESOLUTION);
 
-  fp_yuv_input = fopen(argv[3],"rb");
+  if( settings.rc_mode == VA_RC_VBR && settings.max_variable_bitrate < 
settings.frame_bitrate)
+  {
+      fprintf(stderr,"Error: max. variable bitrate should be greater than 
frame bitrate (--vbr_max >= --fb)\n");
+      return VP8ENC_FAIL;
+  }
+
+  if(argv[3]) {
+    fp_yuv_input = fopen(argv[3],"rb");
+  }
   if(fp_yuv_input == NULL)
   {
     fprintf(stderr,"Error: Couldn't open input file.\n");
@@ -1133,12 +1142,6 @@
     return VP8ENC_FAIL;
   }
 
-  if( settings.rc_mode == VA_RC_VBR && settings.max_variable_bitrate < 
settings.frame_bitrate)
-  {
-      fprintf(stderr,"Error: max. variable bitrate should be greater than 
frame bitrate (--vbr_max >= --fb)\n");
-      return VP8ENC_FAIL;
-  }
-
   if( settings.temporal_svc_layers == 2 && settings.intra_period % 2)
       fprintf(stderr,"Warning: Choose Key-Frame interval (--intra_period) to 
be integer mutliply of 2 to match temporal layer pattern");
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/meson.build 
new/libva-utils-2.9.0/meson.build
--- old/libva-utils-2.8.0/meson.build   2020-06-26 01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/meson.build   2020-09-12 00:13:28.000000000 +0200
@@ -1,5 +1,5 @@
 project('libva-utils', 'c', 'cpp',
-        version : '2.8.0',
+        version : '2.9.0',
         default_options : [
           'warning_level=2',
           'c_std=gnu99',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/putsurface/putsurface_common.c 
new/libva-utils-2.9.0/putsurface/putsurface_common.c
--- old/libva-utils-2.8.0/putsurface/putsurface_common.c        2020-06-26 
01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/putsurface/putsurface_common.c        2020-09-12 
00:13:28.000000000 +0200
@@ -591,7 +591,7 @@
                     printf("The validate input for -f is: 1(top 
field)/2(bottom field)\n");
                 break;
             case '1':
-                sscanf(optarg, "%s", str_src_fmt);
+                sscanf(optarg, "%5s", str_src_fmt);
                 csc_src_fourcc = map_str_to_vafourcc (str_src_fmt);
                 
                                if (!csc_src_fourcc) {
@@ -600,7 +600,7 @@
                 }
                 break;
             case '2':
-                sscanf(optarg, "%s", str_dst_fmt);
+                sscanf(optarg, "%5s", str_dst_fmt);
                 csc_dst_fourcc = map_str_to_vafourcc (str_dst_fmt);
                 
                                if (!csc_dst_fourcc) {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libva-utils-2.8.0/vendor/intel/sfcsample/VDecAccelVA.cpp 
new/libva-utils-2.9.0/vendor/intel/sfcsample/VDecAccelVA.cpp
--- old/libva-utils-2.8.0/vendor/intel/sfcsample/VDecAccelVA.cpp        
2020-06-26 01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/vendor/intel/sfcsample/VDecAccelVA.cpp        
2020-09-12 00:13:28.000000000 +0200
@@ -76,6 +76,9 @@
 
 mvaccel::VDecAccelVAImpl::~VDecAccelVAImpl()
 {
+    if (drm_fd != -1) {
+        close(drm_fd);
+    }
 }
 
 
@@ -85,7 +88,6 @@
 
     //get display device
     int MajorVer, MinorVer;
-    int drm_fd = -1;
 
        if (vaStatus != VA_STATUS_SUCCESS) {
         drm_fd = open("/dev/dri/renderD128", O_RDWR);
@@ -595,8 +597,10 @@
     //write to yuv file
     FILE* sfc_stream = fopen("sfc_sample_176_144_argb.yuv", "wb");
     uint32_t file_size = m_DecodeDesc.sfc_widht * m_DecodeDesc.sfc_height * 4; 
//ARGB format
-    fwrite(gfx_surface_buf, file_size, 1, sfc_stream);
-    fclose(sfc_stream);
+    if (sfc_stream) {
+        fwrite(gfx_surface_buf, file_size, 1, sfc_stream);
+        fclose(sfc_stream);
+    }
  
     //unlock surface and clear
     unlock_surface(m_sfcIDs[0]);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libva-utils-2.8.0/vendor/intel/sfcsample/VDecAccelVA.h 
new/libva-utils-2.9.0/vendor/intel/sfcsample/VDecAccelVA.h
--- old/libva-utils-2.8.0/vendor/intel/sfcsample/VDecAccelVA.h  2020-06-26 
01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/vendor/intel/sfcsample/VDecAccelVA.h  2020-09-12 
00:13:28.000000000 +0200
@@ -99,6 +99,7 @@
     int         create_resources();
 
 protected:
+    int drm_fd = -1;
     // VA ID & Handles
     VADisplay       m_vaDisplay;    /**< @brief VA hardware device */
     VAProfile       m_vaProfile;    /**< @brief Video decoder profile */
@@ -129,14 +130,14 @@
         NEW_H,
     };
 
-    DecodeDesc                    m_DecodeDesc;       /**< @brief decode 
discription */
-    VARectangle                   m_rectSrc;          /**< @brief Rectangle 
for source input */
-    VARectangle                   m_rectSFC;          /**< @brief Rectangle 
for SFC output */
-    std::vector<uint32_t>         m_in4CC;            /**< @brief input FOURCC 
*/
-    std::vector<uint32_t>         m_out4CC;           /**< @brief output 
FOURCC */
-    std::map<SFC,uint32_t>        m_sfcSize;          /**< @brief SFC sizes */
-    std::vector<VASurfaceID>      m_sfcIDs;           /**< @brief sfc surfaces 
*/
-    VAProcPipelineParameterBuffer m_vaProcBuffer;     /**< @brief sfc pipeline 
buffer */
+    DecodeDesc                    m_DecodeDesc{};     /**< @brief decode 
discription */
+    VARectangle                   m_rectSrc{};        /**< @brief Rectangle 
for source input */
+    VARectangle                   m_rectSFC{};        /**< @brief Rectangle 
for SFC output */
+    std::vector<uint32_t>         m_in4CC{};          /**< @brief input FOURCC 
*/
+    std::vector<uint32_t>         m_out4CC{};         /**< @brief output 
FOURCC */
+    std::map<SFC,uint32_t>        m_sfcSize{};        /**< @brief SFC sizes */
+    std::vector<VASurfaceID>      m_sfcIDs{};         /**< @brief sfc surfaces 
*/
+    VAProcPipelineParameterBuffer m_vaProcBuffer{};   /**< @brief sfc pipeline 
buffer */
 };
 } // namespace mvaccel
 #endif // MV_ACCELERATOR_VAAPI_DECODE_H
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libva-utils-2.8.0/videoprocess/vavpp.cpp 
new/libva-utils-2.9.0/videoprocess/vavpp.cpp
--- old/libva-utils-2.8.0/videoprocess/vavpp.cpp        2020-06-26 
01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/videoprocess/vavpp.cpp        2020-09-12 
00:13:28.000000000 +0200
@@ -482,6 +482,29 @@
             y_src += surface_image.width * 4;
             y_dst += surface_image.pitches[0];
         }
+    } else if (surface_image.format.fourcc == VA_FOURCC_RGBP &&
+                g_src_file_fourcc == VA_FOURCC_RGBP) {
+        int i;
+
+        frame_size = surface_image.width * surface_image.height * 3;
+        newImageBuffer = (unsigned char*)malloc(frame_size);
+        assert(newImageBuffer);
+
+        do {
+            n_items = fread(newImageBuffer, frame_size, 1, fp);
+        } while (n_items != 1);
+
+        y_src = newImageBuffer;
+
+        for (i = 0; i < 3; i++) {
+            y_dst = (unsigned char *)((unsigned char*)surface_p + 
surface_image.offsets[i]);
+
+            for (row = 0; row < surface_image.height; row++) {
+                memcpy(y_dst, y_src, surface_image.width);
+                y_src += surface_image.width;
+                y_dst += surface_image.pitches[i];
+            }
+        }
     } else {
          printf("Not supported YUV surface fourcc !!! \n");
          return VA_STATUS_ERROR_INVALID_SURFACE;
@@ -1009,6 +1032,56 @@
 }
 
 static VAStatus
+store_rgbp_surface_to_rgbp_file(FILE *fp, VASurfaceID surface_id)
+{
+    VAStatus va_status;
+    VAImage surface_image;
+    void *surface_p = NULL;
+    unsigned char *y_src;
+    unsigned char *y_dst;
+    uint32_t frame_size, row;
+    int32_t n_items;
+    unsigned char * newImageBuffer = NULL;
+    int i;
+
+    va_status = vaDeriveImage(va_dpy, surface_id, &surface_image);
+    CHECK_VASTATUS(va_status, "vaDeriveImage");
+
+    va_status = vaMapBuffer(va_dpy, surface_image.buf, &surface_p);
+    CHECK_VASTATUS(va_status, "vaMapBuffer");
+
+    frame_size = surface_image.width * surface_image.height * 3;
+    newImageBuffer = (unsigned char*)malloc(frame_size);
+    assert(newImageBuffer);
+    y_dst = newImageBuffer;
+
+    for (i = 0; i < 3; i++) {
+        y_src = (unsigned char *)((unsigned char*)surface_p + 
surface_image.offsets[i]);
+
+        for (row = 0; row < surface_image.height; row++) {
+            memcpy(y_dst, y_src, surface_image.width);
+            y_src += surface_image.pitches[i];
+            y_dst += surface_image.width;
+        }
+    }
+
+    /* write frame to file */
+    do {
+        n_items = fwrite(newImageBuffer, frame_size, 1, fp);
+    } while (n_items != 1);
+
+    if (newImageBuffer){
+        free(newImageBuffer);
+        newImageBuffer = NULL;
+    }
+
+    vaUnmapBuffer(va_dpy, surface_image.buf);
+    vaDestroyImage(va_dpy, surface_image.image_id);
+
+    return VA_STATUS_SUCCESS;
+}
+
+static VAStatus
 store_yuv_surface_to_file(FILE *fp,
                           VASurfaceID surface_id)
 {
@@ -1046,6 +1119,9 @@
                (g_out_fourcc == VA_FOURCC_BGRX &&
                 g_dst_file_fourcc == VA_FOURCC_BGRX)) {
         return store_rgb_surface_to_rgb_file(fp, surface_id);
+    } else if (g_out_fourcc == VA_FOURCC_RGBP &&
+               g_dst_file_fourcc == VA_FOURCC_RGBP) {
+        return store_rgbp_surface_to_rgbp_file(fp, surface_id);
     } else {
         printf("Not supported YUV fourcc for output !!!\n");
         return VA_STATUS_ERROR_INVALID_SURFACE;
@@ -1635,9 +1711,13 @@
     } else if (!strcmp(str, "AYUV")) {
         tfourcc = VA_FOURCC_AYUV;
         tformat = VA_RT_FORMAT_YUV444;
-    } else{
+    } else if (!strcmp(str, "RGBP")) {
+        tfourcc = VA_FOURCC_RGBP;
+        tformat = VA_RT_FORMAT_RGBP;
+    } else {
         printf("Not supported format: %s! Currently only support following 
format: %s\n",
-               str, "YV12, I420, NV12, YUY2(YUYV), UYVY, AYUV, P010, I010, 
RGBA, RGBX, BGRA or BGRX");
+               str, "YV12, I420, NV12, YUY2(YUYV), UYVY, AYUV, P010, I010, 
RGBA, RGBX, BGRA, "
+               "BGRX or RGBP");
         assert(0);
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libva-utils-2.8.0/videoprocess/vppscaling_n_out_usrptr.cpp 
new/libva-utils-2.9.0/videoprocess/vppscaling_n_out_usrptr.cpp
--- old/libva-utils-2.8.0/videoprocess/vppscaling_n_out_usrptr.cpp      
2020-06-26 01:50:07.000000000 +0200
+++ new/libva-utils-2.9.0/videoprocess/vppscaling_n_out_usrptr.cpp      
2020-09-12 00:13:28.000000000 +0200
@@ -180,7 +180,7 @@
 static VAStatus
 create_surface(VPP_ImageInfo &img_info,VASurfaceID * p_surface_id)
 {
-    VAStatus va_status;
+    VAStatus va_status = VA_STATUS_SUCCESS;
     if(img_info.memtype == VA_SURFACE_ATTRIB_MEM_TYPE_VA){
         VASurfaceAttrib    surface_attrib;
         surface_attrib.type =  VASurfaceAttribPixelFormat;


Reply via email to