vp9_enc_grp_get_next_job: check job queue alloc
authorJames Zern <jzern@google.com>
Wed, 27 Apr 2022 02:07:08 +0000 (19:07 -0700)
committerJames Zern <jzern@google.com>
Wed, 27 Apr 2022 02:18:14 +0000 (19:18 -0700)
+ reverse conditional order; var == constant is more readable

Change-Id: I9f2b4394024c262fd5fe9576a8bf33afe197c050

vp9/encoder/vp9_multi_thread.c

index c66c035..6078f89 100644 (file)
@@ -36,7 +36,7 @@ void *vp9_enc_grp_get_next_job(MultiThreadHandle *multi_thread_ctxt,
   pthread_mutex_lock(mutex_handle);
 #endif
   next = job_queue_hdl->next;
-  if (NULL != next) {
+  if (next != NULL) {
     JobQueue *job_queue = (JobQueue *)next;
     job_info = &job_queue->job_info;
     // Update the next job in the queue
@@ -84,8 +84,8 @@ void vp9_row_mt_mem_alloc(VP9_COMP *cpi) {
   multi_thread_ctxt->allocated_tile_rows = tile_rows;
   multi_thread_ctxt->allocated_vert_unit_rows = jobs_per_tile_col;
 
-  multi_thread_ctxt->job_queue =
-      (JobQueue *)vpx_memalign(32, total_jobs * sizeof(JobQueue));
+  CHECK_MEM_ERROR(cm, multi_thread_ctxt->job_queue,
+                  (JobQueue *)vpx_memalign(32, total_jobs * sizeof(JobQueue)));
 
 #if CONFIG_MULTITHREAD
   // Create mutex for each tile