project stringclasses 2
values | commit_id stringlengths 40 40 | target int64 0 1 | func stringlengths 26 142k | idx int64 0 27.3k |
|---|---|---|---|---|
qemu | 4f441474c61f317de7927edfdb1d042b0b6f3882 | 0 | static void spapr_dt_rtas(sPAPRMachineState *spapr, void *fdt)
{
int rtas;
GString *hypertas = g_string_sized_new(256);
GString *qemu_hypertas = g_string_sized_new(256);
uint32_t refpoints[] = { cpu_to_be32(0x4), cpu_to_be32(0x4) };
uint64_t max_hotplug_addr = spapr->hotplug_memory.base +
... | 21,856 |
qemu | b626b51a6721e53817155af720243f59072e424f | 0 | static ssize_t nbd_co_receive_request(NBDRequest *req,
struct nbd_request *request)
{
NBDClient *client = req->client;
uint32_t command;
ssize_t rc;
g_assert(qemu_in_coroutine());
client->recv_coroutine = qemu_coroutine_self();
nbd_update_can_read(... | 21,857 |
qemu | bd269ebc82fbaa5fe7ce5bc7c1770ac8acecd884 | 0 | static void qio_channel_socket_listen_worker(QIOTask *task,
gpointer opaque)
{
QIOChannelSocket *ioc = QIO_CHANNEL_SOCKET(qio_task_get_source(task));
SocketAddressLegacy *addr = opaque;
Error *err = NULL;
qio_channel_socket_listen_sync(ioc, addr, &err... | 21,859 |
qemu | 0544edd88a6acea81aefe22fd0cd9a85d1eef093 | 0 | static void smp_parse(QemuOpts *opts)
{
if (opts) {
unsigned cpus = qemu_opt_get_number(opts, "cpus", 0);
unsigned sockets = qemu_opt_get_number(opts, "sockets", 0);
unsigned cores = qemu_opt_get_number(opts, "cores", 0);
unsigned threads = qemu_opt_get_number(opts, "thr... | 21,861 |
FFmpeg | b8664c929437d6d079e16979c496a2db40cf2324 | 0 | static void vp8_idct_dc_add4y_c(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride)
{
vp8_idct_dc_add_c(dst+ 0, block[0], stride);
vp8_idct_dc_add_c(dst+ 4, block[1], stride);
vp8_idct_dc_add_c(dst+ 8, block[2], stride);
vp8_idct_dc_add_c(dst+12, block[3], stride);
}
| 21,862 |
qemu | 90d131fb6504ed12a37dc8433375cc683c30e9da | 0 | static void rtl8139_io_writeb(void *opaque, uint8_t addr, uint32_t val)
{
RTL8139State *s = opaque;
switch (addr)
{
case MAC0 ... MAC0+5:
s->phys[addr - MAC0] = val;
qemu_format_nic_info_str(qemu_get_queue(s->nic), s->phys);
break;
case MAC0+6 .... | 21,865 |
qemu | 805017b7791200f1b72deef17dc98fd272b941eb | 0 | static void test_validate_fail_union(TestInputVisitorData *data,
const void *unused)
{
UserDefUnion *tmp = NULL;
Error *err = NULL;
Visitor *v;
v = validate_test_init(data, "{ 'type': 'b', 'data' : { 'integer': 42 } }");
visit_type_UserDefUnion(v, &tm... | 21,866 |
qemu | 10ee2aaa417d8d8978cdb2bbed55ebb152df5f6b | 0 | static void nabm_writew (void *opaque, uint32_t addr, uint32_t val)
{
PCIAC97LinkState *d = opaque;
AC97LinkState *s = &d->ac97;
AC97BusMasterRegs *r = NULL;
uint32_t index = addr - s->base[1];
switch (index) {
case PI_SR:
case PO_SR:
case MC_SR:
r = &s->bm_regs[GET_BM ... | 21,867 |
qemu | a8170e5e97ad17ca169c64ba87ae2f53850dab4c | 0 | static void musicpal_misc_write(void *opaque, target_phys_addr_t offset,
uint64_t value, unsigned size)
{
}
| 21,868 |
qemu | e8ede0a8bb5298a6979bcf7ed84ef64a64a4e3fe | 0 | void HELPER(ucf64_cmpd)(float64 a, float64 b, uint32_t c, CPUUniCore32State *env)
{
int flag;
flag = float64_compare_quiet(a, b, &env->ucf64.fp_status);
env->CF = 0;
switch (c & 0x7) {
case 0: /* F */
break;
case 1: /* UN */
if (flag == 2) {
env->CF = 1;
... | 21,869 |
qemu | 134d42d614768b2803e551621f6654dab1fdc2d2 | 0 | static void acpi_align_size(GArray *blob, unsigned align)
{
/* Align size to multiple of given size. This reduces the chance
* we need to change size in the future (breaking cross version migration).
*/
g_array_set_size(blob, (ROUND_UP(acpi_data_len(blob), align) +
g_... | 21,870 |
qemu | e1c37d0e94048502f9874e6356ce7136d4b05bdb | 0 | int fd_start_outgoing_migration(MigrationState *s, const char *fdname)
{
s->fd = monitor_get_fd(s->mon, fdname);
if (s->fd == -1) {
DPRINTF("fd_migration: invalid file descriptor identifier\n");
goto err_after_get_fd;
}
if (fcntl(s->fd, F_SETFL, O_NONBLOCK) == -1) {
DPR... | 21,872 |
FFmpeg | 68f593b48433842f3407586679fe07f3e5199ab9 | 0 | int msmpeg4_decode_picture_header(MpegEncContext * s)
{
int code;
#if 0
{
int i;
for(i=0; i<s->gb.size*8; i++)
printf("%d", get_bits1(&s->gb));
// get_bits1(&s->gb);
printf("END\n");
return -1;
}
#endif
if(s->msmpeg4_version==1){
int start_code, num;
start_code = (get_b... | 21,873 |
qemu | e3f5ec2b5e92706e3b807059f79b1fb5d936e567 | 0 | static void usbnet_receive(void *opaque, const uint8_t *buf, size_t size)
{
USBNetState *s = opaque;
struct rndis_packet_msg_type *msg;
if (s->rndis) {
msg = (struct rndis_packet_msg_type *) s->in_buf;
if (!s->rndis_state == RNDIS_DATA_INITIALIZED)
return;
if (s... | 21,874 |
qemu | ddca7f86ac022289840e0200fd4050b2b58e9176 | 0 | static int v9fs_walk_marshal(V9fsPDU *pdu, uint16_t nwnames, V9fsQID *qids)
{
int i;
size_t offset = 7;
offset += pdu_marshal(pdu, offset, "w", nwnames);
for (i = 0; i < nwnames; i++) {
offset += pdu_marshal(pdu, offset, "Q", &qids[i]);
}
return offset;
}
| 21,877 |
qemu | 88266f5aa70fa71fd5cc20aa4dbeb7a7bd8d2e92 | 0 | static void close_unused_images(BlockDriverState *top, BlockDriverState *base,
const char *base_id)
{
BlockDriverState *intermediate;
intermediate = top->backing_hd;
while (intermediate) {
BlockDriverState *unused;
/* reached base */
if (in... | 21,878 |
qemu | 72cf2d4f0e181d0d3a3122e04129c58a95da713e | 0 | static void qemu_paio_submit(struct qemu_paiocb *aiocb)
{
aiocb->ret = -EINPROGRESS;
aiocb->active = 0;
mutex_lock(&lock);
if (idle_threads == 0 && cur_threads < max_threads)
spawn_thread();
TAILQ_INSERT_TAIL(&request_list, aiocb, node);
mutex_unlock(&lock);
cond_signal(&con... | 21,879 |
qemu | 2e6fc7eb1a4af1b127df5f07b8bb28af891946fa | 0 | static int raw_media_changed(BlockDriverState *bs)
{
return bdrv_media_changed(bs->file->bs);
}
| 21,881 |
qemu | 52ae646d4a3ebdcdcc973492c6a56f2c49b6578f | 0 | bool is_tcg_gen_code(uintptr_t tc_ptr)
{
/* This can be called during code generation, code_gen_buffer_max_size
is used instead of code_gen_ptr for upper boundary checking */
return (tc_ptr >= (uintptr_t)tcg_ctx.code_gen_buffer &&
tc_ptr < (uintptr_t)(tcg_ctx.code_gen_buffer +
... | 21,882 |
FFmpeg | 0bfab80a0d9fce0180e8aa2a947267f89b725091 | 0 | int ff_h264_decode_sei(H264Context *h)
{
while (get_bits_left(&h->gb) > 16) {
int size = 0;
int type = 0;
int ret = 0;
int last = 0;
while (get_bits_left(&h->gb) >= 8 &&
(last = get_bits(&h->gb, 8)) == 255) {
type += 255;
}
... | 21,884 |
FFmpeg | 1dd797e3c9f179f957316a0becbec048b42df8aa | 0 | av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
int fullRange, int brightness,
int contrast, int saturation)
{
const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 ||
c->dstFormat == AV... | 21,886 |
FFmpeg | 892fc83e88a20f9543c6c5be3626712be7a2e6f2 | 0 | static int vp3_decode_init(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;
int i;
s->avctx = avctx;
s->width = avctx->width;
s->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV420P;
avctx->has_b_frames = 0;
dsputil_init(&s->dsp, avctx);
/* initializ... | 21,887 |
qemu | e3cffe6fad29e07d401eabb913a6d88501d5c143 | 1 | static void gen_tlbsync(DisasContext *ctx)
{
#if defined(CONFIG_USER_ONLY)
GEN_PRIV;
#else
CHK_HV;
/* tlbsync is a nop for server, ptesync handles delayed tlb flush,
* embedded however needs to deal with tlbsync. We don't try to be
* fancy and swallow the overhead of checking for both.
... | 21,888 |
FFmpeg | ca203e9985cd2dcf42a0c0853940850d3a8edf3a | 1 | static void search_for_ms(AACEncContext *s, ChannelElement *cpe)
{
int start = 0, i, w, w2, g, sid_sf_boost;
float M[128], S[128];
float *L34 = s->scoefs, *R34 = s->scoefs + 128, *M34 = s->scoefs + 128*2, *S34 = s->scoefs + 128*3;
const float lambda = s->lambda;
const float mslambda = FFMIN(1.... | 21,890 |
qemu | 0dacea92d26c31d453c58de2e99c178fee554166 | 1 | static void net_tx_pkt_do_sw_csum(struct NetTxPkt *pkt)
{
struct iovec *iov = &pkt->vec[NET_TX_PKT_L2HDR_FRAG];
uint32_t csum_cntr;
uint16_t csum = 0;
uint32_t cso;
/* num of iovec without vhdr */
uint32_t iov_len = pkt->payload_frags + NET_TX_PKT_PL_START_FRAG - 1;
uint16_t csl;
... | 21,891 |
FFmpeg | 0b9b3163f2a9be54b986f1e7e7d55a88d1e2f2a8 | 1 | static av_cold int xvid_encode_init(AVCodecContext *avctx)
{
int xerr, i, ret = -1;
int xvid_flags = avctx->flags;
struct xvid_context *x = avctx->priv_data;
uint16_t *intra, *inter;
int fd;
xvid_plugin_single_t single = { 0 };
struct xvid_ff_pass1 rc2pass1 ... | 21,892 |
qemu | 35ecde26018207fe723bec6efbd340db6e9c2d53 | 1 | static void test_submit_co(void)
{
WorkerTestData data;
Coroutine *co = qemu_coroutine_create(co_test_cb);
qemu_coroutine_enter(co, &data);
/* Back here once the worker has started. */
g_assert_cmpint(active, ==, 1);
g_assert_cmpint(data.ret, ==, -EINPROGRESS);
/* qemu_aio_w... | 21,893 |
qemu | 837f21aacf5a714c23ddaadbbc5212f9b661e3f7 | 1 | static void pcnet_transmit(PCNetState *s)
{
hwaddr xmit_cxda = 0;
int count = CSR_XMTRL(s)-1;
int add_crc = 0;
int bcnt;
s->xmit_pos = -1;
if (!CSR_TXON(s)) {
s->csr[0] &= ~0x0008;
return;
}
s->tx_busy = 1;
txagain:
if (pcnet_tdte_poll(s)) {
... | 21,894 |
qemu | 4134ecfeb903c362558cb1cb594ff532fd83fb84 | 1 | long do_sigreturn(CPUMBState *env)
{
struct target_signal_frame *frame;
abi_ulong frame_addr;
target_sigset_t target_set;
sigset_t set;
int i;
frame_addr = env->regs[R_SP];
trace_user_do_sigreturn(env, frame_addr);
/* Make sure the guest isn't playing games. */
if (!lock... | 21,895 |
qemu | 4322e8ced5aaac7191958f09622d199fe61e2d87 | 1 | static hwaddr ppc_hash64_pteg_search(PowerPCCPU *cpu, hwaddr hash,
bool secondary, target_ulong ptem,
ppc_hash_pte64_t *pte)
{
CPUPPCState *env = &cpu->env;
int i;
uint64_t token;
target_ulong pte0, pte1;
target_ulong ... | 21,896 |
qemu | c0532a76b407af4b276dc5a62d8178db59857ea6 | 1 | static void qemu_kvm_eat_signal(CPUState *env, int timeout)
{
struct timespec ts;
int r, e;
siginfo_t siginfo;
sigset_t waitset;
ts.tv_sec = timeout / 1000;
ts.tv_nsec = (timeout % 1000) * 1000000;
sigemptyset(&waitset);
sigaddset(&waitset, SIG_IPI);
qemu_mutex_unlock... | 21,897 |
FFmpeg | 1c37848f9029985d1271da9a0d161c2ebf0aca81 | 1 | static int write_representation(AVFormatContext *s, AVStream *stream, char *id,
int output_width, int output_height,
int output_sample_rate) {
WebMDashMuxContext *w = s->priv_data;
AVDictionaryEntry *irange = av_dict_get(stream->metadata, INITI... | 21,898 |
FFmpeg | 7fe1ecefe17b0146d49cd0003f80266a481d1faa | 1 | static inline int set_options(AVFilterContext *ctx, const char *args)
{
HueContext *hue = ctx->priv;
int n, ret;
char c1 = 0, c2 = 0;
char *old_hue_expr, *old_hue_deg_expr, *old_saturation_expr;
AVExpr *old_hue_pexpr, *old_hue_deg_pexpr, *old_saturation_pexpr;
if (args) {
/... | 21,900 |
qemu | 65072c157e466db2785748a929e775703b20eefe | 1 | static int iothread_stop(Object *object, void *opaque)
{
IOThread *iothread;
iothread = (IOThread *)object_dynamic_cast(object, TYPE_IOTHREAD);
if (!iothread || !iothread->ctx) {
return 0;
}
iothread->stopping = true;
aio_notify(iothread->ctx);
if (atomic_read(&iothread->m... | 21,902 |
qemu | 274fb0e1ed962e9ae43ab05e7939499cebb39d26 | 1 | SCSIDevice *scsi_disk_init(BlockDriverState *bdrv, int tcq,
scsi_completionfn completion, void *opaque)
{
SCSIDevice *d;
SCSIDeviceState *s;
s = (SCSIDeviceState *)qemu_mallocz(sizeof(SCSIDeviceState));
s->bdrv = bdrv;
s->tcq = tcq;
s->completion = completio... | 21,903 |
qemu | a14ff8a650b5943ee6221b952494661f7cb3b5e2 | 1 | static void usbredir_handle_destroy(USBDevice *udev)
{
USBRedirDevice *dev = DO_UPCAST(USBRedirDevice, dev, udev);
qemu_chr_delete(dev->cs);
/* Note must be done after qemu_chr_close, as that causes a close event */
qemu_bh_delete(dev->chardev_close_bh);
qemu_del_timer(dev->attach_timer);... | 21,904 |
FFmpeg | 5ff998a233d759d0de83ea6f95c383d03d25d88e | 1 | static int find_optimal_param(uint32_t sum, int n)
{
int k;
uint32_t sum2;
if (sum <= n >> 1)
return 0;
sum2 = sum - (n >> 1);
k = av_log2(n < 256 ? FASTDIV(sum2, n) : sum2 / n);
return FFMIN(k, MAX_RICE_PARAM);
}
| 21,905 |
qemu | 6cec5487990bf3f1f22b3fcb871978255e92ae0d | 1 | static void set_pixel_format(VncState *vs,
int bits_per_pixel, int depth,
int big_endian_flag, int true_color_flag,
int red_max, int green_max, int blue_max,
int red_shift, int green_shift, int blue_shift)
{
int host_big_endian_flag;
#ifdef WORDS_BIGENDIAN
host_big_endi... | 21,906 |
qemu | 1dd3a44753f10970ded50950d28353c00bfcaf91 | 1 | static int bdrv_check_byte_request(BlockDriverState *bs, int64_t offset,
size_t size)
{
int64_t len;
if (!bdrv_is_inserted(bs))
return -ENOMEDIUM;
if (bs->growable)
return 0;
len = bdrv_getlength(bs);
if (offset < 0)
if ((offset > len) || (len -... | 21,907 |
qemu | e5d1fca0f20babbe355957b9ba536fe6187691cc | 1 | static void net_socket_accept(void *opaque)
{
NetSocketListenState *s = opaque;
NetSocketState *s1;
struct sockaddr_in saddr;
socklen_t len;
int fd;
for(;;) {
len = sizeof(saddr);
fd = qemu_accept(s->fd, (struct sockaddr *)&saddr, &len);
if (fd < 0 && errno !=... | 21,908 |
FFmpeg | 669419939c1d36be35196859dc73ec9a194157ad | 1 | static void svq3_luma_dc_dequant_idct_c(int16_t *output, int16_t *input, int qp)
{
const int qmul = svq3_dequant_coeff[qp];
#define stride 16
int i;
int temp[16];
static const uint8_t x_offset[4] = { 0, 1 * stride, 4 * stride, 5 * stride };
for (i = 0; i < 4; i++) {
const int z0 = ... | 21,909 |
FFmpeg | cb023d9afe9da0a9d221b5eeddd2981c520b5978 | 1 | static av_cold int adpcm_encode_init(AVCodecContext *avctx)
{
ADPCMEncodeContext *s = avctx->priv_data;
uint8_t *extradata;
int i;
if (avctx->channels > 2)
return -1; /* only stereo or mono =) */
if (avctx->trellis && (unsigned)avctx->trellis > 16U) {
av_log(avctx, AV_LOG_E... | 21,910 |
FFmpeg | d9d9fd9446eb722fd288f56d905f0dfde661af8f | 1 | int ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl)
{
ERContext *er = &sl->er;
int mb_array_size = h->mb_height * h->mb_stride;
int y_size = (2 * h->mb_width + 1) * (2 * h->mb_height + 1);
int c_size = h->mb_stride * (h->mb_height + 1);
int yc_size = y_size + 2 * c_size;
... | 21,911 |
qemu | 0426d53c6530606bf7641b83f2b755fe61c280ee | 1 | static void test_visitor_in_alternate_number(TestInputVisitorData *data,
const void *unused)
{
Visitor *v;
Error *err = NULL;
AltStrBool *asb;
AltStrNum *asn;
AltNumStr *ans;
AltStrInt *asi;
AltIntNum *ain;
AltNumInt *ani;
/* ... | 21,912 |
qemu | e49ab19fcaa617ad6cdfe1ac401327326b6a2552 | 1 | static int coroutine_fn iscsi_co_writev(BlockDriverState *bs,
int64_t sector_num, int nb_sectors,
QEMUIOVector *iov)
{
IscsiLun *iscsilun = bs->opaque;
struct IscsiTask iTask;
uint64_t lba;
uint32_t num_sectors;
... | 21,913 |
qemu | 4f298a4b2957b7833bc607c951ca27c458d98d88 | 1 | static void add_sel_entry(IPMIBmcSim *ibs,
uint8_t *cmd, unsigned int cmd_len,
uint8_t *rsp, unsigned int *rsp_len,
unsigned int max_rsp_len)
{
IPMI_CHECK_CMD_LEN(18);
if (sel_add_event(ibs, cmd + 2)) {
rsp[2] = IPMI_CC... | 21,915 |
qemu | 5839e53bbc0fec56021d758aab7610df421ed8c8 | 1 | static void vmdk_free_last_extent(BlockDriverState *bs)
{
BDRVVmdkState *s = bs->opaque;
if (s->num_extents == 0) {
return;
}
s->num_extents--;
s->extents = g_realloc(s->extents, s->num_extents * sizeof(VmdkExtent));
}
| 21,916 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static int libschroedinger_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
const AVFrame *frame, int *got_packet)
{
int enc_size = 0;
SchroEncoderParams *p_schro_params = avctx->priv_data;
SchroEncoder *encoder = p_schro_params->encoder;
struct FFSchroEnc... | 21,917 |
qemu | 0b8b8753e4d94901627b3e86431230f2319215c4 | 1 | static int qcow2_write(BlockDriverState *bs, int64_t sector_num,
const uint8_t *buf, int nb_sectors)
{
Coroutine *co;
AioContext *aio_context = bdrv_get_aio_context(bs);
Qcow2WriteCo data = {
.bs = bs,
.sector_num = sector_num,
.buf = buf... | 21,920 |
qemu | 43c696a298f6bef81818b1d8e64d41a160782101 | 1 | static void virtio_scsi_hotplug(HotplugHandler *hotplug_dev, DeviceState *dev,
Error **errp)
{
VirtIODevice *vdev = VIRTIO_DEVICE(hotplug_dev);
VirtIOSCSI *s = VIRTIO_SCSI(vdev);
SCSIDevice *sd = SCSI_DEVICE(dev);
if (s->ctx && !s->dataplane_disabled) {
V... | 21,922 |
qemu | 2d528d45ecf5ee3c1a566a9f3d664464925ef830 | 1 | static CharDriverState *qemu_chr_open_pty(const char *id,
ChardevReturn *ret)
{
CharDriverState *chr;
PtyCharDriver *s;
int master_fd, slave_fd;
char pty_name[PATH_MAX];
master_fd = qemu_openpty_raw(&slave_fd, pty_name);
if (master_fd < 0) {
... | 21,923 |
FFmpeg | 1e3f77b53a803a6c63fa64829f1be557b8226288 | 1 | static void RENAME(uyvytoyuv420)(uint8_t *ydst, uint8_t *udst, uint8_t *vdst, const uint8_t *src,
int width, int height,
int lumStride, int chromStride, int srcStride)
{
int y;
const int chromWidth = FF_CEIL_RSHIFT(width, 1);
for (y=0... | 21,924 |
FFmpeg | 4b7356ce8f2c7902a9b97645f86e0ae09bc2676c | 1 | av_cold int ff_h264_decode_init(AVCodecContext *avctx)
{
H264Context *h = avctx->priv_data;
int i;
int ret;
h->avctx = avctx;
h->bit_depth_luma = 8;
h->chroma_format_idc = 1;
h->cur_chroma_format_idc = 1;
ff_h264dsp_init(&h->h264dsp, 8, 1);
av_assert0(h->sps.bit_... | 21,926 |
FFmpeg | f5d46d332258dcd8ca623019ece1d5e5bb74142b | 1 | static int decode_hextile(VmncContext *c, uint8_t* dst, GetByteContext *gb,
int w, int h, int stride)
{
int i, j, k;
int bg = 0, fg = 0, rects, color, flags, xy, wh;
const int bpp = c->bpp2;
uint8_t *dst2;
int bw = 16, bh = 16;
for (j = 0; j < h; j += 16) {
... | 21,927 |
qemu | 1108b2f8a939fb5778d384149e2f1b99062a72da | 1 | int msi_init(struct PCIDevice *dev, uint8_t offset,
unsigned int nr_vectors, bool msi64bit, bool msi_per_vector_mask)
{
unsigned int vectors_order;
uint16_t flags;
uint8_t cap_size;
int config_offset;
if (!msi_nonbroken) {
return -ENOTSUP;
}
MSI_DEV_PRINTF(... | 21,928 |
FFmpeg | a00676e48e49a3d794d6d2063ceca539e945a4a4 | 1 | static int read_motion_values(AVCodecContext *avctx, GetBitContext *gb, Bundle *b)
{
int t, sign, v;
const uint8_t *dec_end;
CHECK_READ_VAL(gb, b, t);
dec_end = b->cur_dec + t;
if (dec_end > b->data_end) {
av_log(avctx, AV_LOG_ERROR, "Too many motion values\n");
return -1;
... | 21,929 |
qemu | 7d1b0095bff7157e856d1d0e6c4295641ced2752 | 1 | static int gen_set_psr(DisasContext *s, uint32_t mask, int spsr, TCGv t0)
{
TCGv tmp;
if (spsr) {
/* ??? This is also undefined in system mode. */
if (IS_USER(s))
return 1;
tmp = load_cpu_field(spsr);
tcg_gen_andi_i32(tmp, tmp, ~mask);
tcg_gen_andi... | 21,930 |
FFmpeg | 10931720cd55d83e0b933b8a9bb0795fd9e48875 | 1 | int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width)
{
int i;
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
int max_step [4]; /* max pixel step for each plane */
int max_step_comp[4]; /* the component for each plane which has the ma... | 21,931 |
qemu | fdad35ef6c5839d50dfc14073364ac893afebc30 | 1 | static int nbd_negotiate_options(NBDClient *client, uint16_t myflags,
Error **errp)
{
uint32_t flags;
bool fixedNewstyle = false;
bool no_zeroes = false;
/* Client sends:
[ 0 .. 3] client flags
Then we loop until NBD_OPT_EXPORT_NAME or NBD_OPT_GO:
... | 21,932 |
qemu | caffdac363801cd2cf2bf01ad013a8c1e1e43800 | 1 | static int virtio_ccw_blk_init(VirtioCcwDevice *ccw_dev)
{
VirtIOBlkCcw *dev = VIRTIO_BLK_CCW(ccw_dev);
DeviceState *vdev = DEVICE(&dev->vdev);
virtio_blk_set_conf(vdev, &(dev->blk));
qdev_set_parent_bus(vdev, BUS(&ccw_dev->bus));
if (qdev_init(vdev) < 0) {
return -1;
}
re... | 21,933 |
FFmpeg | 220b24c7c97dc033ceab1510549f66d0e7b52ef1 | 1 | static av_cold int libschroedinger_decode_close(AVCodecContext *avctx)
{
SchroDecoderParams *p_schro_params = avctx->priv_data;
/* Free the decoder. */
schro_decoder_free(p_schro_params->decoder);
av_freep(&p_schro_params->format);
/* Free data in the output frame queue. */
ff_schro_que... | 21,934 |
FFmpeg | 636ced8e1dc8248a1353b416240b93d70ad03edb | 1 | static void parse_forced_key_frames(char *kf, OutputStream *ost,
AVCodecContext *avctx)
{
char *p;
int n = 1, i;
int64_t t;
for (p = kf; *p; p++)
if (*p == ',')
n++;
ost->forced_kf_count = n;
ost->forced_kf_pts = av_malloc(siz... | 21,935 |
FFmpeg | 0f0b5d643401d4d83322eeee0e57eb5a226ef9ab | 1 | void decode_mvs(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y)
{
VP8Macroblock *mb_edge[3] = { mb + 2 /* top */,
mb - 1 /* left */,
mb + 1 /* top-left */ };
enum { CNT_ZERO, CNT_NEAREST, CNT_NEAR, CNT_SPLITMV };
enum { VP8_EDGE... | 21,936 |
FFmpeg | 2fc354f90d61f5f1bb75dbdd808a502dec69cf99 | 0 | static int check_output_constraints(InputStream *ist, OutputStream *ost)
{
OutputFile *of = output_files[ost->file_index];
int ist_index = input_files[ist->file_index]->ist_index + ist->st->index;
if (ost->source_index != ist_index)
return 0;
if (of->start_time && ist->pts < of->start... | 21,937 |
qemu | 27a83f8e7ed63ced7e36c47a42f46ab44ee02bd8 | 1 | CPUState *mon_get_cpu(void)
{
if (!cur_mon->mon_cpu) {
monitor_set_cpu(0);
}
cpu_synchronize_state(cur_mon->mon_cpu);
return cur_mon->mon_cpu;
}
| 21,939 |
FFmpeg | d51d6ae9c41310d62f4582c07c2fad26d41eeca6 | 1 | static int vc1_decode_p_mb_intfr(VC1Context *v)
{
MpegEncContext *s = &v->s;
GetBitContext *gb = &s->gb;
int i;
int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
int cbp = 0; /* cbp decoding stuff */
int mqdiff, mquant; /* MB quantization */
int ttmb = v->ttfrm; /* MB Transform type */
... | 21,940 |
qemu | 737d2b3c41d59eb8f94ab7eb419b957938f24943 | 1 | ssize_t ne2000_receive(NetClientState *nc, const uint8_t *buf, size_t size_)
{
NE2000State *s = qemu_get_nic_opaque(nc);
int size = size_;
uint8_t *p;
unsigned int total_len, next, avail, len, index, mcast_idx;
uint8_t buf1[60];
static const uint8_t broadcast_macaddr[6] =
{ 0xff,... | 21,941 |
FFmpeg | 7c7e7c44a6eb68eca861e45cb2ce78f582b12c69 | 1 | static av_cold int decode_init_thread_copy(AVCodecContext *avctx)
{
HYuvContext *s = avctx->priv_data;
int i, ret;
if ((ret = ff_huffyuv_alloc_temp(s)) < 0) {
ff_huffyuv_common_end(s);
return ret;
}
for (i = 0; i < 8; i++)
s->vlc[i].table = NULL;
if (s->version >= 2) {
... | 21,942 |
qemu | 00b8702581f312aa46f797a8b3153d9b2892d967 | 1 | static void get_pci_host_devaddr(Object *obj, Visitor *v, const char *name,
void *opaque, Error **errp)
{
DeviceState *dev = DEVICE(obj);
Property *prop = opaque;
PCIHostDeviceAddress *addr = qdev_get_prop_ptr(dev, prop);
char buffer[] = "xxxx:xx:xx.x";
char *... | 21,943 |
FFmpeg | 87e8788680e16c51f6048af26f3f7830c35207a5 | 0 | static int cin_probe(AVProbeData *p)
{
if (p->buf_size < 18)
return 0;
/* header starts with this special marker */
if (AV_RL32(&p->buf[0]) != 0x55AA0000)
return 0;
/* for accuracy, check some header field values */
if (AV_RL32(&p->buf[12]) != 22050 || p->buf[16] != 16 ||... | 21,944 |
FFmpeg | af08d9aeea870de017139f7b1c44b7d816cf8e56 | 0 | static int try_decode_frame(AVStream *st, AVPacket *avpkt, AVDictionary **options)
{
AVCodec *codec;
int got_picture = 1, ret = 0;
AVFrame picture;
AVPacket pkt = *avpkt;
if(!st->codec->codec){
AVDictionary *thread_opt = NULL;
codec = avcodec_find_decoder(st->codec->codec... | 21,945 |
FFmpeg | d0df2934ca63a1d5c31602e6558f341bd738bd07 | 0 | static void validate_thread_parameters(AVCodecContext *avctx)
{
int frame_threading_supported = (avctx->codec->capabilities & CODEC_CAP_FRAME_THREADS)
&& !(avctx->flags & CODEC_FLAG_TRUNCATED)
&& !(avctx->flags & CODEC_FLAG_LOW_DELAY)
... | 21,946 |
FFmpeg | 55188278169c3a1838334d7aa47a1f7a40741690 | 1 | static int xan_unpack_luma(const uint8_t *src, const int src_size,
uint8_t *dst, const int dst_size)
{
int tree_size, eof;
const uint8_t *tree;
int bits, mask;
int tree_root, node;
const uint8_t *dst_end = dst + dst_size;
const uint8_t *src_end = src + src_size;
... | 21,947 |
qemu | d9bce9d99f4656ae0b0127f7472db9067b8f84ab | 1 | PPC_OP(set_T1)
{
T1 = PARAM(1);
RETURN();
}
| 21,949 |
qemu | 72b6ffc76653214b69a94a7b1643ff80df134486 | 1 | static int nbd_co_send_request(BlockDriverState *bs,
NBDRequest *request,
QEMUIOVector *qiov)
{
NBDClientSession *s = nbd_get_client_session(bs);
int rc, ret, i;
qemu_co_mutex_lock(&s->send_mutex);
while (s->in_flight == MAX_NBD_REQU... | 21,950 |
qemu | 21b7cf9e07e5991c57b461181cfb5bbb6fe7a9d6 | 1 | static void __attribute__((__constructor__)) rcu_init(void)
{
QemuThread thread;
qemu_mutex_init(&rcu_gp_lock);
qemu_event_init(&rcu_gp_event, true);
qemu_event_init(&rcu_call_ready_event, false);
qemu_thread_create(&thread, "call_rcu", call_rcu_thread,
NULL, QEMU_T... | 21,952 |
FFmpeg | 34e6af9e204ca6bb18d8cf8ec68fe19b0e083e95 | 1 | static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
const uint8_t *buf, int buf_size)
{
GetByteContext gb;
const uint8_t *bs_hdr;
uint32_t frame_num, word2, check_sum, data_size;
uint32_t y_offset, u_offset, v_offset, sta... | 21,953 |
FFmpeg | 2d40a09b6e73230b160a505f01ed1acf169e1d9f | 1 | static int libquvi_probe(AVProbeData *p)
{
int score;
quvi_t q;
QUVIcode rc;
rc = quvi_init(&q);
if (rc != QUVI_OK)
return AVERROR(ENOMEM);
score = quvi_supported(q, (char *)p->filename) == QUVI_OK ? AVPROBE_SCORE_EXTENSION : 0;
quvi_close(&q);
return score;
}
| 21,954 |
FFmpeg | 7f526efd17973ec6d2204f7a47b6923e2be31363 | 1 | void rgb16tobgr16(const uint8_t *src, uint8_t *dst, unsigned int src_size)
{
unsigned i;
unsigned num_pixels = src_size >> 1;
for(i=0; i<num_pixels; i++)
{
unsigned b,g,r;
register uint16_t rgb;
rgb = src[2*i];
r = rgb&0x1F;
g = (rgb&0x7E0)>>5;
b = (rgb&0xF800)>>11;
... | 21,955 |
FFmpeg | a720b854b0d3f0fae2b1eac644dd39e5821cacb1 | 1 | static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
{
int i, j, k, cbp, val, mb_type, motion_type;
const int mb_block_count = 4 + (1 << s->chroma_format);
int ret;
ff_tlog(s->avctx, "decode_mb: x=%d y=%d\n", s->mb_x, s->mb_y);
av_assert2(s->mb_skipped == 0);
if (s->m... | 21,956 |
FFmpeg | 2da0d70d5eebe42f9fcd27ee554419ebe2a5da06 | 1 | static inline void RENAME(rgb15ToUV)(uint8_t *dstU, uint8_t *dstV, uint8_t *src1, uint8_t *src2, int width)
{
int i;
assert(src1 == src2);
for(i=0; i<width; i++)
{
int d0= ((uint32_t*)src1)[i];
int dl= (d0&0x03E07C1F);
int dh= ((d0>>5)&0x03E0F81F);
int dh2= (dh>>11) + (dh<<21);
int d=... | 21,959 |
FFmpeg | 24cdc39e9dfd2b98e96c96387903bd41313bd0dd | 1 | const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len){
const AVOption *o= av_find_opt(obj, name, NULL, 0, 0);
void *dst;
if(!o || o->offset<=0)
return NULL;
if(o->type != FF_OPT_TYPE_STRING && (!buf || !buf_len))
return NULL;
... | 21,960 |
qemu | 34bc07c5282a631c2663ae1ded0a186f46f64612 | 1 | static void increase_dynamic_storage(IVShmemState *s, int new_min_size) {
int j, old_nb_alloc;
old_nb_alloc = s->nb_peers;
while (new_min_size >= s->nb_peers)
s->nb_peers = s->nb_peers * 2;
IVSHMEM_DPRINTF("bumping storage to %d guests\n", s->nb_peers);
s->peers = g_realloc(s->... | 21,961 |
qemu | 3ce21445387c64032a21ae73c995195307a28a36 | 1 | static void usb_host_auto_check(void *unused)
{
struct USBHostDevice *s;
struct USBAutoFilter *f;
libusb_device **devs;
struct libusb_device_descriptor ddesc;
int unconnected = 0;
int i, n;
if (usb_host_init() != 0) {
return;
}
if (runstate_is_running()) {
... | 21,963 |
qemu | 15fa08f8451babc88d733bd411d4c94976f9d0f8 | 1 | int tcg_gen_code(TCGContext *s, TranslationBlock *tb)
{
#ifdef CONFIG_PROFILER
TCGProfile *prof = &s->prof;
#endif
int i, oi, oi_next, num_insns;
#ifdef CONFIG_PROFILER
{
int n;
n = s->gen_op_buf[0].prev + 1;
atomic_set(&prof->op_count, prof->op_count + n);
if ... | 21,964 |
qemu | d6e58090fed20e30e6966007bc4df0c04324d9e7 | 1 | void palette_destroy(VncPalette *palette)
{
if (palette == NULL) {
qemu_free(palette);
}
}
| 21,965 |
qemu | ee640c625e190a0c0e6b8966adc0e4720fb75200 | 1 | static int ivshmem_setup_interrupts(IVShmemState *s)
{
/* allocate QEMU callback data for receiving interrupts */
s->msi_vectors = g_malloc0(s->vectors * sizeof(MSIVector));
if (ivshmem_has_feature(s, IVSHMEM_MSI)) {
if (msix_init_exclusive_bar(PCI_DEVICE(s), s->vectors, 1)) {
re... | 21,966 |
FFmpeg | 4a5cc34b46a8bf8d47ec907383be83b6153b9f69 | 1 | static int wavpack_encode_block(WavPackEncodeContext *s,
int32_t *samples_l, int32_t *samples_r,
uint8_t *out, int out_size)
{
int block_size, start, end, data_size, tcount, temp, m = 0;
int i, j, ret = 0, got_extra = 0, nb_samples = s->block_sampl... | 21,968 |
qemu | 8f5d58ef2c92d7b82d9a6eeefd7c8854a183ba4a | 1 | virtio_crypto_check_cryptodev_is_used(Object *obj, const char *name,
Object *val, Error **errp)
{
if (cryptodev_backend_is_used(CRYPTODEV_BACKEND(val))) {
char *path = object_get_canonical_path_component(val);
error_setg(errp,
"can't use alread... | 21,970 |
qemu | aec4b054ea36c53c8b887da99f20010133b84378 | 1 | static void unterminated_dict(void)
{
QObject *obj = qobject_from_json("{'abc':32", NULL);
g_assert(obj == NULL);
}
| 21,973 |
FFmpeg | 50ce510ac4e3ed093c051738242a9a75aeeb36ce | 0 | static void* attribute_align_arg worker(void *v)
{
AVCodecContext *avctx = v;
SliceThreadContext *c = avctx->internal->thread_ctx;
unsigned last_execute = 0;
int our_job = c->job_count;
int thread_count = avctx->thread_count;
int self_id;
pthread_mutex_lock(&c->current_job_lock);
... | 21,975 |
FFmpeg | bcd7bf7eeb09a395cc01698842d1b8be9af483fc | 0 | static void avc_h_loop_filter_luma_mbaff_intra_msa(uint8_t *src,
int32_t stride,
int32_t alpha_in,
int32_t beta_in)
{
uint64_t load0, load1;
uint32_t out... | 21,976 |
FFmpeg | 6a63ff19b6a7fe3bc32c7fb4a62fca8f65786432 | 0 | static int mov_read_tkhd(MOVContext *c, ByteIOContext *pb, MOVAtom atom)
{
int i;
int width;
int height;
int64_t disp_transform[2];
int display_matrix[3][2];
AVStream *st = c->fc->streams[c->fc->nb_streams-1];
MOVStreamContext *sc = st->priv_data;
int version = get_byte(pb);
... | 21,977 |
qemu | c572f23a3e7180dbeab5e86583e43ea2afed6271 | 1 | static void v9fs_read(void *opaque)
{
int32_t fid;
int64_t off;
ssize_t err = 0;
int32_t count = 0;
size_t offset = 7;
int32_t max_count;
V9fsFidState *fidp;
V9fsPDU *pdu = opaque;
V9fsState *s = pdu->s;
pdu_unmarshal(pdu, offset, "dqd", &fid, &off, &max_count);
... | 21,978 |
qemu | e8ffaa311080a570a7c86d03c139c160cd11a831 | 1 | int qio_channel_readv_all(QIOChannel *ioc,
const struct iovec *iov,
size_t niov,
Error **errp)
{
int ret = -1;
struct iovec *local_iov = g_new(struct iovec, niov);
struct iovec *local_iov_head = local_iov;
unsigned int... | 21,979 |
qemu | b4ba67d9a702507793c2724e56f98e9b0f7be02b | 1 | void qvirtio_pci_device_disable(QVirtioPCIDevice *d)
{
qpci_iounmap(d->pdev, d->addr);
d->addr = NULL;
}
| 21,981 |
qemu | 7c4228b4771acddcb8815079bc116007cec8a1ff | 1 | static void vfio_vga_quirk_teardown(VFIODevice *vdev)
{
int i;
for (i = 0; i < ARRAY_SIZE(vdev->vga.region); i++) {
while (!QLIST_EMPTY(&vdev->vga.region[i].quirks)) {
VFIOQuirk *quirk = QLIST_FIRST(&vdev->vga.region[i].quirks);
memory_region_del_subregion(&vdev->vga.regi... | 21,982 |
FFmpeg | a0c624e299730c8c5800375c2f5f3c6c200053ff | 1 | int ff_v4l2_m2m_codec_full_reinit(V4L2m2mContext *s)
{
void *log_ctx = s->avctx;
int ret;
av_log(log_ctx, AV_LOG_DEBUG, "%s full reinit\n", s->devname);
/* wait for pending buffer references */
if (atomic_load(&s->refcount))
while(sem_wait(&s->refsync) == -1 && errno == EINTR);
... | 21,983 |
FFmpeg | e6bc38fd49c94726b45d5d5cc2b756ad8ec49ee0 | 1 | static av_cold int wmv2_decode_init(AVCodecContext *avctx){
Wmv2Context * const w= avctx->priv_data;
if(avctx->idct_algo==FF_IDCT_AUTO){
avctx->idct_algo=FF_IDCT_WMV2;
}
if(ff_msmpeg4_decode_init(avctx) < 0)
return -1;
ff_wmv2_common_init(w);
ff_intrax8_common_ini... | 21,984 |
FFmpeg | c0220c768c7fc933a76c863ebbb0abdf68a88533 | 1 | static inline int divide3(int x)
{
return ((x+1)*21845 + 10922) >> 16;
}
| 21,985 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.