Skip to content

Commit

Permalink
Fix style issues and includes
Browse files Browse the repository at this point in the history
  • Loading branch information
Edjchg committed Dec 1, 2021
1 parent 33215e2 commit 8125d08
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
18 changes: 9 additions & 9 deletions ext/r2inference/gstrosetta.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
#include "gst/r2inference/gstinferencepostprocess.h"
#include "gst/r2inference/gstinferencepreprocess.h"

#include <string.h>

GST_DEBUG_CATEGORY_STATIC (gst_rosetta_debug_category);
#define GST_CAT_DEFAULT gst_rosetta_debug_category

Expand All @@ -69,7 +67,7 @@ gchar *concatenate_chars (gint max_indices[MODEL_OUTPUT_ROWS]);
static gboolean gst_rosetta_start (GstVideoInference * vi);
static gboolean gst_rosetta_stop (GstVideoInference * vi);

#define CAPS \
#define CAPS \
"video/x-raw, " \
"width=100, " \
"height=32, " \
Expand Down Expand Up @@ -119,7 +117,7 @@ gst_rosetta_class_init (GstRosettaClass * klass)
"Rosetta", "Filter",
"Infers characters from an incoming image",
"Edgar Chaves <[email protected]>\n\t\t\t"
" Luis Leon <[email protected]>\n\t\t\t");
" Luis Leon <[email protected]>");

vi_class->preprocess = GST_DEBUG_FUNCPTR (gst_rosetta_preprocess);
vi_class->postprocess = GST_DEBUG_FUNCPTR (gst_rosetta_postprocess);
Expand Down Expand Up @@ -186,15 +184,17 @@ concatenate_chars (int max_indices[MODEL_OUTPUT_ROWS])
'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q',
'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'
};
// Instead of using g_malloc() & memset g_strnfill(), will create
// the memory allocation and fill the string with empty spaces.
/* Instead of using g_malloc() & memset g_strnfill(), will create
* the memory allocation and fill the string with empty spaces.
*/
final_phrase = g_strnfill (MODEL_OUTPUT_ROWS + 1, ' ');

for (i = 0; i < MODEL_OUTPUT_ROWS; ++i) {

// Checking if the actual max index value is different from '_' character
// and also, checking if i is greater than 0, and finally, checking
//if the actual max index is equal from the previous one.
/* Checking if the actual max index value is different from '_' character
* and also, checking if i is greater than 0, and finally, checking
* if the actual max index is equal from the previous one.
*/
if (BLANK != max_indices[i] && !(0 < i
&& (max_indices[i - 1] == max_indices[i]))) {
final_phrase[counter] = chars[max_indices[i]];
Expand Down
1 change: 0 additions & 1 deletion gst-libs/gst/r2inference/gstinferencepreprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ gst_apply_gray_normalization (GstVideoFrame * inframe, GstVideoFrame * outframe,

for (i = 0; i < height; ++i) {
for (j = 0; j < width; ++j) {

((gfloat *) outframe->data[0])[(i * width + j)] =
(((guchar *) inframe->data[0])[(i * pixel_stride +
j)] * rcp_mean - offset);
Expand Down

0 comments on commit 8125d08

Please sign in to comment.