Hello all,

I'm new to x265 lib. I had a brief look in source and header files. I looked 
into classes in sao.h, encoder.h, x265.h, x265cli.h
You had used lot of 'int' type objects. Currently, C++ offers a header, 
cstdint.  https://en.cppreference.com/w/cpp/header/cstdint
Instead of 'int', I suggest that you use 'int32_t'. I think it is available in 
many ISO C++ compilers. We can change objects defined as 'int' to 'int32_t'. 
There are some differences between int and int32_t in some implementations for 
different CPU's so this can be discussed later in detail.

You had also used plain C-style enums as:
enum SAOType
{
    SAO_EO_0 = 0,
    SAO_EO_1,
    SAO_EO_2,
    SAO_EO_3,
    SAO_BO,
    MAX_NUM_SAO_TYPE
};
This is in sao.h

Plain enums are deprecated (which means not used anymore) in C++14 and beyond. 
If you think it is necessary, we can change it to a enum class as:

enum class SAOType
{
    SAO_EO_0,
    SAO_EO_1,
    SAO_EO_2,
    SAO_EO_3,
    SAO_BO,
    MAX_NUM_SAO_TYPE
};

Each entry in the enum is accessed with the operator '::' such as
SAOType::SAO_E0_0, SAOType::SAO_E0_1 etc.

This is better and easily readable. Regarding providing C-style interface for 
previous users of x264, I think we can think of leaving some plain enums in 
main interface layers of the API. Some plain enums can be changed to enum 
classes or constexpr constants. Objects of type enum defined as typedef enum { 
} can also be changed to enum classes or constexpr int32_t or std::size_t type 
constants. These are a few suggestions.

Best regards,
Amit
_______________________________________________
x265-devel mailing list
x265-devel@videolan.org
https://mailman.videolan.org/listinfo/x265-devel

Reply via email to