mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-09-14 16:54:08 +00:00
Bugfix: big endian items in unpact_2bit_samples
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include "unpack_2bit_samples.h"
|
#include "unpack_2bit_samples.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <glog/logging.h>
|
||||||
#include <gnuradio/io_signature.h>
|
#include <gnuradio/io_signature.h>
|
||||||
|
|
||||||
struct byte_2bit_struct
|
struct byte_2bit_struct
|
||||||
@@ -118,12 +119,17 @@ unpack_2bit_samples::unpack_2bit_samples( bool big_endian_bytes,
|
|||||||
// Only swap the item bytes if the item size > 1 byte and the system
|
// Only swap the item bytes if the item size > 1 byte and the system
|
||||||
// endianess is not the same as the item endianness:
|
// endianess is not the same as the item endianness:
|
||||||
swap_endian_items_ = ( item_size_ > 1 ) &&
|
swap_endian_items_ = ( item_size_ > 1 ) &&
|
||||||
( big_endian_system != big_endian_items);
|
( !big_endian_items);
|
||||||
|
|
||||||
bool big_endian_bytes_system = systemBytesAreBigEndian();
|
bool big_endian_bytes_system = systemBytesAreBigEndian();
|
||||||
|
|
||||||
swap_endian_bytes_ = ( big_endian_bytes_system != big_endian_bytes_ );
|
swap_endian_bytes_ = ( big_endian_bytes_system != big_endian_bytes_ );
|
||||||
|
|
||||||
|
LOG(INFO) << "swap_endian_items_ : " << swap_endian_items_
|
||||||
|
<< ". swap_endian_bytes_ : " << swap_endian_bytes_
|
||||||
|
<< ". item_size_ : " << item_size_
|
||||||
|
<< ". reverse_interleaving_ : " << reverse_interleaving_;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
unpack_2bit_samples::~unpack_2bit_samples()
|
unpack_2bit_samples::~unpack_2bit_samples()
|
||||||
@@ -138,7 +144,7 @@ int unpack_2bit_samples::work(int noutput_items,
|
|||||||
|
|
||||||
size_t ninput_bytes = noutput_items/4;
|
size_t ninput_bytes = noutput_items/4;
|
||||||
size_t ninput_items = ninput_bytes/item_size_;
|
size_t ninput_items = ninput_bytes/item_size_;
|
||||||
|
|
||||||
// Handle endian swap if needed
|
// Handle endian swap if needed
|
||||||
if( swap_endian_items_ )
|
if( swap_endian_items_ )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user